mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-27 20:59:47 +01:00
34 lines
1.1 KiB
Nix
34 lines
1.1 KiB
Nix
|
{
|
||
|
config,
|
||
|
lib,
|
||
|
...
|
||
|
}:
|
||
|
with lib;
|
||
|
with builtins; let
|
||
|
cfg = config.vim.lsp;
|
||
|
ftcfg = cfg.dart.flutter-tools;
|
||
|
in {
|
||
|
config = mkIf (cfg.enable && ftcfg.enable) {
|
||
|
vim.startPlugins = ["flutter-tools"];
|
||
|
|
||
|
vim.luaConfigRC.flutter-tools = nvim.dag.entryAnywhere ''
|
||
|
require('flutter-tools').setup {
|
||
|
lsp = {
|
||
|
color = { -- show the derived colours for dart variables
|
||
|
enabled = ${boolToString ftcfg.color.enable}, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
|
||
|
background = ${boolToString ftcfg.color.highlightBackground}, -- highlight the background
|
||
|
foreground = ${boolToString ftcfg.color.highlightForeground}, -- highlight the foreground
|
||
|
virtual_text = ${boolToString ftcfg.color.virtualText.enable}, -- show the highlight using virtual text
|
||
|
virtual_text_str = ${ctcfg.color.virtualText.character} -- the virtual text character to highlight
|
||
|
},
|
||
|
|
||
|
capabilities = capabilities,
|
||
|
on_attach = default_on_attach;
|
||
|
flags = lsp_flags,
|
||
|
},
|
||
|
}
|
||
|
|
||
|
'';
|
||
|
};
|
||
|
}
|