|
1 | 1 | # changelog |
2 | 2 |
|
| 3 | +## 3.6.0 |
| 4 | +* `NEW` supports `private`/`protected`/`public`/`package` |
| 5 | + * mark in `doc.field` |
| 6 | + ```lua |
| 7 | + ---@class unit |
| 8 | + ---@field private uuid integer |
| 9 | + ``` |
| 10 | + * mark with `---@private`, `---@protected`, `---@public` and `---@package` |
| 11 | + ```lua |
| 12 | + ---@class unit |
| 13 | + local mt = {} |
| 14 | + |
| 15 | + ---@private |
| 16 | + function mt:init() |
| 17 | + end |
| 18 | + |
| 19 | + ---@protected |
| 20 | + function mt:update() |
| 21 | + end |
| 22 | + ``` |
| 23 | + * mark by settings `Lua.doc.privateName`, `Lua.doc.protectedName` and `Lua.doc.packageName` |
| 24 | + ```lua |
| 25 | + ---@class unit |
| 26 | + ---@field _uuid integer --> treat as private when `Lua.doc.privateName` has `"_*"` |
| 27 | + ``` |
| 28 | +* `NEW` settings: |
| 29 | + * `Lua.misc.executablePath`: [#1557] specify the executable path in VSCode |
| 30 | + * `Lua.diagnostics.workspaceEvent`: [#1626] set the time to trigger workspace diagnostics. |
| 31 | + * `Lua.doc.privateName`: treat matched fields as private |
| 32 | + * `Lua.doc.protectedName`: treat matched fields as protected |
| 33 | + * `Lua.doc.packageName`: treat matched fields as package |
| 34 | +* `NEW` CLI `--doc [path]` to make docs. |
| 35 | +server will generate `doc.json` and `doc.md` in `LOGPATH`. |
| 36 | +`doc.md` is generated by `doc.json` by example code `script/cli/doc2md.lua`. |
| 37 | +* `CHG` [#1558] detect multi libraries |
| 38 | +* `CHG` [#1458] `semantic-tokens`: global variable is setted to `variable.global` |
| 39 | + ```jsonc |
| 40 | + // color global variables to red |
| 41 | + "editor.semanticTokenColorCustomizations": { |
| 42 | + "rules": { |
| 43 | + "variable.global": "#ff0000" |
| 44 | + } |
| 45 | + } |
| 46 | + ``` |
| 47 | +* `CHG` [#1177] re-support for symlinks, users need to maintain the correctness of symlinks themselves |
| 48 | +* `CHG` [#1561] infer definitions and types across chain expression |
| 49 | + ```lua |
| 50 | + ---@class myClass |
| 51 | + local myClass = {} |
| 52 | + |
| 53 | + myClass.a.b.c.e.f.g = 1 |
| 54 | + |
| 55 | + ---@type myClass |
| 56 | + local class |
| 57 | + |
| 58 | + print(class.a.b.c.e.f.g) --> inferred as integer |
| 59 | + ``` |
| 60 | +* `CHG` [#1582] the following diagnostics consider `overload` |
| 61 | + * `missing-return` |
| 62 | + * `missing-return-value` |
| 63 | + * `redundant-return-value` |
| 64 | + * `return-type-mismatch` |
| 65 | +* `CHG` workspace-symbol: supports chain fields based on global variables and types. try `io.open` or `iolib.open` |
| 66 | +* `CHG` [#1641] if a function only has varargs and has `---@overload`, the varargs will be ignored |
| 67 | +* `CHG` [#1575] search definitions by first argument of `setmetatable` |
| 68 | + ```lua |
| 69 | + ---@class Object |
| 70 | + local obj = setmetatable({ |
| 71 | + initValue = 1, |
| 72 | + }, mt) |
| 73 | + |
| 74 | + print(obj.initValue) --> `obj.initValue` is integer |
| 75 | + ``` |
| 76 | +* `CHG` [#1153] infer type by generic parameters or returns of function |
| 77 | + ```lua |
| 78 | + ---@generic T |
| 79 | + ---@param f fun(x: T) |
| 80 | + ---@return T[] |
| 81 | + local function x(f) end |
| 82 | + |
| 83 | + ---@type fun(x: integer) |
| 84 | + local cb |
| 85 | + |
| 86 | + local arr = x(cb) --> `arr` is inferred as `integer[]` |
| 87 | + ``` |
| 88 | +* `CHG` [#1201] infer parameter type by expected returned function of parent function |
| 89 | + ```lua |
| 90 | + ---@return fun(x: integer) |
| 91 | + local function f() |
| 92 | + return function (x) --> `x` is inferred as `integer` |
| 93 | + end |
| 94 | + end |
| 95 | + ``` |
| 96 | +* `CHG` [#1332] infer parameter type when function in table |
| 97 | + ```lua |
| 98 | + ---@class A |
| 99 | + ---@field f fun(x: string) |
| 100 | + |
| 101 | + ---@type A |
| 102 | + local t = { |
| 103 | + f = function (x) end --> `x` is inferred as `string` |
| 104 | + } |
| 105 | + ``` |
| 106 | +* `CHG` find reference: respect `includeDeclaration` (although I don't know how to turn off this option in VSCode) |
| 107 | +* `CHG` [#1344] improve `---@see` |
| 108 | +* `CHG` [#1484] setting `runtime.special` supports fields |
| 109 | + ```jsonc |
| 110 | + { |
| 111 | + "runtime.special": { |
| 112 | + "sandbox.require": "require" |
| 113 | + } |
| 114 | + } |
| 115 | + ``` |
| 116 | +* `CHG` [#1533] supports completion with table field of function |
| 117 | +* `CHG` [#1457] infer parameter type by function type |
| 118 | + ```lua |
| 119 | + ---@type fun(x: number) |
| 120 | + local function f(x) --> `x` is inferred as `number` |
| 121 | + end |
| 122 | + ``` |
| 123 | +* `CHG` [#1663] check parameter types of generic extends |
| 124 | + ```lua |
| 125 | + ---@generic T: string | boolean |
| 126 | + ---@param x T |
| 127 | + ---@return T |
| 128 | + local function f(x) |
| 129 | + return x |
| 130 | + end |
| 131 | + |
| 132 | + local x = f(1) --> Warning: Cannot assign `integer` to parameter `<T:boolean|string>`. |
| 133 | + ``` |
| 134 | +* `CHG` [#1434] type check: check the fields in table: |
| 135 | + ```lua |
| 136 | + ---@type table<string, string> |
| 137 | + local x |
| 138 | + |
| 139 | + ---@type table<string, number> |
| 140 | + local y |
| 141 | + |
| 142 | + x = y --> Warning: Cannot assign `<string, number>` to `<string, string>` |
| 143 | + ``` |
| 144 | +* `CHG` [#1374] type check: supports array part in literal table |
| 145 | + ```lua |
| 146 | + ---@type boolean[] |
| 147 | + local t = { 1, 2, 3 } --> Warning: Cannot assign `integer` to `boolean` |
| 148 | + ``` |
| 149 | +* `CHG` `---@enum` supports runtime values |
| 150 | +* `FIX` [#1479] |
| 151 | +* `FIX` [#1480] |
| 152 | +* `FIX` [#1567] |
| 153 | +* `FIX` [#1593] |
| 154 | +* `FIX` [#1595] |
| 155 | +* `FIX` [#1599] |
| 156 | +* `FIX` [#1606] |
| 157 | +* `FIX` [#1608] |
| 158 | +* `FIX` [#1637] |
| 159 | +* `FIX` [#1640] |
| 160 | +* `FIX` [#1642] |
| 161 | +* `FIX` [#1662] |
| 162 | +* `FIX` [#1672] |
| 163 | + |
| 164 | +[#1153]: https://github.com/sumneko/lua-language-server/issues/1153 |
| 165 | +[#1177]: https://github.com/sumneko/lua-language-server/issues/1177 |
| 166 | +[#1202]: https://github.com/sumneko/lua-language-server/issues/1202 |
| 167 | +[#1332]: https://github.com/sumneko/lua-language-server/issues/1332 |
| 168 | +[#1344]: https://github.com/sumneko/lua-language-server/issues/1344 |
| 169 | +[#1374]: https://github.com/sumneko/lua-language-server/issues/1374 |
| 170 | +[#1434]: https://github.com/sumneko/lua-language-server/issues/1434 |
| 171 | +[#1457]: https://github.com/sumneko/lua-language-server/issues/1457 |
| 172 | +[#1458]: https://github.com/sumneko/lua-language-server/issues/1458 |
| 173 | +[#1479]: https://github.com/sumneko/lua-language-server/issues/1479 |
| 174 | +[#1480]: https://github.com/sumneko/lua-language-server/issues/1480 |
| 175 | +[#1484]: https://github.com/sumneko/lua-language-server/issues/1484 |
| 176 | +[#1533]: https://github.com/sumneko/lua-language-server/issues/1533 |
| 177 | +[#1557]: https://github.com/sumneko/lua-language-server/issues/1557 |
| 178 | +[#1558]: https://github.com/sumneko/lua-language-server/issues/1558 |
| 179 | +[#1561]: https://github.com/sumneko/lua-language-server/issues/1561 |
| 180 | +[#1567]: https://github.com/sumneko/lua-language-server/issues/1567 |
| 181 | +[#1575]: https://github.com/sumneko/lua-language-server/issues/1575 |
| 182 | +[#1582]: https://github.com/sumneko/lua-language-server/issues/1582 |
| 183 | +[#1593]: https://github.com/sumneko/lua-language-server/issues/1593 |
| 184 | +[#1595]: https://github.com/sumneko/lua-language-server/issues/1595 |
| 185 | +[#1599]: https://github.com/sumneko/lua-language-server/issues/1599 |
| 186 | +[#1606]: https://github.com/sumneko/lua-language-server/issues/1606 |
| 187 | +[#1608]: https://github.com/sumneko/lua-language-server/issues/1608 |
| 188 | +[#1626]: https://github.com/sumneko/lua-language-server/issues/1626 |
| 189 | +[#1637]: https://github.com/sumneko/lua-language-server/issues/1637 |
| 190 | +[#1640]: https://github.com/sumneko/lua-language-server/issues/1640 |
| 191 | +[#1641]: https://github.com/sumneko/lua-language-server/issues/1641 |
| 192 | +[#1642]: https://github.com/sumneko/lua-language-server/issues/1642 |
| 193 | +[#1662]: https://github.com/sumneko/lua-language-server/issues/1662 |
| 194 | +[#1663]: https://github.com/sumneko/lua-language-server/issues/1663 |
| 195 | +[#1670]: https://github.com/sumneko/lua-language-server/issues/1670 |
| 196 | +[#1672]: https://github.com/sumneko/lua-language-server/issues/1672 |
| 197 | + |
3 | 198 | ## 3.5.6 |
4 | 199 | `2022-9-16` |
5 | 200 | * `FIX` [#1439](https://github.com/sumneko/lua-language-server/issues/1439) |
|
0 commit comments