diff --git a/changelog.md b/changelog.md index b6caa5050..910db1227 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## Unreleased +* `FIX` Fix diagnostic completions incorrect textEdit.finish ## 3.16.0 `2025-12-2` diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index f751e53d5..97cb093ae 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -1925,7 +1925,7 @@ local function tryluaDocBySource(state, position, source, results) kind = define.CompletionItemKind.Enum, textEdit = { start = source.start, - finish = source.start + #source.mode - 1, + finish = source.start + #source.mode, newText = mode, }, } @@ -1940,7 +1940,7 @@ local function tryluaDocBySource(state, position, source, results) kind = define.CompletionItemKind.Value, textEdit = { start = source.start, - finish = source.start + #source[1] - 1, + finish = source.start + #source[1], newText = name, }, }