You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message="plugin-managed document colors are deprecated and will be removed when flutter-tools.nvim requires Neovim 0.12+. On Neovim 0.12+, use vim.lsp.document_color.enable() instead",
163
+
},
164
+
},
165
+
},
158
166
}
159
167
168
+
localfunctionnotify_deprecation(key, message)
169
+
vim.defer_fn(function()
170
+
ui.notify(fmt("%s is deprecated: %s", key, message), ui.WARN, { once=true })
ui.notify=function(msg, level) table.insert(notifications, { msg=msg, level=level }) end
16
+
17
+
config=require("flutter-tools.config")
18
+
end)
19
+
20
+
after_each(function()
21
+
vim.fn.has=original_has
22
+
package.loaded["flutter-tools.config"] =nil
23
+
package.loaded["flutter-tools.ui"] =nil
24
+
end)
25
+
26
+
it("warns when lsp.color is configured on Neovim 0.12+", function()
27
+
vim.fn.has=function(feature)
28
+
iffeature=="nvim-0.12" thenreturn1end
29
+
returnoriginal_has(feature)
30
+
end
31
+
32
+
config.set({
33
+
lsp= {
34
+
color= {
35
+
enabled=true,
36
+
},
37
+
},
38
+
})
39
+
40
+
vim.wait(1200)
41
+
42
+
assert.equal(1, #notifications)
43
+
assert.equal(
44
+
"lsp.color is deprecated: plugin-managed document colors are deprecated and will be removed when flutter-tools.nvim requires Neovim 0.12+. On Neovim 0.12+, use vim.lsp.document_color.enable() instead",
45
+
notifications[1].msg
46
+
)
47
+
assert.equal(ui.WARN, notifications[1].level)
48
+
end)
49
+
50
+
it("does not warn when lsp.color is configured before Neovim 0.12", function()
51
+
vim.fn.has=function(feature)
52
+
iffeature=="nvim-0.12" thenreturn0end
53
+
returnoriginal_has(feature)
54
+
end
55
+
56
+
config.set({
57
+
lsp= {
58
+
color= {
59
+
enabled=true,
60
+
},
61
+
},
62
+
})
63
+
64
+
vim.wait(1200)
65
+
66
+
assert.same({}, notifications)
67
+
end)
68
+
69
+
it("does not warn when lsp.color is omitted", function()
0 commit comments