Skip to content

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

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

Merged
merged 1 commit into from
May 28, 2022
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reasonable; a lot of lua code automatically passes nil when no arguments specified.

}
}
}

2 changes: 1 addition & 1 deletion lua/nvim-tree/diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecated

buffer_severity[bufname] = severity
end
end
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim-tree/explorer/explore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim-tree/explorer/reload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down