File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,24 @@ return {
9292
9393 lsp = {
9494 capabilities = capabilities ,
95+
96+ -- Suppress didChange errors during snippet expansion
97+ on_attach = function (client , bufnr )
98+ -- Reduce didChange notification frequency to prevent errors with snippets
99+ client .server_capabilities .textDocumentSync = vim .tbl_deep_extend (' force' , client .server_capabilities .textDocumentSync or {}, {
100+ change = 2 , -- 2 = Incremental (less prone to errors than full sync)
101+ })
102+
103+ -- Filter out didChange error notifications (they're harmless during snippet expansion)
104+ local notify = vim .notify
105+ vim .notify = function (msg , level , opts )
106+ if type (msg ) == ' string' and msg :match (' textDocument/didChange' ) then
107+ return -- Suppress this specific error
108+ end
109+ notify (msg , level , opts )
110+ end
111+ end ,
112+
95113 -- Color preview for dart variables (Colors.red, Color(0xFF...), etc.)
96114 -- This shows the actual Material Design colors inline!
97115 color = {
You can’t perform that action at this time.
0 commit comments