-
Notifications
You must be signed in to change notification settings - Fork 131
Don't enable shellcheck linting by default #999
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
Comments
Ok after further research I managed to disable it with local lsp_opts = {}
if server_name == "bashls" then -- by default disable shellcheck
lsp_opts.settings = { bashIde = { shellcheckPath = "" } }
end And while that keep the lsp capabilities, it disables the bash-language-server code actions for code fixes, which I find super valuable. So I'm closing this. |
In case someone is interested, this is how I made compatilbe null-ls-- null-ls [lsp code formatting]
-- https://github.com/nvimtools/none-ls.nvim
{
"nvimtools/none-ls.nvim",
dependencies = {
{
"jay-babu/mason-null-ls.nvim",
cmd = { "NullLsInstall", "NullLsUninstall" },
opts = { handlers = {} },
},
},
event = "BufEnter",
opts = function()
local nls = require "null-ls"
return {
sources = {
-- You can customize your formatters here.
nls.builtins.formatting.beautysh.with {
command = "beautysh",
args = { "--indent-size=2", "$FILENAME" },
},
-- TODO: Disable the next feature once this has been merged.
-- https://github.com/bash-lsp/bash-language-server/issues/933
nls.builtins.code_actions.shellcheck,
nls.builtins.diagnostics.shellcheck.with { diagnostics_format = "" },
},
on_attach = require("base.utils.lsp").on_attach,
}
end,
config = function(_, opts)
local nls = require "null-ls"
nls.setup(opts)
-- When running :LspStart, ensure null-ls starts too
vim.api.nvim_create_autocmd({ "LspAttach" }, {
desc = "Ensure null-ls run its sources a lsp client starts",
callback = function()
pcall(function() require("null-ls").enable({}) end)
end,
})
end
}, LSP configif server_name == "bashls" then -- by default use mason shellcheck path
lsp_opts.settings = { bashIde = { shellcheckPath = vim.fn.stdpath "data" .. "/mason/bin/shellcheck" } }
end This way
Screenshot |
@Zeioth |
What is the problem this feature will solve?
On neovim, when installing
bash-language-server
along withshellcheck
, this triggers linting two times.What is the feature you are proposing to solve the problem?
Make shellcheck linting disabled by default, and opt-in. As linting is the responsability of a linter, not the responsability of a lsp server.
Screenshot
The text was updated successfully, but these errors were encountered: