Skip to content

Improve lua-lanuageserver --check #3256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions script/cli/check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ local function logFileForThread(threadId)
return LOGPATH .. '/check-partial-' .. threadId .. '.json'
end

local function buildArgs(exe, numThreads, threadId, format, quiet)
local args = {exe}
local function buildArgs(minIndex, numThreads, threadId, format, quiet)
local args = {}
local skipNext = false
for i = 1, #arg do
for i = minIndex, #arg do
local arg = arg[i]
-- --check needs to be transformed into --check_worker
if arg:lower():match('^%-%-check$') or arg:lower():match('^%-%-check=') then
Expand Down Expand Up @@ -56,9 +56,10 @@ function export.runCLI()
exe = arg[minIndex]
minIndex = minIndex - 1
end
minIndex = minIndex + 1
-- TODO: is this necessary? got it from the shell.lua helper in bee.lua tests
if platform.os == 'windows' and not exe:match('%.[eE][xX][eE]$') then
exe = exe..'.exe'
arg[minIndex] = exe..'.exe'
end

if not QUIET and numThreads > 1 then
Expand All @@ -67,7 +68,7 @@ function export.runCLI()

local procs = {}
for i = 1, numThreads do
local process, err = subprocess.spawn({buildArgs(exe, numThreads, i, CHECK_FORMAT, QUIET)})
local process, err = subprocess.spawn({buildArgs(minIndex, numThreads, i, CHECK_FORMAT, QUIET)})
if err then
print(err)
end
Expand Down
Loading