Skip to content

Commit

Permalink
Merge pull request #2844 from max397574/master
Browse files Browse the repository at this point in the history
fix(completion): remove logic causing wrong text edits
  • Loading branch information
sumneko committed Sep 10, 2024
2 parents e87d7d6 + 7a1430b commit 72effcc
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions script/core/completion/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -457,19 +457,8 @@ local function checkFieldFromFieldToIndex(state, name, src, parent, word, startP
name = ('%q'):format(name)
end
local textEdit, additionalTextEdits
local startOffset = guide.positionToOffset(state, startPos)
local offset = guide.positionToOffset(state, position)
local wordStartOffset
if word == '' then
wordStartOffset = state.lua:match('()%S', startOffset + 1)
if wordStartOffset then
wordStartOffset = wordStartOffset - 1
else
wordStartOffset = offset
end
else
wordStartOffset = offset - #word
end
local wordStartOffset = offset - #word
local wordStartPos = guide.offsetToPosition(state, wordStartOffset)
local newText = ('[%s]'):format(name)
textEdit = {
Expand Down

0 comments on commit 72effcc

Please sign in to comment.