1
0
Fork 0

lsp: configure lua to ignore unused locals starting with '_'

This commit is contained in:
Felipe 2023-08-02 14:41:24 -04:00
parent 5c641ce4d4
commit 0b64cf2329
Signed by: pitbuster
SSH key fingerprint: SHA256:OM3HeVSA96adfy2Gi8OhZkQBY67P88LoJUwkeVoTArQ

View file

@ -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