Skip to content

Commit 37a7fd7

Browse files
authored
Merge branch 'LuaLS:master' into master
2 parents 35e322c + 5623a84 commit 37a7fd7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+254
-117
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
matrix:
88
include:
99
- { os: ubuntu-20.04, platform: linux-x64 }
10-
- { os: macos-latest, platform: darwin-x64 }
10+
- { os: macos-14, platform: darwin-arm64 }
1111
- { os: windows-latest, platform: win32-x64 }
1212
runs-on: ${{ matrix.os }}
1313
steps:

locale/en-us/setting.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ When checking the type of union type, ignore the `nil` in it.
293293
294294
When this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.
295295
]]
296+
config.type.inferParamType =
297+
[[
298+
When a parameter type is not annotated, it is inferred from the function's call sites.
299+
300+
When this setting is `false`, the type of the parameter is `any` when it is not annotated.
301+
]]
296302
config.doc.privateName =
297303
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
298304
config.doc.protectedName =

locale/pt-br/setting.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ When checking the type of union type, ignore the `nil` in it.
293293
294294
When this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.
295295
]]
296+
config.type.inferParamType = -- TODO: need translate!
297+
[[
298+
When the parameter type is not annotated, the parameter type is inferred from the function's incoming parameters.
299+
300+
When this setting is `false`, the type of the parameter is `any` when it is not annotated.
301+
]]
296302
config.doc.privateName = -- TODO: need translate!
297303
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
298304
config.doc.protectedName = -- TODO: need translate!

locale/zh-cn/setting.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ config.type.weakNilCheck =
292292
293293
此设置为 `false` 时,`numer|nil` 类型无法赋给 `number` 类型;为 `true` 是则可以。
294294
]]
295+
config.type.inferParamType =
296+
[[
297+
未注释参数类型时,参数类型由函数传入参数推断。
298+
299+
如果设置为 "false",则在未注释时,参数类型为 "any"。
300+
]]
295301
config.doc.privateName =
296302
'将特定名称的字段视为私有,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 是私有字段,只能在定义所在的类中访问。'
297303
config.doc.protectedName =

locale/zh-tw/setting.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ When checking the type of union type, ignore the `nil` in it.
292292
293293
When this setting is `false`, the `number|nil` type cannot be assigned to the `number` type. It can be with `true`.
294294
]]
295+
config.type.inferParamType = -- TODO: need translate!
296+
[[
297+
未注释参数类型时,参数类型由函数传入参数推断。
298+
299+
如果设置为 "false",则在未注释时,参数类型为 "any"。
300+
]]
295301
config.doc.privateName = -- TODO: need translate!
296302
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
297303
config.doc.protectedName = -- TODO: need translate!

make.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ lm:executable "lua-language-server" {
5555
}
5656

5757
local platform = require 'bee.platform'
58-
local exe = platform.OS == 'Windows' and ".exe" or ""
58+
local exe = platform.os == 'windows' and ".exe" or ""
5959

6060
lm:copy "copy_lua-language-server" {
61-
input = lm.bindir .. "/lua-language-server" .. exe,
62-
output = "bin/lua-language-server" .. exe,
61+
inputs = "$bin/lua-language-server" .. exe,
62+
outputs = "bin/lua-language-server" .. exe,
6363
}
6464

6565
lm:copy "copy_bootstrap" {
66-
input = "make/bootstrap.lua",
67-
output = "bin/main.lua",
66+
inputs = "make/bootstrap.lua",
67+
outputs = "bin/main.lua",
6868
}
6969

7070
lm:msvc_copydll 'copy_vcrt' {
7171
type = "vcrt",
72-
output = "bin",
72+
outputs = "bin",
7373
}
7474

