Skip to content

Commit 37ed3e4

Browse files
authored
Merge branch 'master' into max-fields-count
2 parents e1dd213 + 0d05731 commit 37ed3e4

File tree

15 files changed

+123
-31
lines changed

15 files changed

+123
-31
lines changed

.pre-commit-hooks.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- id: lua-language-server-check
3+
language: lua
4+
name: lua language server check
5+
description: >
6+
use lua language server to check lua files
7+
entry: lua-language-server
8+
types:
9+
- lua
10+
args:
11+
- --check
12+
- .

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Lua language server provides various language features for Lua to make devel
1414

1515
## Features
1616

17-
- ⚙️ Supports `Lua 5.4`, `Lua 5.3`, `Lua 5.2`, `Lua 5.1`, and `LuaJIT`
17+
- ⚙️ Supports `Lua 5.5`, `Lua 5.4`, `Lua 5.3`, `Lua 5.2`, `Lua 5.1`, and `LuaJIT`
1818
- 📄 Over 20 supported [annotations](https://luals.github.io/wiki/annotations/) for documenting your code
1919
- ↪ Go to definition
2020
- 🦺 Dynamic [type checking](https://luals.github.io/wiki/type-checking/)
@@ -65,6 +65,8 @@ The install methods below are maintained by community members.
6565
- `zh-cn` 🇨🇳
6666
- `zh-tw` 🇹🇼
6767
- `pt-br` 🇧🇷
68+
- `ja-jp` 🇯🇵
69+
- `es-419` 🇪🇸
6870

6971

7072
> **Note**

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
5+
* `FIX` Plugin virtual comment style and behavior issues
56
* `NEW` Support Lua 5.5
67
* `FIX` Incorrect generation of function signatures with tuple-parameters
78
* `NEW` Doc output now contains file paths for `@alias` and `@enum` types
@@ -12,6 +13,7 @@
1213
* `FIX` Typed `@field` (eg `---@field [string] boolean`) should not override other defined field [#2171](https://github.com/LuaLS/lua-language-server/issues/2171), [#2711](https://github.com/LuaLS/lua-language-server/issues/2711)
1314
* `FIX` don't return empty hover doc when luals failed to find definition
1415
* `FIX` Prevent stack overflow when attempting to resolve function return values. [#3246](https://github.com/LuaLS/lua-language-server/issues/3246)
16+
* `FIX` Fix type annotations for `string.buffer` module
1517

1618
## 3.15.0
1719
`2025-6-25`

lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
script

lua-language-server

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env lua
2+
local f = '%q'
3+
local args = {
4+
'bee',
5+
debug.getinfo(1).source:match("@?(.*/)[^/]+/") .. 'main.lua',
6+
}
7+
for _, v in ipairs(arg) do
8+
table.insert(args, f:format(v))
9+
end
10+
local isok, reason, ret = os.execute(table.concat(args, ' '))
11+
if type(isok) == type(0) then
12+
ret = isok
13+
end
14+
if ret ~= 0 then
15+
os.exit(1)
16+
end

lua-language-server-scm-1.rockspec

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
local git_ref = '3.15.1'
2+
local modrev = 'scm'
3+
local specrev = '1'
4+
5+
rockspec_format = '3.0'
6+
package = 'lua-language-server'
7+
version = modrev .. '-' .. specrev
8+
9+
local repo_url = 'https://github.com/LuaLS/lua-language-server'
10+
11+
description = {
12+
summary = 'A language server that offers Lua language support - programmed in Lua',
13+
detailed =
14+
[[The Lua language server provides various language features for Lua to make development easier and faster. With nearly a million installs in Visual Studio Code, it is the most popular extension for Lua language support.]],
15+
labels = { 'lua', 'language-server', 'lpeg', 'hacktoberfest', 'lsp', 'lsp-server', 'lpeglabel' },
16+
homepage = repo_url,
17+
license = 'MIT'
18+
}
19+
20+
source = {
21+
url = repo_url .. '/archive/' .. git_ref .. '.zip',
22+
dir = package .. '-' .. git_ref,
23+
}
24+
25+
dependencies = { 'lpeglabel', 'EmmyLuaCodeStyle', 'bee.lua' }
26+
27+
build = {
28+
type = 'builtin',
29+
copy_directories = { 'meta', 'locale' },
30+
install = {
31+
bin = {
32+
[package] = package,
33+
},
34+
conf = {
35+
['../main.lua'] = 'main.lua',
36+
['../debugger.lua'] = 'debugger.lua',
37+
},
38+
}
39+
}

meta/template/string.buffer.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function buf:ref() end
262262
--- Serializes (encodes) the Lua object to the buffer
263263
---
264264
--- This function may throw an error when attempting to serialize unsupported object types, circular references or deeply nested tables.
265-
---@param obj string.buffer.data
265+
---@param obj any
266266
---@return string.buffer
267267
function buf:encode(obj) end
268268

@@ -277,14 +277,14 @@ function buf:encode(obj) end
277277
---
278278
--- Attempting to de-serialize an FFI type will throw an error, if the FFI library is not built-in or has not been loaded, yet.
279279
---
280-
---@return string.buffer.data|nil obj
280+
---@return any obj
281281
function buf:decode() end
282282

283283

284284
--- Serializes (encodes) the Lua object obj
285285
---
286286
--- This function may throw an error when attempting to serialize unsupported object types, circular references or deeply nested tables.
287-
---@param obj string.buffer.data
287+
---@param obj any
288288
---@return string
289289
function buffer.encode(obj) end
290290

@@ -298,7 +298,7 @@ function buffer.encode(obj) end
298298
--- Attempting to de-serialize an FFI type will throw an error, if the FFI library is not built-in or has not been loaded, yet.
299299
---
300300
---@param str string
301-
---@return string.buffer.data|nil obj
301+
---@return any obj
302302
function buffer.decode(str) end
303303

304304

script/core/diagnostics/unused-vararg.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ return function (uri, callback)
2525

2626
for _, arg in ipairs(args) do
2727
if arg.type == '...' then
28-
if not arg.ref then
28+
if not arg.ref and not arg.name then
2929
callback {
3030
start = arg.start,
3131
finish = arg.finish,

script/core/find-source.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ return function (state, position, accept)
1515
local len = math.huge
1616
local result
1717
guide.eachSourceContain(state.ast, position, function (source)
18+
if source.virtual then
19+
return
20+
end
1821
if source.type == 'function' then
1922
if not isValidFunctionPos(source, position) then
2023
return

script/files.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ local function getRealParent(path)
7070
return path
7171
end
7272
local res = sys.fullpath(path)
73+
if not res then
74+
return path
75+
end
7376
return getRealParent(parent) / res:filename()
7477
end
7578

0 commit comments

Comments
 (0)