neovim-flake/modules/lsp/flutter-tools-nvim/config.nix

34 lines
1.1 KiB
Nix
Raw Normal View History

2023-04-02 20:00:40 +02:00
{
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
2023-04-02 20:55:23 +02:00
virtual_text_str = ${ftcfg.color.virtualText.character} -- the virtual text character to highlight
2023-04-02 20:00:40 +02:00
},
capabilities = capabilities,
on_attach = default_on_attach;
flags = lsp_flags,
},
}
'';
};
}