diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 17:18:52 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 17:18:52 +0800 |
commit | 5bf01cf4db455da812a56d48251786d2da5355aa (patch) | |
tree | 86174abd432509cc6c04c7844fdcfe12a1d0945d /script | |
parent | 891ebf5760d7c7ac39cdcfa7042b33e93f4e9ade (diff) | |
download | lua-language-server-5bf01cf4db455da812a56d48251786d2da5355aa.zip |
#306 fix quickfix: `newline-call` failed
Diffstat (limited to 'script')
-rw-r--r-- | script/core/code-action.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/script/core/code-action.lua b/script/core/code-action.lua index 246e1549..2b45e348 100644 --- a/script/core/code-action.lua +++ b/script/core/code-action.lua @@ -207,6 +207,7 @@ end local function solveNewlineCall(uri, diag, results) local text = files.getText(uri) local lines = files.getLines(uri) + local start = define.unrange(lines, text, diag.range) results[#results+1] = { title = lang.script.ACTION_ADD_SEMICOLON, kind = 'quickfix', @@ -214,10 +215,8 @@ local function solveNewlineCall(uri, diag, results) changes = { [uri] = { { - range = { - start = diag.range.start, - ['end'] = diag.range.start, - }, + start = start, + finish = start, newText = ';', } } |