-
-
Notifications
You must be signed in to change notification settings - Fork 283
/
changelog.md
1948 lines (1709 loc) · 68.9 KB
/
changelog.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# changelog
## 3.7.1
* `FIX` [#2299]
[#2299]: https://github.com/LuaLS/lua-language-server/issues/2299
## 3.7.0
`2023-8-24`
* `NEW` support `---@type` and `--[[@as]]` for return statement
* `NEW` commandline parameter `--force-accept-workspace`: allowing the use of the root directory or home directory as the workspace
* `NEW` diagnostic: `inject-field`
* `NEW` `---@enum` supports attribute `key`
```lua
---@enum (key) AnimalType
local enum = {
Cat = 1,
Dog = 2,
}
---@param animal userdata
---@param atp AnimalType
---@return boolean
local function isAnimalType(animal, atp)
return API.isAnimalType(animal, enum[atp])
end
assert(isAnimalType(animal, 'Cat'))
```
* `NEW` `---@class` supports attribute `exact`
```lua
---@class (exact) Point
---@field x number
---@field y number
local m = {}
m.x = 1 -- OK
m.y = 2 -- OK
m.z = 3 -- Warning
```
* `FIX` wrong hover and signature for method with varargs and overloads
* `FIX` [#2155]
* `FIX` [#2224]
* `FIX` [#2252]
* `FIX` [#2267]
[#2155]: https://github.com/LuaLS/lua-language-server/issues/2155
[#2224]: https://github.com/LuaLS/lua-language-server/issues/2224
[#2252]: https://github.com/LuaLS/lua-language-server/issues/2252
[#2267]: https://github.com/LuaLS/lua-language-server/issues/2267
## 3.6.25
`2023-7-26`
* `FIX` [#2214]
[#2214]: https://github.com/LuaLS/lua-language-server/issues/2214
## 3.6.24
`2023-7-21`
* `NEW` diagnostic: `missing-fields`
* `FIX` shake of `codeLens`
* `FIX` [#2145]
[#2145]: https://github.com/LuaLS/lua-language-server/issues/2145
## 3.6.23
`2023-7-7`
* `CHG` signature: narrow by inputed literal
## 3.6.22
`2023-6-14`
* `FIX` [#2038]
* `FIX` [#2042]
* `FIX` [#2062]
* `FIX` [#2083]
* `FIX` [#2088]
* `FIX` [#2110]
* `FIX` [#2129]
[#2038]: https://github.com/LuaLS/lua-language-server/issues/2038
[#2042]: https://github.com/LuaLS/lua-language-server/issues/2042
[#2062]: https://github.com/LuaLS/lua-language-server/issues/2062
[#2083]: https://github.com/LuaLS/lua-language-server/issues/2083
[#2088]: https://github.com/LuaLS/lua-language-server/issues/2088
[#2110]: https://github.com/LuaLS/lua-language-server/issues/2110
[#2129]: https://github.com/LuaLS/lua-language-server/issues/2129
## 3.6.21
`2023-5-24`
* `FIX` disable ffi plugin
## 3.6.20
`2023-5-23`
* `NEW` support connecting by socket with `--socket=PORT`
* `FIX` [#2113]
[#2113]: https://github.com/LuaLS/lua-language-server/issues/2113
## 3.6.19
`2023-4-26`
* `FIX` commandline parameter `checklevel` may not work
* `FIX` [#2036]
* `FIX` [#2037]
* `FIX` [#2056]
* `FIX` [#2077]
* `FIX` [#2081]
[#2036]: https://github.com/LuaLS/lua-language-server/issues/2036
[#2037]: https://github.com/LuaLS/lua-language-server/issues/2037
[#2056]: https://github.com/LuaLS/lua-language-server/issues/2056
[#2077]: https://github.com/LuaLS/lua-language-server/issues/2077
[#2081]: https://github.com/LuaLS/lua-language-server/issues/2081
## 3.6.18
`2023-3-23`
* `FIX` [#1943]
* `FIX` [#1996]
* `FIX` [#2004]
* `FIX` [#2013]
[#1943]: https://github.com/LuaLS/lua-language-server/issues/1943
[#1996]: https://github.com/LuaLS/lua-language-server/issues/1996
[#2004]: https://github.com/LuaLS/lua-language-server/issues/2004
[#2013]: https://github.com/LuaLS/lua-language-server/issues/2013
## 3.6.17
`2023-3-9`
* `CHG` export documents: export global variables
* `FIX` [#1715]
* `FIX` [#1753]
* `FIX` [#1914]
* `FIX` [#1922]
* `FIX` [#1924]
* `FIX` [#1928]
* `FIX` [#1945]
* `FIX` [#1955]
* `FIX` [#1978]
[#1715]: https://github.com/LuaLS/lua-language-server/issues/1715
[#1753]: https://github.com/LuaLS/lua-language-server/issues/1753
[#1914]: https://github.com/LuaLS/lua-language-server/issues/1914
[#1922]: https://github.com/LuaLS/lua-language-server/issues/1922
[#1924]: https://github.com/LuaLS/lua-language-server/issues/1924
[#1928]: https://github.com/LuaLS/lua-language-server/issues/1928
[#1945]: https://github.com/LuaLS/lua-language-server/issues/1945
[#1955]: https://github.com/LuaLS/lua-language-server/issues/1955
[#1978]: https://github.com/LuaLS/lua-language-server/issues/1978
## 3.6.13
`2023-3-2`
* `FIX` setting: `Lua.addonManager.enable` should be `true` by default
* `FIX` failed to publish to Windows
## 3.6.12
`2023-3-2`
* `NEW` [Addon Manager](https://github.com/LuaLS/lua-language-server/discussions/1607), try it with command `lua.addon_manager.open`. Thanks to [carsakiller](https://github.com/carsakiller)!
## 3.6.11
`2023-2-13`
* `CHG` completion: don't show loading process
* `FIX` [#1886]
* `FIX` [#1887]
* `FIX` [#1889]
* `FIX` [#1895]
* `FIX` [#1902]
[#1886]: https://github.com/LuaLS/lua-language-server/issues/1886
[#1887]: https://github.com/LuaLS/lua-language-server/issues/1887
[#1889]: https://github.com/LuaLS/lua-language-server/issues/1889
[#1895]: https://github.com/LuaLS/lua-language-server/issues/1895
[#1902]: https://github.com/LuaLS/lua-language-server/issues/1902
## 3.6.10
`2023-2-7`
* `FIX` [#1869]
* `FIX` [#1872]
[#1869]: https://github.com/LuaLS/lua-language-server/issues/1869
[#1872]: https://github.com/LuaLS/lua-language-server/issues/1872
## 3.6.9
`2023-2-2`
* `FIX` [#1864]
* `FIX` [#1868]
* `FIX` [#1869]
* `FIX` [#1871]
[#1864]: https://github.com/LuaLS/lua-language-server/issues/1864
[#1868]: https://github.com/LuaLS/lua-language-server/issues/1868
[#1869]: https://github.com/LuaLS/lua-language-server/issues/1869
[#1871]: https://github.com/LuaLS/lua-language-server/issues/1871
## 3.6.8
`2023-1-31`
* `NEW` command `lua.exportDocument` . VSCode will display this command in the right-click menu
* `CHG` setting `Lua.workspace.supportScheme` has been removed. All schemes are supported if the language id is `lua`
* `FIX` [#1831]
* `FIX` [#1838]
* `FIX` [#1841]
* `FIX` [#1851]
* `FIX` [#1855]
* `FIX` [#1857]
[#1831]: https://github.com/LuaLS/lua-language-server/issues/1831
[#1838]: https://github.com/LuaLS/lua-language-server/issues/1838
[#1841]: https://github.com/LuaLS/lua-language-server/issues/1841
[#1851]: https://github.com/LuaLS/lua-language-server/issues/1851
[#1855]: https://github.com/LuaLS/lua-language-server/issues/1855
[#1857]: https://github.com/LuaLS/lua-language-server/issues/1857
## 3.6.7
`2023-1-20`
* `FIX` [#1810]
* `FIX` [#1829]
[#1810]: https://github.com/LuaLS/lua-language-server/issues/1810
[#1829]: https://github.com/LuaLS/lua-language-server/issues/1829
## 3.6.6
`2023-1-17`
* `FIX` [#1825]
* `FIX` [#1826]
[#1825]: https://github.com/LuaLS/lua-language-server/issues/1825
[#1826]: https://github.com/LuaLS/lua-language-server/issues/1826
## 3.6.5
`2023-1-16`
* `NEW` support casting global variables
* `NEW` code lens: this feature is disabled by default.
* `NEW` settings:
* `Lua.codeLens.enable`: Enable code lens.
* `CHG` improve memory usage for large libraries
* `CHG` definition: supports finding definitions for `@class` and `@alias`, since they may be defined multi times
* `CHG` rename: supports `@field`
* `CHG` improve patch for `.luarc.json`
* `CHG` `---@meta [name]`: once declared `name`, user can only require this file by declared name. meta file can not be required with name `_`
* `CHG` remove telemetry
* `FIX` [#831]
* `FIX` [#1729]
* `FIX` [#1737]
* `FIX` [#1751]
* `FIX` [#1767]
* `FIX` [#1796]
* `FIX` [#1805]
* `FIX` [#1808]
* `FIX` [#1811]
* `FIX` [#1824]
[#831]: https://github.com/LuaLS/lua-language-server/issues/831
[#1729]: https://github.com/LuaLS/lua-language-server/issues/1729
[#1737]: https://github.com/LuaLS/lua-language-server/issues/1737
[#1751]: https://github.com/LuaLS/lua-language-server/issues/1751
[#1767]: https://github.com/LuaLS/lua-language-server/issues/1767
[#1796]: https://github.com/LuaLS/lua-language-server/issues/1796
[#1805]: https://github.com/LuaLS/lua-language-server/issues/1805
[#1808]: https://github.com/LuaLS/lua-language-server/issues/1808
[#1811]: https://github.com/LuaLS/lua-language-server/issues/1811
[#1824]: https://github.com/LuaLS/lua-language-server/issues/1824
## 3.6.4
`2022-11-29`
* `NEW` modify `require` after renaming files
* `FIX` circulation reference in process analysis
```lua
---@type number
local x
---@type number
local y
x = y
y = x --> Can not infer `y` before
```
* `FIX` [#1698]
* `FIX` [#1704]
* `FIX` [#1717]
[#1698]: https://github.com/LuaLS/lua-language-server/issues/1698
[#1704]: https://github.com/LuaLS/lua-language-server/issues/1704
[#1717]: https://github.com/LuaLS/lua-language-server/issues/1717
## 3.6.3
`2022-11-14`
* `FIX` [#1684]
* `FIX` [#1692]
[#1684]: https://github.com/LuaLS/lua-language-server/issues/1684
[#1692]: https://github.com/LuaLS/lua-language-server/issues/1692
## 3.6.2
`2022-11-10`
* `FIX` incorrect type check for generic with nil
* `FIX` [#1676]
* `FIX` [#1677]
* `FIX` [#1679]
* `FIX` [#1680]
[#1676]: https://github.com/LuaLS/lua-language-server/issues/1676
[#1677]: https://github.com/LuaLS/lua-language-server/issues/1677
[#1679]: https://github.com/LuaLS/lua-language-server/issues/1679
[#1680]: https://github.com/LuaLS/lua-language-server/issues/1680
## 3.6.1
`2022-11-8`
* `FIX` wrong diagnostics for `pcall` and `xpcall`
* `FIX` duplicate fields in table hover
* `FIX` description disapeared for overloaded function
* `FIX` [#1675]
[#1675]: https://github.com/LuaLS/lua-language-server/issues/1675
## 3.6.0
`2022-11-8`
* `NEW` supports `private`/`protected`/`public`/`package`
* mark in `doc.field`
```lua
---@class unit
---@field private uuid integer
```
* mark with `---@private`, `---@protected`, `---@public` and `---@package`
```lua
---@class unit
local mt = {}
---@private
function mt:init()
end
---@protected
function mt:update()
end
```
* mark by settings `Lua.doc.privateName`, `Lua.doc.protectedName` and `Lua.doc.packageName`
```lua
---@class unit
---@field _uuid integer --> treat as private when `Lua.doc.privateName` has `"_*"`
```
* `NEW` settings:
* `Lua.misc.executablePath`: [#1557] specify the executable path in VSCode
* `Lua.diagnostics.workspaceEvent`: [#1626] set the time to trigger workspace diagnostics.
* `Lua.doc.privateName`: treat matched fields as private
* `Lua.doc.protectedName`: treat matched fields as protected
* `Lua.doc.packageName`: treat matched fields as package
* `NEW` CLI `--doc [path]` to make docs.
server will generate `doc.json` and `doc.md` in `LOGPATH`.
`doc.md` is generated by `doc.json` by example code `script/cli/doc2md.lua`.
* `CHG` [#1558] detect multi libraries
* `CHG` [#1458] `semantic-tokens`: global variable is setted to `variable.global`
```jsonc
// color global variables to red
"editor.semanticTokenColorCustomizations": {
"rules": {
"variable.global": "#ff0000"
}
}
```
* `CHG` [#1177] re-support for symlinks, users need to maintain the correctness of symlinks themselves
* `CHG` [#1561] infer definitions and types across chain expression
```lua
---@class myClass
local myClass = {}
myClass.a.b.c.e.f.g = 1
---@type myClass
local class
print(class.a.b.c.e.f.g) --> inferred as integer
```
* `CHG` [#1582] the following diagnostics consider `overload`
* `missing-return`
* `missing-return-value`
* `redundant-return-value`
* `return-type-mismatch`
* `CHG` workspace-symbol: supports chain fields based on global variables and types. try `io.open` or `iolib.open`
* `CHG` [#1641] if a function only has varargs and has `---@overload`, the varargs will be ignored
* `CHG` [#1575] search definitions by first argument of `setmetatable`
```lua
---@class Object
local obj = setmetatable({
initValue = 1,
}, mt)
print(obj.initValue) --> `obj.initValue` is integer
```
* `CHG` [#1153] infer type by generic parameters or returns of function
```lua
---@generic T
---@param f fun(x: T)
---@return T[]
local function x(f) end
---@type fun(x: integer)
local cb
local arr = x(cb) --> `arr` is inferred as `integer[]`
```
* `CHG` [#1201] infer parameter type by expected returned function of parent function
```lua
---@return fun(x: integer)
local function f()
return function (x) --> `x` is inferred as `integer`
end
end
```
* `CHG` [#1332] infer parameter type when function in table
```lua
---@class A
---@field f fun(x: string)
---@type A
local t = {
f = function (x) end --> `x` is inferred as `string`
}
```
* `CHG` find reference: respect `includeDeclaration` (although I don't know how to turn off this option in VSCode)
* `CHG` [#1344] improve `---@see`
* `CHG` [#1484] setting `runtime.special` supports fields
```jsonc
{
"runtime.special": {
"sandbox.require": "require"
}
}
```
* `CHG` [#1533] supports completion with table field of function
* `CHG` [#1457] infer parameter type by function type
```lua
---@type fun(x: number)
local function f(x) --> `x` is inferred as `number`
end
```
* `CHG` [#1663] check parameter types of generic extends
```lua
---@generic T: string | boolean
---@param x T
---@return T
local function f(x)
return x
end
local x = f(1) --> Warning: Cannot assign `integer` to parameter `<T:boolean|string>`.
```
* `CHG` [#1434] type check: check the fields in table:
```lua
---@type table<string, string>
local x
---@type table<string, number>
local y
x = y --> Warning: Cannot assign `<string, number>` to `<string, string>`
```
* `CHG` [#1374] type check: supports array part in literal table
```lua
---@type boolean[]
local t = { 1, 2, 3 } --> Warning: Cannot assign `integer` to `boolean`
```
* `CHG` `---@enum` supports runtime values
* `FIX` [#1479]
* `FIX` [#1480]
* `FIX` [#1567]
* `FIX` [#1593]
* `FIX` [#1595]
* `FIX` [#1599]
* `FIX` [#1606]
* `FIX` [#1608]
* `FIX` [#1637]
* `FIX` [#1640]
* `FIX` [#1642]
* `FIX` [#1662]
* `FIX` [#1672]
[#1153]: https://github.com/LuaLS/lua-language-server/issues/1153
[#1177]: https://github.com/LuaLS/lua-language-server/issues/1177
[#1201]: https://github.com/LuaLS/lua-language-server/issues/1201
[#1202]: https://github.com/LuaLS/lua-language-server/issues/1202
[#1332]: https://github.com/LuaLS/lua-language-server/issues/1332
[#1344]: https://github.com/LuaLS/lua-language-server/issues/1344
[#1374]: https://github.com/LuaLS/lua-language-server/issues/1374
[#1434]: https://github.com/LuaLS/lua-language-server/issues/1434
[#1457]: https://github.com/LuaLS/lua-language-server/issues/1457
[#1458]: https://github.com/LuaLS/lua-language-server/issues/1458
[#1479]: https://github.com/LuaLS/lua-language-server/issues/1479
[#1480]: https://github.com/LuaLS/lua-language-server/issues/1480
[#1484]: https://github.com/LuaLS/lua-language-server/issues/1484
[#1533]: https://github.com/LuaLS/lua-language-server/issues/1533
[#1557]: https://github.com/LuaLS/lua-language-server/issues/1557
[#1558]: https://github.com/LuaLS/lua-language-server/issues/1558
[#1561]: https://github.com/LuaLS/lua-language-server/issues/1561
[#1567]: https://github.com/LuaLS/lua-language-server/issues/1567
[#1575]: https://github.com/LuaLS/lua-language-server/issues/1575
[#1582]: https://github.com/LuaLS/lua-language-server/issues/1582
[#1593]: https://github.com/LuaLS/lua-language-server/issues/1593
[#1595]: https://github.com/LuaLS/lua-language-server/issues/1595
[#1599]: https://github.com/LuaLS/lua-language-server/issues/1599
[#1606]: https://github.com/LuaLS/lua-language-server/issues/1606
[#1608]: https://github.com/LuaLS/lua-language-server/issues/1608
[#1626]: https://github.com/LuaLS/lua-language-server/issues/1626
[#1637]: https://github.com/LuaLS/lua-language-server/issues/1637
[#1640]: https://github.com/LuaLS/lua-language-server/issues/1640
[#1641]: https://github.com/LuaLS/lua-language-server/issues/1641
[#1642]: https://github.com/LuaLS/lua-language-server/issues/1642
[#1662]: https://github.com/LuaLS/lua-language-server/issues/1662
[#1663]: https://github.com/LuaLS/lua-language-server/issues/1663
[#1670]: https://github.com/LuaLS/lua-language-server/issues/1670
[#1672]: https://github.com/LuaLS/lua-language-server/issues/1672
## 3.5.6
`2022-9-16`
* `FIX` [#1439](https://github.com/LuaLS/lua-language-server/issues/1439)
* `FIX` [#1467](https://github.com/LuaLS/lua-language-server/issues/1467)
* `FIX` [#1506](https://github.com/LuaLS/lua-language-server/issues/1506)
* `FIX` [#1537](https://github.com/LuaLS/lua-language-server/issues/1537)
## 3.5.5
`2022-9-7`
* `FIX` [#1529](https://github.com/LuaLS/lua-language-server/issues/1529)
* `FIX` [#1530](https://github.com/LuaLS/lua-language-server/issues/1530)
## 3.5.4
`2022-9-6`
* `NEW` `type-formatting`: fix wrong indentation of VSCode
* `CHG` `document-symbol`: redesigned to better support for `Sticky Scroll` feature of VSCode
* `FIX` `diagnostics.workspaceDelay` can not prevent first workspace diagnostic
* `FIX` [#1476](https://github.com/LuaLS/lua-language-server/issues/1476)
* `FIX` [#1490](https://github.com/LuaLS/lua-language-server/issues/1490)
* `FIX` [#1493](https://github.com/LuaLS/lua-language-server/issues/1493)
* `FIX` [#1499](https://github.com/LuaLS/lua-language-server/issues/1499)
* `FIX` [#1526](https://github.com/LuaLS/lua-language-server/issues/1526)
## 3.5.3
`2022-8-13`
* `FIX` [#1409](https://github.com/LuaLS/lua-language-server/issues/1409)
* `FIX` [#1422](https://github.com/LuaLS/lua-language-server/issues/1422)
* `FIX` [#1425](https://github.com/LuaLS/lua-language-server/issues/1425)
* `FIX` [#1428](https://github.com/LuaLS/lua-language-server/issues/1428)
* `FIX` [#1430](https://github.com/LuaLS/lua-language-server/issues/1430)
* `FIX` [#1431](https://github.com/LuaLS/lua-language-server/issues/1431)
* `FIX` [#1446](https://github.com/LuaLS/lua-language-server/issues/1446)
* `FIX` [#1451](https://github.com/LuaLS/lua-language-server/issues/1451)
* `FIX` [#1461](https://github.com/LuaLS/lua-language-server/issues/1461)
* `FIX` [#1463](https://github.com/LuaLS/lua-language-server/issues/1463)
## 3.5.2
`2022-8-1`
* `FIX` [#1395](https://github.com/LuaLS/lua-language-server/issues/1395)
* `FIX` [#1403](https://github.com/LuaLS/lua-language-server/issues/1403)
* `FIX` [#1405](https://github.com/LuaLS/lua-language-server/issues/1405)
* `FIX` [#1406](https://github.com/LuaLS/lua-language-server/issues/1406)
* `FIX` [#1418](https://github.com/LuaLS/lua-language-server/issues/1418)
## 3.5.1
`2022-7-26`
* `NEW` supports [color](https://github.com/LuaLS/lua-language-server/pull/1379)
* `NEW` setting `Lua.runtime.pluginArgs`
* `CHG` setting `type.castNumberToInteger` default by `true`
* `CHG` improve supports for multi-workspace
* `FIX` [#1354](https://github.com/LuaLS/lua-language-server/issues/1354)
* `FIX` [#1355](https://github.com/LuaLS/lua-language-server/issues/1355)
* `FIX` [#1363](https://github.com/LuaLS/lua-language-server/issues/1363)
* `FIX` [#1365](https://github.com/LuaLS/lua-language-server/issues/1365)
* `FIX` [#1367](https://github.com/LuaLS/lua-language-server/issues/1367)
* `FIX` [#1368](https://github.com/LuaLS/lua-language-server/issues/1368)
* `FIX` [#1370](https://github.com/LuaLS/lua-language-server/issues/1370)
* `FIX` [#1375](https://github.com/LuaLS/lua-language-server/issues/1375)
* `FIX` [#1391](https://github.com/LuaLS/lua-language-server/issues/1391)
## 3.5.0
`2022-7-19`
* `NEW` `LuaDoc`: `---@operator`:
```lua
---@class fspath
---@operator div(string|fspath): fspath
---@type fspath
local root
local fileName = root / 'script' / 'main.lua' -- `fileName` is `fspath` here
```
* `NEW` `LuaDoc`: `---@source`:
```lua
-- Also supports absolute path or relative path (based on current file path)
---@source file:///xxx.c:50:20
XXX = 1 -- when finding definitions of `XXX`, returns `file:///xxx.c:50:20` instead here.
```
* `NEW` `LuaDoc`: `---@enum`:
```lua
---@enum animal
Animal = {
Cat = 1,
Dog = 2,
}
---@param x animal
local function f(x) end
f() -- suggests `Animal.Cat`, `Animal.Dog`, `1`, `2` as the first parameter
```
* `NEW` diagnostics:
* `unknown-operator`
* `unreachable-code`
* `NEW` settings:
* `diagnostics.unusedLocalExclude`
* `NEW` VSCode: add support for [EmmyLuaUnity](https://marketplace.visualstudio.com/items?itemName=CppCXY.emmylua-unity)
* `CHG` support multi-type:
```lua
---@type number, _, boolean
local a, b, c -- `a` is `number`, `b` is `unknown`, `c` is `boolean`
```
* `CHG` treat `_ENV = XXX` as `local _ENV = XXX`
* `_ENV = nil`: disable all globals
* `_ENV = {}`: allow all globals
* `_ENV = {} ---@type mathlib`: only allow globals in `mathlib`
* `CHG` hover: dose not show unknown `---@XXX` as description
* `CHG` contravariance is allowed at the class declaration
```lua
---@class BaseClass
local BaseClass
---@class MyClass: BaseClass
local MyClass = BaseClass -- OK!
```
* `CHG` hover: supports path in link
```lua
--![](image.png) --> will convert to `--![](file:///xxxx/image.png)`
local x
```
* `CHG` signature: only show signatures matching the entered parameters
* `FIX` [#880](https://github.com/LuaLS/lua-language-server/issues/880)
* `FIX` [#1284](https://github.com/LuaLS/lua-language-server/issues/1284)
* `FIX` [#1292](https://github.com/LuaLS/lua-language-server/issues/1292)
* `FIX` [#1294](https://github.com/LuaLS/lua-language-server/issues/1294)
* `FIX` [#1306](https://github.com/LuaLS/lua-language-server/issues/1306)
* `FIX` [#1311](https://github.com/LuaLS/lua-language-server/issues/1311)
* `FIX` [#1317](https://github.com/LuaLS/lua-language-server/issues/1317)
* `FIX` [#1320](https://github.com/LuaLS/lua-language-server/issues/1320)
* `FIX` [#1330](https://github.com/LuaLS/lua-language-server/issues/1330)
* `FIX` [#1345](https://github.com/LuaLS/lua-language-server/issues/1345)
* `FIX` [#1346](https://github.com/LuaLS/lua-language-server/issues/1346)
* `FIX` [#1348](https://github.com/LuaLS/lua-language-server/issues/1348)
## 3.4.2
`2022-7-6`
* `CHG` diagnostic: `type-check` ignores `nil` in `getfield`
* `CHG` diagnostic: `---@diagnostic disable: <ERR_NAME>` can suppress syntax errors
* `CHG` completion: `completion.callSnippet` no longer generate parameter types
* `CHG` hover: show `---@type {x: number, y: number}` as detail instead of `table`
* `CHG` dose not infer as `nil` by `t.field = nil`
* `FIX` [#1278](https://github.com/LuaLS/lua-language-server/issues/1278)
* `FIX` [#1288](https://github.com/LuaLS/lua-language-server/issues/1288)
## 3.4.1
`2022-7-5`
* `NEW` settings:
* `type.weakNilCheck`
* `CHG` allow type contravariance for `setmetatable` when initializing a class
```lua
---@class A
local a = {}
---@class B: A
local b = setmetatable({}, { __index = a }) -- OK!
```
* `FIX` [#1256](https://github.com/LuaLS/lua-language-server/issues/1256)
* `FIX` [#1257](https://github.com/LuaLS/lua-language-server/issues/1257)
* `FIX` [#1267](https://github.com/LuaLS/lua-language-server/issues/1267)
* `FIX` [#1269](https://github.com/LuaLS/lua-language-server/issues/1269)
* `FIX` [#1273](https://github.com/LuaLS/lua-language-server/issues/1273)
* `FIX` [#1275](https://github.com/LuaLS/lua-language-server/issues/1275)
* `FIX` [#1279](https://github.com/LuaLS/lua-language-server/issues/1279)
## 3.4.0
`2022-6-29`
* `NEW` diagnostics:
* `cast-local-type`
* `assign-type-mismatch`
* `param-type-mismatch`
* `unknown-cast-variable`
* `cast-type-mismatch`
* `missing-return-value`
* `redundant-return-value`
* `missing-return`
* `return-type-mismatch`
* `NEW` settings:
* `diagnostics.groupSeverity`
* `diagnostics.groupFileStatus`
* `type.castNumberToInteger`
* `type.weakUnionCheck`
* `hint.semicolon`
* `CHG` infer `nil` as redundant return value
```lua
local function f() end
local x = f() -- `x` is `nil` instead of `unknown`
```
* `CHG` infer called function by params num
```lua
---@overload fun(x: number, y: number):string
---@overload fun(x: number):number
---@return boolean
local function f() end
local n1 = f() -- `n1` is `boolean`
local n2 = f(0) -- `n2` is `number`
local n3 = f(0, 0) -- `n3` is `string`
```
* `CHG` semicolons and parentheses can be used in `DocTable`
```lua
---@type { (x: number); (y: boolean) }
```
* `CHG` return names and parentheses can be used in `DocFunction`
```lua
---@type fun():(x: number, y: number, ...: number)
```
* `CHG` supports `---@return boolean ...`
* `CHG` improve experience for diagnostics and semantic-tokens
* `FIX` diagnostics flash when opening a file
* `FIX` sometimes workspace diagnostics are not triggered
* `FIX` [#1228](https://github.com/LuaLS/lua-language-server/issues/1228)
* `FIX` [#1229](https://github.com/LuaLS/lua-language-server/issues/1229)
* `FIX` [#1242](https://github.com/LuaLS/lua-language-server/issues/1242)
* `FIX` [#1243](https://github.com/LuaLS/lua-language-server/issues/1243)
* `FIX` [#1249](https://github.com/LuaLS/lua-language-server/issues/1249)
## 3.3.1
`2022-6-17`
* `FIX` [#1213](https://github.com/LuaLS/lua-language-server/issues/1213)
* `FIX` [#1215](https://github.com/LuaLS/lua-language-server/issues/1215)
* `FIX` [#1217](https://github.com/LuaLS/lua-language-server/issues/1217)
* `FIX` [#1218](https://github.com/LuaLS/lua-language-server/issues/1218)
* `FIX` [#1220](https://github.com/LuaLS/lua-language-server/issues/1220)
* `FIX` [#1223](https://github.com/LuaLS/lua-language-server/issues/1223)
## 3.3.0
`2022-6-15`
* `NEW` `LuaDoc` supports `` `CODE` ``
```lua
---@type `CONST.X` | `CONST.Y`
local x
if x == -- suggest `CONST.X` and `CONST.Y` here
```
* `CHG` infer type by `error`
```lua
---@type integer|nil
local n
if not n then
error('n is nil')
end
print(n) -- `n` is `integer` here
```
* `CHG` infer type by `t and t.x`
```lua
---@type table|nil
local t
local s = t and t.x or 1 -- `t` in `t.x` is `table`
```
* `CHG` infer type by `type(x)`
```lua
local x
if type(x) == 'string' then
print(x) -- `x` is `string` here
end
local tp = type(x)
if tp == 'boolean' then
print(x) -- `x` is `boolean` here
end
```
* `CHG` infer type by `>`/`<`/`>=`/`<=`
* `FIX` with clients that support LSP 3.17 (VSCode), workspace diagnostics are triggered every time when opening a file.
* `FIX` [#1204](https://github.com/LuaLS/lua-language-server/issues/1204)
* `FIX` [#1208](https://github.com/LuaLS/lua-language-server/issues/1208)
## 3.2.5
`2022-6-9`
* `NEW` provide config docs in `LUA_LANGUAGE_SERVER/doc/`
* `FIX` [#1148](https://github.com/LuaLS/lua-language-server/issues/1148)
* `FIX` [#1149](https://github.com/LuaLS/lua-language-server/issues/1149)
* `FIX` [#1192](https://github.com/LuaLS/lua-language-server/issues/1192)
## 3.2.4
`2022-5-25`
* `NEW` settings:
+ `workspace.supportScheme`: `["file", "untitled", "git"]`
+ `diagnostics.disableScheme`: `["git"]`
* `NEW` folding: support folding `---@alias`
* `CHG` if `rootUri` or `workspaceFolder` is set to `ROOT` or `HOME`, this extension will refuse to load these directories and show an error message.
* `CHG` show warning message when scanning more than 100,000 files.
* `CHG` upgrade [LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) to `3.17`
* `FIX` hover: can not union `table` with other basic types
* `FIX` [#1125](https://github.com/LuaLS/lua-language-server/issues/1125)
* `FIX` [#1131](https://github.com/LuaLS/lua-language-server/issues/1131)
* `FIX` [#1134](https://github.com/LuaLS/lua-language-server/issues/1134)
* `FIX` [#1141](https://github.com/LuaLS/lua-language-server/issues/1141)
* `FIX` [#1144](https://github.com/LuaLS/lua-language-server/issues/1144)
* `FIX` [#1150](https://github.com/LuaLS/lua-language-server/issues/1150)
* `FIX` [#1155](https://github.com/LuaLS/lua-language-server/issues/1155)
## 3.2.3
`2022-5-16`
* `CHG` parse `.luarc.json` as jsonc. In order to please the editor, it also supports `.luarc.jsonc` as the file name.
* `CHG` dose not load files in symbol links
* `FIX` memory leak with symbol links
* `FIX` diagnostic: send empty results to every file after startup
* `FIX` [#1103](https://github.com/LuaLS/lua-language-server/issues/1103)
* `FIX` [#1107](https://github.com/LuaLS/lua-language-server/issues/1107)
## 3.2.2
`2022-4-26`
* `FIX` diagnostic: `unused-function` cannot handle recursion correctly
* `FIX` [#1092](https://github.com/LuaLS/lua-language-server/issues/1092)
* `FIX` [#1093](https://github.com/LuaLS/lua-language-server/issues/1093)
* `FIX` runtime errors reported by telemetry, see [#1091](https://github.com/LuaLS/lua-language-server/issues/1091)
## 3.2.1
`2022-4-25`
* `FIX` broken in VSCode
## 3.2.0
`2022-4-25`
* `NEW` supports infer of callback parameter
```lua
---@type string[]
local t
table.sort(t, function (a, b)
-- `a` and `b` is `string` here
end)
```
* `NEW` using `---@overload` as class constructor
```lua
---@class Class
---@overload fun():Class
local mt
local x = mt() --> x is `Class` here
```
* `NEW` add `--[[@as type]]`
```lua
local x = true
local y = x--[[@as integer]] -- y is `integer` here
```
* `NEW` add `---@cast`
* `---@cast localname type`
* `---@cast localname +type`
* `---@cast localname -type`
* `---@cast localname +?`
* `---@cast localname -?`
* `NEW` generic: resolve `T[]` by `table<integer, type>` or `---@field [integer] type`
* `NEW` resolve `class[1]` by `---@field [integer] type`
* `NEW` diagnostic: `missing-parameter`
* `NEW` diagnostic: `need-check-nil`
* `CHG` diagnostic: no longer mark `redundant-parameter` as `Unnecessary`
* `FIX` diagnostic: `unused-function` does not recognize recursion
* `FIX` [#1051](https://github.com/LuaLS/lua-language-server/issues/1051)
* `FIX` [#1072](https://github.com/LuaLS/lua-language-server/issues/1072)
* `FIX` [#1077](https://github.com/LuaLS/lua-language-server/issues/1077)
* `FIX` [#1088](https://github.com/LuaLS/lua-language-server/issues/1088)
* `FIX` runtime errors
## 3.1.0
`2022-4-17`
* `NEW` support find definition in method
* `CHG` hint: move to LSP. Its font is now controlled by the client.
* `CHG` hover: split `local` into `local` / `parameter` / `upvalue` / `self`.
* `CHG` hover: added parentheses to some words, such as `global` / `field` / `class`.
* `FIX` definition of `table<k, v>`
* `FIX` [#994](https://github.com/LuaLS/lua-language-server/issues/994)
* `FIX` [#1057](https://github.com/LuaLS/lua-language-server/issues/1057)
* `FIX` runtime errors reported by telemetry, see [#1058](https://github.com/LuaLS/lua-language-server/issues/1058)
## 3.0.2
`2022-4-15`
* `FIX` `table<string, boolean>[string] -> boolean`
* `FIX` goto `type definition`
* `FIX` [#1050](https://github.com/LuaLS/lua-language-server/issues/1050)
## 3.0.1
`2022-4-11`
* `FIX` [#1033](https://github.com/LuaLS/lua-language-server/issues/1033)
* `FIX` [#1034](https://github.com/LuaLS/lua-language-server/issues/1034)
* `FIX` [#1035](https://github.com/LuaLS/lua-language-server/issues/1035)
* `FIX` [#1036](https://github.com/LuaLS/lua-language-server/issues/1036)
* `FIX` runtime errors reported by telemetry, see [#1037](https://github.com/LuaLS/lua-language-server/issues/1037)
## 3.0.0
`2022-4-10`
* `CHG` [break changes](https://github.com/LuaLS/lua-language-server/issues/980)
* `CHG` diagnostic:
+ `type-check`: removed for now
+ `no-implicit-any`: renamed to `no-unknown`
* `CHG` formatter: no longer need` --preview`
* `CHG` `LuaDoc`: supports `---@type (string|integer)[]`
* `FIX` semantic: color of `function`
* `FIX` [#1027](https://github.com/LuaLS/lua-language-server/issues/1027)
* `FIX` [#1028](https://github.com/LuaLS/lua-language-server/issues/1028)
## 2.6.8
`2022-4-9`
* `CHG` completion: call snippet shown as `Function` instead of `Snippet` when `Lua.completion.callSnippet` is `Replace`
* `FIX` [#976](https://github.com/LuaLS/lua-language-server/issues/976)
* `FIX` [#995](https://github.com/LuaLS/lua-language-server/issues/995)
* `FIX` [#1004](https://github.com/LuaLS/lua-language-server/issues/1004)
* `FIX` [#1008](https://github.com/LuaLS/lua-language-server/issues/1008)
* `FIX` [#1009](https://github.com/LuaLS/lua-language-server/issues/1009)
* `FIX` [#1011](https://github.com/LuaLS/lua-language-server/issues/1011)
* `FIX` [#1014](https://github.com/LuaLS/lua-language-server/issues/1014)
* `FIX` [#1016](https://github.com/LuaLS/lua-language-server/issues/1016)
* `FIX` [#1017](https://github.com/LuaLS/lua-language-server/issues/1017)
* `FIX` runtime errors reported by telemetry
## 2.6.7
`2022-3-9`
* `NEW` diagnosis report, [read more](https://luals.github.io/wiki/diagnosis-report/)
* `CHG` `VSCode`: 1.65 has built in new `Lua` syntax files, so this extension no longer provides syntax files, which means you can install other syntax extensions in the marketplace. If you have any suggestions or issues, please [open issues here](https://github.com/LuaLS/lua.tmbundle).
* `CHG` telemetry: the prompt will only appear in VSCode to avoid repeated prompts in other platforms due to the inability to automatically modify the settings.
* `FIX` [#965](https://github.com/LuaLS/lua-language-server/issues/965)
* `FIX` [#975](https://github.com/LuaLS/lua-language-server/issues/975)
## 2.6.6
`2022-2-21`
* `NEW` formatter preview, use `--preview` to enable this feature, [read more](https://github.com/LuaLS/lua-language-server/issues/960)
* `FIX` [#958](https://github.com/LuaLS/lua-language-server/issues/958)
* `FIX` runtime errors
## 2.6.5
`2022-2-17`
* `FIX` telemetry is not disabled by default (since 2.6.0)
* `FIX` [#934](https://github.com/LuaLS/lua-language-server/issues/934)
* `FIX` [#952](https://github.com/LuaLS/lua-language-server/issues/952)
## 2.6.4
`2022-2-9`
* `CHG` completion: reduced sorting priority for postfix completion
* `FIX` [#936](https://github.com/LuaLS/lua-language-server/issues/936)
* `FIX` [#937](https://github.com/LuaLS/lua-language-server/issues/937)
* `FIX` [#940](https://github.com/LuaLS/lua-language-server/issues/940)
* `FIX` [#941](https://github.com/LuaLS/lua-language-server/issues/941)
* `FIX` [#941](https://github.com/LuaLS/lua-language-server/issues/942)
* `FIX` [#943](https://github.com/LuaLS/lua-language-server/issues/943)
* `FIX` [#946](https://github.com/LuaLS/lua-language-server/issues/946)
## 2.6.3
`2022-1-25`
* `FIX` new files are not loaded correctly
* `FIX` [#923](https://github.com/LuaLS/lua-language-server/issues/923)
* `FIX` [#926](https://github.com/LuaLS/lua-language-server/issues/926)
## 2.6.2
`2022-1-25`
* `FIX` [#925](https://github.com/LuaLS/lua-language-server/issues/925)
## 2.6.1
`2022-1-24`
* `CHG` default values of settings:
+ `Lua.diagnostics.workspaceDelay`: `0` sec -> `3` sec
+ `Lua.workspace.maxPreload`: `1000` -> `5000`
+ `Lua.workspace.preloadFileSize`: `100` KB -> `500` KB
* `CHG` improve performance
* `FIX` modify luarc failed
* `FIX` library files not recognized correctly
* `FIX` [#903](https://github.com/LuaLS/lua-language-server/issues/903)
* `FIX` [#906](https://github.com/LuaLS/lua-language-server/issues/906)
* `FIX` [#920](https://github.com/LuaLS/lua-language-server/issues/920)
## 2.6.0
`2022-1-13`
* `NEW` supports multi-workspace in server side, for developers of language clients, please [read here](https://luals.github.io/wiki/developing/#multiple-workspace-support) to learn more.
* `NEW` setting:
+ `Lua.hint.arrayIndex`
+ `Lua.semantic.enable`
+ `Lua.semantic.variable`
+ `Lua.semantic.annotation`
+ `Lua.semantic.keyword`
* `CHG` completion: improve response speed
* `CHG` completion: can be triggered in `LuaDoc` and strings
* `CHG` diagnostic: smoother
* `CHG` settings `Lua.color.mode` removed
* `FIX` [#876](https://github.com/LuaLS/lua-language-server/issues/876)
* `FIX` [#879](https://github.com/LuaLS/lua-language-server/issues/879)
* `FIX` [#884](https://github.com/LuaLS/lua-language-server/issues/884)
* `FIX` [#885](https://github.com/LuaLS/lua-language-server/issues/885)
* `FIX` [#886](https://github.com/LuaLS/lua-language-server/issues/886)
* `FIX` [#902](https://github.com/LuaLS/lua-language-server/issues/902)
## 2.5.6
`2021-12-27`
* `CHG` diagnostic: now syntax errors in `LuaDoc` are shown as `Warning`
* `FIX` [#863](https://github.com/LuaLS/lua-language-server/issues/863)
* `FIX` return type of `math.floor`
* `FIX` runtime errors