diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-02-09 19:05:58 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-02-09 19:05:58 +0800 |
commit | 3f0d26ef525cc81da24d55706fb079fa5a97b56e (patch) | |
tree | 886806e5b151f80271980fed427bfd876b6fb9d3 /script/core | |
parent | 5ad56c9ccfef9dfbe18a8846d1303b4668077b55 (diff) | |
download | lua-language-server-3f0d26ef525cc81da24d55706fb079fa5a97b56e.zip |
cleanup
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/code-action.lua | 7 | ||||
-rw-r--r-- | script/core/command/jsonToLua.lua | 6 | ||||
-rw-r--r-- | script/core/command/setConfig.lua | 2 | ||||
-rw-r--r-- | script/core/completion/completion.lua | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/script/core/code-action.lua b/script/core/code-action.lua index b2a6fac9..f96e341a 100644 --- a/script/core/code-action.lua +++ b/script/core/code-action.lua @@ -43,13 +43,13 @@ local function checkDisableByLuaDocInsert(uri, row, mode, code) end local function disableDiagnostic(uri, code, start, results) - local row = guide.rowColOf(start) + local row = guide.rowColOf(start) results[#results+1] = { title = lang.script('ACTION_DISABLE_DIAG', code), kind = 'quickfix', command = { - title = lang.script.COMMAND_DISABLE_DIAG, - command = 'lua.setConfig', + title = lang.script.COMMAND_DISABLE_DIAG, + command = 'lua.setConfig', arguments = { { key = 'Lua.diagnostics.disable', @@ -174,7 +174,6 @@ local function solveSyntaxByChangeVersion(uri, err, results) end local function solveSyntaxByAddDoEnd(uri, err, results) - local text = files.getText(uri) results[#results+1] = { title = lang.script.ACTION_ADD_DO_END, kind = 'quickfix', diff --git a/script/core/command/jsonToLua.lua b/script/core/command/jsonToLua.lua index d29ad608..fb0fc6c9 100644 --- a/script/core/command/jsonToLua.lua +++ b/script/core/command/jsonToLua.lua @@ -14,9 +14,9 @@ return function (data) if not text then return end - local start = guide.positionToOffset(state, data.start) - local finish = guide.positionToOffset(state, data.finish) - local jsonStr = text:sub(start + 1, finish) + local start = guide.positionToOffset(state, data.start) + local finish = guide.positionToOffset(state, data.finish) + local jsonStr = text:sub(start + 1, finish) local suc, res = pcall(json.decode, jsonStr) if not suc then proto.notify('window/showMessage', { diff --git a/script/core/command/setConfig.lua b/script/core/command/setConfig.lua index e3eb0d0a..4587dd47 100644 --- a/script/core/command/setConfig.lua +++ b/script/core/command/setConfig.lua @@ -1,5 +1,5 @@ local client = require 'client' return function (data) - client.setConfig {data} + client.setConfig { data } end diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 680b9a23..a8000c91 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -75,7 +75,7 @@ local function findNearestTableField(state, position) if not soffset then return nil end - local symbol = text:sub(soffset, soffset) + local symbol = text:sub(soffset, soffset) if symbol == '}' then return nil end |