1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-27 04:59:47 +01:00
neovim-flake/modules/lsp/flutter-tools-nvim/config.nix
2023-04-02 21:00:40 +03:00

33 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,
},
}
'';
};
}