lsp: configure lua to ignore unused locals starting with '_'
This commit is contained in:
parent
5c641ce4d4
commit
0b64cf2329
1 changed files with 6 additions and 4 deletions
10
init.lua
10
init.lua
|
|
@ -201,7 +201,7 @@ local lsp = require("lspconfig")
|
|||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_lsp_attach = function(client, bufnr)
|
||||
local on_lsp_attach = function(_client, _bufnr)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover)
|
||||
|
|
@ -232,7 +232,10 @@ local servers = {
|
|||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "LuaJIT" },
|
||||
diagnostics = { globals = { "vim" } },
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
unusedLocalExclude = { "_*" },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
|
|
@ -338,7 +341,6 @@ for ft, ft_linters in pairs(linters) do
|
|||
lint.try_lint(nil, { ignore_errors = true })
|
||||
end,
|
||||
})
|
||||
lint.try_lint(nil, { ignore_errors = true })
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
|
@ -425,7 +427,7 @@ end
|
|||
g.gitblame_enabled = 0
|
||||
---- gitsigns.nvim
|
||||
require("gitsigns").setup({
|
||||
on_attach = function(bufnr)
|
||||
on_attach = function(_bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
-- Navigation
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue