diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-23 02:57:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-23 02:57:13 +0800 |
commit | 838ce36fdd7abdff0b4cab5e67c2500325178805 (patch) | |
tree | bffd74f604cbcf666ca5d41d1c9f5750e48e1db9 /script/core/code-action.lua | |
parent | 0ff98557a45c25d7a49520e57f49561a62300f35 (diff) | |
download | lua-language-server-838ce36fdd7abdff0b4cab5e67c2500325178805.zip |
update
Diffstat (limited to 'script/core/code-action.lua')
-rw-r--r-- | script/core/code-action.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/script/core/code-action.lua b/script/core/code-action.lua index f9926b64..4eb21ff8 100644 --- a/script/core/code-action.lua +++ b/script/core/code-action.lua @@ -451,7 +451,7 @@ end local function checkSwapParams(results, uri, start, finish) local state = files.getState(uri) local text = files.getText(uri) - if not state then + if not state or not text then return end local args = {} @@ -619,6 +619,9 @@ end local function checkJsonToLua(results, uri, start, finish) local text = files.getText(uri) local state = files.getState(uri) + if not state or not text then + return + end local startOffset = guide.positionToOffset(state, start) local finishOffset = guide.positionToOffset(state, finish) local jsonStart = text:match('()[%{%[]', startOffset + 1) |