Skip to content

Commit aae2c78

Browse files
committed
过测试
1 parent e760b69 commit aae2c78

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

script/lclient.lua

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ local await = require 'await'
55
local timer = require 'timer'
66
local pub = require 'pub'
77
local json = require 'json'
8+
local client = require 'client'
9+
local define = require 'proto.define'
810

911
require 'provider'
1012

@@ -61,9 +63,33 @@ function mt:_localLoadFile()
6163
end)
6264
end
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
6590
function 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')
6894
end
6995

script/vm/def.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function vm.getDefs(source)
9393
return results
9494
end
9595

96-
local HAS_DEF_ERR = {} -- the error object for comparing
96+
local HAS_DEF_ERR = {'<HAS_DEF_ERR>'} -- the error object for comparing
9797
local function checkHasDef(checkFunc, source, pushResult)
9898
local _, err = pcall(checkFunc, source, pushResult)
9999
return err == HAS_DEF_ERR

0 commit comments

Comments
 (0)