Skip to content

Commit fbc8a24

Browse files
author
Francis
committed
lsp warning
1 parent 0515f98 commit fbc8a24

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

init.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,15 @@ require('lazy').setup({
738738
end,
739739
})
740740

741+
-- Override diagnostic handler to prevent URI errors
742+
local default_diagnostic_handler = vim.lsp.handlers['textDocument/publishDiagnostics']
743+
vim.lsp.handlers['textDocument/publishDiagnostics'] = function(err, result, ctx, config)
744+
-- Filter out diagnostics with invalid URIs
745+
if result and result.uri and type(result.uri) == 'string' and result.uri ~= '' then
746+
return default_diagnostic_handler(err, result, ctx, config)
747+
end
748+
end
749+
741750
-- Diagnostic Config
742751
-- See :help vim.diagnostic.Opts
743752
vim.diagnostic.config {

0 commit comments

Comments
 (0)