File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ local await = require 'await'
55local timer = require ' timer'
66local pub = require ' pub'
77local json = require ' json'
8+ local client = require ' client'
9+ local define = require ' proto.define'
810
911require ' provider'
1012
@@ -61,9 +63,33 @@ function mt:_localLoadFile()
6163 end )
6264end
6365
66+ local defaultClientOptions = {
67+ initializationOptions = {
68+ changeConfiguration = true ,
69+ viewDocument = true ,
70+ trustByClient = true ,
71+ useSemanticByRange = true ,
72+ },
73+ capabilities = {
74+ textDocument = {
75+ completion = {
76+ completionItem = {
77+ tagSupport = {
78+ valueSet = {
79+ define .DiagnosticTag .Unnecessary ,
80+ define .DiagnosticTag .Deprecated ,
81+ },
82+ },
83+ },
84+ },
85+ },
86+ },
87+ }
88+
6489--- @async
6590function mt :initialize (params )
66- self :awaitRequest (' initialize' , params or {})
91+ local initParams = util .tableMerge (params or {}, defaultClientOptions )
92+ self :awaitRequest (' initialize' , initParams )
6793 self :notify (' initialized' )
6894end
6995
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ function vm.getDefs(source)
9393 return results
9494end
9595
96- local HAS_DEF_ERR = {} -- the error object for comparing
96+ local HAS_DEF_ERR = {' <HAS_DEF_ERR> ' } -- the error object for comparing
9797local function checkHasDef (checkFunc , source , pushResult )
9898 local _ , err = pcall (checkFunc , source , pushResult )
9999 return err == HAS_DEF_ERR
You can’t perform that action at this time.
0 commit comments