add .luarc.json for lua-language-server and fix a couple of nits (#1296)

This commit is contained in:
Alexander Courtis 2022-05-28 19:16:54 +10:00 committed by GitHub
parent e482bad61c
commit c3b7be8d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 7 deletions

13
.luarc.json Normal file
View File

@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"diagnostics": {
"globals": {
"vim": true
},
"disable": {
"lowercase-global": true,
"missing-parameter": true
}
}
}

View File

@ -92,7 +92,7 @@ local function from_coc()
for bufname, severity_list in pairs(diagnostics) do
if not buffer_severity[bufname] then
local severity = math.min(unpack(severity_list))
local severity = math.min(table.unpack(severity_list))
buffer_severity[bufname] = severity
end
end

View File

@ -32,11 +32,11 @@ local function populate_children(handle, cwd, node, status)
then
local child = nil
if t == "directory" and uv.fs_access(abs, "R") then
child = builders.folder(node, abs, name, status, node_ignored)
child = builders.folder(node, abs, name)
elseif t == "file" then
child = builders.file(node, abs, name, status, node_ignored)
child = builders.file(node, abs, name)
elseif t == "link" then
local link = builders.link(node, abs, name, status, node_ignored)
local link = builders.link(node, abs, name)
if link.link_to ~= nil then
child = link
end

View File

@ -48,11 +48,11 @@ function M.reload(node, status)
child_names[abs] = true
if not nodes_by_path[abs] then
if t == "directory" and uv.fs_access(abs, "R") then
table.insert(node.nodes, builders.folder(node, abs, name, status, node_ignored))
table.insert(node.nodes, builders.folder(node, abs, name))
elseif t == "file" then
table.insert(node.nodes, builders.file(node, abs, name, status, node_ignored))
table.insert(node.nodes, builders.file(node, abs, name))
elseif t == "link" then
local link = builders.link(node, abs, name, status, node_ignored)
local link = builders.link(node, abs, name)
if link.link_to ~= nil then
table.insert(node.nodes, link)
end