summaryrefslogtreecommitdiff
path: root/script/provider/client.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-05 20:14:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-05 20:14:13 +0800
commit0d3dce5321332022552fca038e2e2d35985235c6 (patch)
tree841813a24eee3c44f7a162a53ebeb5c17a4d012a /script/provider/client.lua
parentb578d3d0c16f992e29657c3cad8ef9c3dd7d6a2c (diff)
downloadlua-language-server-0d3dce5321332022552fca038e2e2d35985235c6.zip
cleanup
Diffstat (limited to 'script/provider/client.lua')
-rw-r--r--script/provider/client.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/script/provider/client.lua b/script/provider/client.lua
index 5c2ae653..afb0a98f 100644
--- a/script/provider/client.lua
+++ b/script/provider/client.lua
@@ -1,6 +1,7 @@
local nonil = require 'without-check-nil'
local util = require 'utility'
local lang = require 'language'
+local proto = require 'proto'
local m = {}
@@ -28,6 +29,23 @@ function m.isVSCode()
return m._isvscode
end
+---set client config
+---@param key string
+---@param action '"set"'|'"add"'
+---@param value any
+---@param isGlobal boolean
+function m.setConfig(key, action, value, isGlobal)
+ proto.notify('$/command', {
+ command = 'lua.config',
+ data = {
+ key = key,
+ action = action,
+ value = value,
+ global = isGlobal,
+ }
+ })
+end
+
function m.init(t)
log.debug('Client init', util.dump(t))
m.info = t