From aae2c7888bad227b6df897b97c01f123744175de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 30 Jul 2024 17:46:00 +0800 Subject: =?UTF-8?q?=E8=BF=87=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/lclient.lua | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'script/lclient.lua') diff --git a/script/lclient.lua b/script/lclient.lua index 13b431b0..96a6c16f 100644 --- a/script/lclient.lua +++ b/script/lclient.lua @@ -5,6 +5,8 @@ local await = require 'await' local timer = require 'timer' local pub = require 'pub' local json = require 'json' +local client = require 'client' +local define = require 'proto.define' require 'provider' @@ -61,9 +63,33 @@ function mt:_localLoadFile() end) end +local defaultClientOptions = { + initializationOptions = { + changeConfiguration = true, + viewDocument = true, + trustByClient = true, + useSemanticByRange = true, + }, + capabilities = { + textDocument = { + completion = { + completionItem = { + tagSupport = { + valueSet = { + define.DiagnosticTag.Unnecessary, + define.DiagnosticTag.Deprecated, + }, + }, + }, + }, + }, + }, +} + ---@async function mt:initialize(params) - self:awaitRequest('initialize', params or {}) + local initParams = util.tableMerge(params or {}, defaultClientOptions) + self:awaitRequest('initialize', initParams) self:notify('initialized') end -- cgit v1.2.3