add .luarc.json for lua-language-server and fix a couple of nits (#1296)
This commit is contained in:
parent
e482bad61c
commit
c3b7be8d19
13
.luarc.json
Normal file
13
.luarc.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ local function from_coc()
|
|||||||
|
|
||||||
for bufname, severity_list in pairs(diagnostics) do
|
for bufname, severity_list in pairs(diagnostics) do
|
||||||
if not buffer_severity[bufname] then
|
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
|
buffer_severity[bufname] = severity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -32,11 +32,11 @@ local function populate_children(handle, cwd, node, status)
|
|||||||
then
|
then
|
||||||
local child = nil
|
local child = nil
|
||||||
if t == "directory" and uv.fs_access(abs, "R") then
|
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
|
elseif t == "file" then
|
||||||
child = builders.file(node, abs, name, status, node_ignored)
|
child = builders.file(node, abs, name)
|
||||||
elseif t == "link" then
|
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
|
if link.link_to ~= nil then
|
||||||
child = link
|
child = link
|
||||||
end
|
end
|
||||||
|
|||||||
@ -48,11 +48,11 @@ function M.reload(node, status)
|
|||||||
child_names[abs] = true
|
child_names[abs] = true
|
||||||
if not nodes_by_path[abs] then
|
if not nodes_by_path[abs] then
|
||||||
if t == "directory" and uv.fs_access(abs, "R") 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
|
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
|
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
|
if link.link_to ~= nil then
|
||||||
table.insert(node.nodes, link)
|
table.insert(node.nodes, link)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user