Skip to content

Commit ed8559e

Browse files
authored
Merge pull request #2773 from tmillr/patch-1
fix: incorrect `CompletionItemKind` for postfix snippets
2 parents d87be6d + 59b4390 commit ed8559e

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* `CHG` Change spacing of parameter inlay hints to match other LSPs, like `rust-analyzer`
1515
* `FIX` Inconsistent type narrow behavior of function call args [#2758](https://github.com/LuaLS/lua-language-server/issues/2758)
1616
* `FIX` Typos in annotation descriptions
17+
* `NEW` You can now click on "References" in CodeLen to display the reference list
18+
* `FIX` incorrect `CompletionItemKind` for postfix snippets [#2773](https://github.com/LuaLS/lua-language-server/pull/2773)
1719
* `NEW` You can now click on "References" in CodeLen to display the reference list(VSCode)
1820
* `NEW` Improved behavior for inserting new lines:
1921
+ When inside an annotation, an annotation tag will be added at the beginning of the line (VSCode).

script/core/completion/postfix.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ local function checkPostFix(state, word, wordPosition, position, symbol, results
353353
end):gsub('%$%{?%d+%}?', '')
354354
results[#results+1] = {
355355
label = action.key,
356-
kind = define.CompletionItemKind.Event,
356+
kind = define.CompletionItemKind.Snippet,
357357
description = markdown()
358358
: add('lua', descText)
359359
: string(),

test/completion/common.lua

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,7 +3235,7 @@ xx@pcall<??>
32353235
{
32363236
[1] = {
32373237
label = 'pcall',
3238-
kind = define.CompletionItemKind.Event,
3238+
kind = define.CompletionItemKind.Snippet,
32393239
textEdit = {
32403240
start = 3,
32413241
finish = 8,
@@ -3257,7 +3257,7 @@ xx()@pcall<??>
32573257
{
32583258
[1] = {
32593259
label = 'pcall',
3260-
kind = define.CompletionItemKind.Event,
3260+
kind = define.CompletionItemKind.Snippet,
32613261
textEdit = {
32623262
start = 5,
32633263
finish = 10,
@@ -3279,7 +3279,7 @@ xx(1, 2, 3)@pcall<??>
32793279
{
32803280
[1] = {
32813281
label = 'pcall',
3282-
kind = define.CompletionItemKind.Event,
3282+
kind = define.CompletionItemKind.Snippet,
32833283
textEdit = {
32843284
start = 12,
32853285
finish = 17,
@@ -3301,7 +3301,7 @@ xx@xpcall<??>
33013301
{
33023302
[1] = {
33033303
label = 'xpcall',
3304-
kind = define.CompletionItemKind.Event,
3304+
kind = define.CompletionItemKind.Snippet,
33053305
textEdit = {
33063306
start = 3,
33073307
finish = 9,
@@ -3323,7 +3323,7 @@ xx()@xpcall<??>
33233323
{
33243324
[1] = {
33253325
label = 'xpcall',
3326-
kind = define.CompletionItemKind.Event,
3326+
kind = define.CompletionItemKind.Snippet,
33273327
textEdit = {
33283328
start = 5,
33293329
finish = 11,
@@ -3345,7 +3345,7 @@ xx(1, 2, 3)@xpcall<??>
33453345
{
33463346
[1] = {
33473347
label = 'xpcall',
3348-
kind = define.CompletionItemKind.Event,
3348+
kind = define.CompletionItemKind.Snippet,
33493349
textEdit = {
33503350
start = 12,
33513351
finish = 18,
@@ -3367,7 +3367,7 @@ xx@function<??>
33673367
{
33683368
[1] = {
33693369
label = 'function',
3370-
kind = define.CompletionItemKind.Event,
3370+
kind = define.CompletionItemKind.Snippet,
33713371
textEdit = {
33723372
start = 3,
33733373
finish = 11,
@@ -3389,7 +3389,7 @@ xx.yy@method<??>
33893389
{
33903390
[1] = {
33913391
label = 'method',
3392-
kind = define.CompletionItemKind.Event,
3392+
kind = define.CompletionItemKind.Snippet,
33933393
textEdit = {
33943394
start = 6,
33953395
finish = 12,
@@ -3411,7 +3411,7 @@ xx:yy@method<??>
34113411
{
34123412
[1] = {
34133413
label = 'method',
3414-
kind = define.CompletionItemKind.Event,
3414+
kind = define.CompletionItemKind.Snippet,
34153415
textEdit = {
34163416
start = 6,
34173417
finish = 12,
@@ -3433,7 +3433,7 @@ xx@insert<??>
34333433
{
34343434
[1] = {
34353435
label = 'insert',
3436-
kind = define.CompletionItemKind.Event,
3436+
kind = define.CompletionItemKind.Snippet,
34373437
textEdit = {
34383438
start = 3,
34393439
finish = 9,
@@ -3455,7 +3455,7 @@ xx++<??>
34553455
{
34563456
[1] = {
34573457
label = '++',
3458-
kind = define.CompletionItemKind.Event,
3458+
kind = define.CompletionItemKind.Snippet,
34593459
textEdit = {
34603460
start = 2,
34613461
finish = 4,
@@ -3471,7 +3471,7 @@ xx++<??>
34713471
},
34723472
[2] = {
34733473
label = '++?',
3474-
kind = define.CompletionItemKind.Event,
3474+
kind = define.CompletionItemKind.Snippet,
34753475
textEdit = {
34763476
start = 2,
34773477
finish = 4,
@@ -3495,7 +3495,7 @@ end)
34953495
{
34963496
[1] = {
34973497
label = 'xpcall',
3498-
kind = define.CompletionItemKind.Event,
3498+
kind = define.CompletionItemKind.Snippet,
34993499
textEdit = {
35003500
start = 10007,
35013501
finish = 10013,

0 commit comments

Comments
 (0)