diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-24 15:47:34 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-24 15:47:34 +0800 |
commit | 75958614871dc316759f826d0f82b26442bbc03b (patch) | |
tree | 27c24f843a23ada283cc5bd9ef3c2ff07ae1f58c /script/core/completion/completion.lua | |
parent | 90d2f4190567891a2497cee80186657d416b19b0 (diff) | |
download | lua-language-server-75958614871dc316759f826d0f82b26442bbc03b.zip |
resolve #655
Diffstat (limited to 'script/core/completion/completion.lua')
-rw-r--r-- | script/core/completion/completion.lua | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index a766cccc..dadc46ca 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -718,15 +718,6 @@ local function checkCommon(state, word, position, results) end end -local function isInString(state, position) - return guide.eachSourceContain(state.ast, position, function (source) - if source.type == 'string' - and source.start < position then - return true - end - end) -end - local function checkKeyWord(state, start, position, word, hasSpace, afterLocal, results) local text = state.lua local snipType = config.get 'Lua.completion.keywordSnippet' @@ -1204,7 +1195,7 @@ local function isFuncArg(state, position) end local function trySpecial(state, position, results) - if isInString(state, position) then + if guide.isInString(state.ast, position) then checkUri(state, position, results) checkEqualEnumInString(state, position, results) return @@ -1238,7 +1229,7 @@ local function tryWord(state, position, triggerCharacter, results) startPos = guide.offsetToPosition(state, start - 1) end local hasSpace = triggerCharacter ~= nil and finish ~= offset - if isInString(state, position) then + if guide.isInString(state.ast, position) then if not hasSpace then if #results == 0 then checkCommon(state, word, position, results) @@ -1284,7 +1275,7 @@ local function trySymbol(state, position, results) if not symbol then return nil end - if isInString(state, position) then + if guide.isInString(state.ast, position) then return nil end local startPos = guide.offsetToPosition(state, start) @@ -2045,9 +2036,7 @@ local function tryCompletions(state, position, triggerCharacter, results) tryComment(state, position, results) return end - if postfix(state, position, results) then - return - end + postfix(state, position, results) trySpecial(state, position, results) tryCallArg(state, position, results) tryTable(state, position, results) |