7575
lm:phony "all" {
@@ -93,27 +93,27 @@ if lm.notest then
9393
end
9494

9595
lm:rule "run-bee-test" {
96-
lm.bindir .. "/lua-language-server" .. exe, "$in",
96+
args = { "$bin/lua-language-server" .. exe, "$in" },
9797
description = "Run test: $in.",
9898
pool = "console",
9999
}
100100

101101
lm:rule "run-unit-test" {
102-
"bin/lua-language-server" .. exe, "$in",
102+
args = { "bin/lua-language-server" .. exe, "$in" },
103103
description = "Run test: $in.",
104104
pool = "console",
105105
}
106106

107107
lm:build "bee-test" {
108108
rule = "run-bee-test",
109109
deps = { "lua-language-server", "copy_script" },
110-
input = "3rd/bee.lua/test/test.lua",
110+
inputs = "3rd/bee.lua/test/test.lua",
111111
}
112112

113113
lm:build 'unit-test' {
114114
rule = "run-unit-test",
115115
deps = { "bee-test", "all" },
116-
input = "test.lua",
116+
inputs = "test.lua",
117117
}
118118

119119
lm:default {

make/detect_platform.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local lm = require 'luamake'
22

33
local platform = require 'bee.platform'
44

5-
if platform.OS == 'macOS' then
5+
if platform.os == 'macos' then
66
if lm.platform == nil then
77
elseif lm.platform == "darwin-arm64" then
88
lm.target = "arm64-apple-macos11"
@@ -11,7 +11,7 @@ if platform.OS == 'macOS' then
1111
else
1212
error "unknown platform"
1313
end
14-
elseif platform.OS == 'Windows' then
14+
elseif platform.os == 'windows' then
1515
if lm.platform == nil then
1616
elseif lm.platform == "win32-ia32" then
1717
lm.arch = "x86"
@@ -20,7 +20,7 @@ elseif platform.OS == 'Windows' then
2020
else
2121
error "unknown platform"
2222
end
23-
elseif platform.OS == 'Linux' then
23+
elseif platform.os == 'linux' then
2424
if lm.platform == nil then
2525
elseif lm.platform == "linux-x64" then
2626
elseif lm.platform == "linux-arm64" then
@@ -52,7 +52,7 @@ local ARCH <const> = {
5252
}
5353

5454
local function detectArch()
55-
if platform.OS == 'Windows' then
55+
if platform.os == 'windows' then
5656
return detectWindowsArch()
5757
end
5858
local posixArch = detectPosixArch()
@@ -67,5 +67,5 @@ local function targetPlatformArch()
6767
end
6868

6969
if not lm.notest then
70-
lm.notest = (platform.OS ~= 'Windows' and targetPlatformArch() ~= detectArch())
70+
lm.notest = (platform.os ~= 'windows' and targetPlatformArch() ~= detectArch())
7171
end

script/cli/check.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ local config = require 'config.config'
1111
local fs = require 'bee.filesystem'
1212
local provider = require 'provider'
1313

14+
require 'plugin'
1415
require 'vm'
1516

1617
lang(LOCALE)
@@ -26,6 +27,7 @@ if not rootUri then
2627
print(lang.script('CLI_CHECK_ERROR_URI', rootPath))
2728
return
2829
end
30+
rootUri = rootUri:gsub("/$", "")
2931

3032
if CHECKLEVEL then
3133
if not define.DiagnosticSeverity[CHECKLEVEL] then
@@ -69,7 +71,7 @@ lclient():start(function (client)
6971
end
7072
config.set(rootUri, 'Lua.diagnostics.disable', util.getTableKeys(disables, true))
7173

72-
local uris = files.getAllUris(rootUri)
74+
local uris = files.getChildFiles(rootUri)
7375
local max = #uris
7476
for i, uri in ipairs(uris) do
7577
files.open(uri)
@@ -83,6 +85,7 @@ lclient():start(function (client)
8385
.. ('0'):rep(#tostring(max) - #tostring(i))
8486
.. tostring(i) .. '/' .. tostring(max)
8587
io.write(output)
88+
io.flush()
8689
end
8790
end
8891
io.write('\x0D')

0 commit comments

Comments
 (0)