Skip to content

Commit 9b26e22

Browse files
authored
Merge branch 'master' into luaReg
2 parents e1c06d0 + 33ba775 commit 9b26e22

File tree

7 files changed

+23
-7
lines changed

7 files changed

+23
-7
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
- { os: ubuntu-22.04, target: linux, platform: linux-x64, container: 'alpine:latest', libc: musl }
2828
- { os: ubuntu-20.04, target: linux, platform: linux-x64 }
2929
- { os: ubuntu-20.04, target: linux, platform: linux-arm64 }
30-
- { os: macos-11, target: darwin, platform: darwin-x64 }
31-
- { os: macos-11, target: darwin, platform: darwin-arm64 }
30+
- { os: macos-latest, target: darwin, platform: darwin-x64 }
31+
- { os: macos-latest, target: darwin, platform: darwin-arm64 }
3232
- { os: windows-latest, target: windows, platform: win32-ia32 }
3333
- { os: windows-latest, target: windows, platform: win32-x64 }
3434
runs-on: ${{ matrix.os }}

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
* `FIX` Respect `completion.showParams` config for local function completion
99
* `CHG` Improve performance of multithreaded `--check` and `undefined-field` diagnostic
1010
* `NEW` added lua regular expression support for Lua.doc.<scope>Name [#2753](https://github.com/LuaLS/lua-language-server/pull/2753)
11-
11+
* `FIX` Bad triggering of the `inject-field` diagnostic, when the fields are declared at the creation of the object [#2746](https://github.com/LuaLS/lua-language-server/issues/2746)
12+
* `CHG` Change spacing of parameter inlay hints to match other LSPs, like `rust-analyzer`
1213

1314
## 3.9.3
1415
`2024-6-11`

meta/template/string.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ function string.gmatch(s, pattern, init) end
7373
---@param n? integer
7474
---@return string
7575
---@return integer count
76-
---@nodiscard
7776
function string.gsub(s, pattern, repl, n) end
7877

7978
---#DES 'string.len'

script/core/diagnostics/inject-field.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ return function (uri, callback)
6868
if def.type == 'doc.field' then
6969
return
7070
end
71+
if def.type == 'tablefield' and not isExact then
72+
return
73+
end
7174
end
7275

7376
local howToFix = ''

script/core/hint.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ local function typeHint(uri, results, start, finish)
5959
end
6060
mark[src] = true
6161
results[#results+1] = {
62-
text = ':' .. view,
62+
text = ': ' .. view,
6363
offset = src.finish,
6464
kind = define.InlayHintKind.Type,
6565
where = 'right',

script/provider/provider.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,8 @@ m.register 'textDocument/inlayHint' {
14261426
},
14271427
position = converter.packPosition(state, res.offset),
14281428
kind = res.kind,
1429-
paddingLeft = res.kind == 1,
1430-
paddingRight = res.kind == 2,
1429+
paddingLeft = false,
1430+
paddingRight = res.kind == define.InlayHintKind.Parameter,
14311431
}
14321432
end
14331433
return hintResults

test/diagnostics/inject-field.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,16 @@ function m:init() -- OK
8282
end
8383
end
8484
]]
85+
86+
TEST [[
87+
---@class Class
88+
local m = {
89+
xx = 1, -- OK
90+
}
91+
92+
---@type Class
93+
local m
94+
95+
m.xx = 1 -- OK
96+
m.<!yy!> = 1 -- Warning
97+
]]

0 commit comments

Comments
 (0)