Skip to content

Commit d32b49d

Browse files
authored
Merge branch 'master' into feat/deforder
2 parents 390cf8f + c51f038 commit d32b49d

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
55
* `FIX` Improved ordering of results for `textDocument/definition`.
6+
* `FIX` Error `attempt to index a nil value` when `Lua.hint.semicolon == 'All'` [#2788](https://github.com/LuaLS/lua-language-server/issues/2788)
67

78
## 3.10.3
89
`2024-8-8`

script/core/hint.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ local function semicolonHint(uri, results, start, finish)
287287
---@async
288288
guide.eachSourceTypes(state.ast, blockTypes, function (src)
289289
await.delay()
290+
if #src < 1 then return end
291+
290292
for i = 1, #src - 1 do
291293
local current = src[i]
292294
local next = src[i+1]
@@ -313,6 +315,7 @@ local function semicolonHint(uri, results, start, finish)
313315
end
314316
end
315317
end
318+
316319
if mode == 'All' then
317320
local last = src[#src]
318321
results[#results+1] = {

script/service/service.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function m.testVersion()
250250
end
251251

252252
function m.sayHello()
253-
proto.notify('$/hello', 'world')
253+
proto.notify('$/hello', {'world'})
254254
end
255255

256256
function m.lockCache()

0 commit comments

Comments
 (0)