Skip to content

Commit 72effcc

Browse files
authored
Merge pull request #2844 from max397574/master
fix(completion): remove logic causing wrong text edits
2 parents e87d7d6 + 7a1430b commit 72effcc

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

script/core/completion/completion.lua

+1-12
Original file line numberDiff line numberDiff line change
@@ -457,19 +457,8 @@ local function checkFieldFromFieldToIndex(state, name, src, parent, word, startP
457457
name = ('%q'):format(name)
458458
end
459459
local textEdit, additionalTextEdits
460-
local startOffset = guide.positionToOffset(state, startPos)
461460
local offset = guide.positionToOffset(state, position)
462-
local wordStartOffset
463-
if word == '' then
464-
wordStartOffset = state.lua:match('()%S', startOffset + 1)
465-
if wordStartOffset then
466-
wordStartOffset = wordStartOffset - 1
467-
else
468-
wordStartOffset = offset
469-
end
470-
else
471-
wordStartOffset = offset - #word
472-
end
461+
local wordStartOffset = offset - #word
473462
local wordStartPos = guide.offsetToPosition(state, wordStartOffset)
474463
local newText = ('[%s]'):format(name)
475464
textEdit = {

0 commit comments

Comments
 (0)