Skip to content

Commit 8623701

Browse files
committed
reduced sorting priority for postfix completion
1 parent 007e863 commit 8623701

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# changelog
22

33
## 2.6.4
4+
* `CHG` completion: reduced sorting priority for postfix completion
45
* `FIX` [#937](https://github.com/sumneko/lua-language-server/issues/937)
56
* `FIX` [#941](https://github.com/sumneko/lua-language-server/issues/941)
67

script/core/completion/postfix.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ local function checkPostFix(state, word, wordPosition, position, symbol, results
240240
if not source then
241241
return
242242
end
243-
for _, action in ipairs(actions) do
243+
for i, action in ipairs(actions) do
244244
if matchKey(word, action.key) then
245245
action.data[1](state, source, function (newText)
246246
results[#results+1] = {
@@ -261,6 +261,7 @@ local function checkPostFix(state, word, wordPosition, position, symbol, results
261261
newText = '',
262262
},
263263
},
264+
sortText = ('postfix-%04d'):format(i),
264265
}
265266
end)
266267
end

script/provider/provider.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ m.register 'textDocument/completion' {
535535
kind = res.kind,
536536
detail = res.detail,
537537
deprecated = res.deprecated,
538-
sortText = ('%04d'):format(i),
538+
sortText = res.sortText or ('%04d'):format(i),
539539
filterText = res.filterText,
540540
insertText = res.insertText,
541541
insertTextFormat = 2,

0 commit comments

Comments
 (0)