fix(rust_analyzer): remove special filtering of diagnostics
This commit is contained in:
@@ -2,22 +2,7 @@ local lsp = require("lsp")
|
|||||||
|
|
||||||
---@type vim.lsp.Config
|
---@type vim.lsp.Config
|
||||||
return {
|
return {
|
||||||
on_attach = function(client, bufnr)
|
on_attach = lsp.on_attach,
|
||||||
lsp.on_attach(client, bufnr)
|
|
||||||
|
|
||||||
local handler_name = "textDocument/publishDiagnostics"
|
|
||||||
local default_handler = client.handlers[handler_name]
|
|
||||||
or vim.lsp.handlers[handler_name]
|
|
||||||
client.handlers[handler_name] = function(err, result, context, config)
|
|
||||||
if result and result.diagnostics then
|
|
||||||
result.diagnostics = vim.tbl_filter(function(diagnostic)
|
|
||||||
return diagnostic.severity < vim.diagnostic.severity.HINT
|
|
||||||
end, result.diagnostics)
|
|
||||||
end
|
|
||||||
|
|
||||||
default_handler(err, result, context, config)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
check = {
|
check = {
|
||||||
|
|||||||
Reference in New Issue
Block a user