Skip to content

Commit

Permalink
Mark function completion items as snippets
Browse files Browse the repository at this point in the history
The PR LuaLS#3005 assumed that all snippets were setting `insertTextFormat`
to 2 and leaving plaintext completions nil, but that was not the case.
Function completions need to be marked as snippets too.

fixes LuaLS#3021
  • Loading branch information
andrewbraxton committed Jan 3, 2025
1 parent cb964c6 commit 3e0d1df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions script/core/completion/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ local function insertEnum(state, pos, src, enums, isInArray, mark)
description = description,
kind = define.CompletionItemKind.Function,
insertText = insertText,
insertTextFormat = 2,
}
elseif src.type == 'doc.enum' then
---@cast src parser.object
Expand Down

0 comments on commit 3e0d1df

Please sign in to comment.