From 5a58870a10ece4b6ac6fa10b012fc8074bc3ddf5 Mon Sep 17 00:00:00 2001 From: Anup Sebastian Date: Thu, 30 Oct 2025 23:54:31 -0500 Subject: [PATCH] fix: snippet error suppress --- lua/custom/plugins/flutter.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lua/custom/plugins/flutter.lua b/lua/custom/plugins/flutter.lua index a1f17127..5721dea7 100644 --- a/lua/custom/plugins/flutter.lua +++ b/lua/custom/plugins/flutter.lua @@ -92,6 +92,24 @@ return { lsp = { capabilities = capabilities, + + -- Suppress didChange errors during snippet expansion + on_attach = function(client, bufnr) + -- Reduce didChange notification frequency to prevent errors with snippets + client.server_capabilities.textDocumentSync = vim.tbl_deep_extend('force', client.server_capabilities.textDocumentSync or {}, { + change = 2, -- 2 = Incremental (less prone to errors than full sync) + }) + + -- Filter out didChange error notifications (they're harmless during snippet expansion) + local notify = vim.notify + vim.notify = function(msg, level, opts) + if type(msg) == 'string' and msg:match('textDocument/didChange') then + return -- Suppress this specific error + end + notify(msg, level, opts) + end + end, + -- Color preview for dart variables (Colors.red, Color(0xFF...), etc.) -- This shows the actual Material Design colors inline! color = {