mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-11-03 20:22:21 +00:00 
			
		
		
		
	languages/dart: add necessary dependency of flutter-tools.nvim on lsp
This commit is contained in:
		
					parent
					
						
							
								11426ea329
							
						
					
				
			
			
				commit
				
					
						ef3ab83254
					
				
			
		
					 2 changed files with 11 additions and 8 deletions
				
			
		| 
						 | 
					@ -332,3 +332,4 @@
 | 
				
			||||||
[Noah765](https://github.com/Noah765):
 | 
					[Noah765](https://github.com/Noah765):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Add missing `flutter-tools.nvim` dependency `plenary.nvim`.
 | 
					- Add missing `flutter-tools.nvim` dependency `plenary.nvim`.
 | 
				
			||||||
 | 
					- Add necessary dependency of `flutter-tools.nvim` on lsp
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@
 | 
				
			||||||
  inherit (lib.strings) optionalString;
 | 
					  inherit (lib.strings) optionalString;
 | 
				
			||||||
  inherit (lib.nvim.lua) expToLua;
 | 
					  inherit (lib.nvim.lua) expToLua;
 | 
				
			||||||
  inherit (lib.nvim.types) mkGrammarOption;
 | 
					  inherit (lib.nvim.types) mkGrammarOption;
 | 
				
			||||||
  inherit (lib.nvim.dag) entryAnywhere;
 | 
					  inherit (lib.nvim.dag) entryAfter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cfg = config.vim.languages.dart;
 | 
					  cfg = config.vim.languages.dart;
 | 
				
			||||||
  ftcfg = cfg.flutter-tools;
 | 
					  ftcfg = cfg.flutter-tools;
 | 
				
			||||||
| 
						 | 
					@ -122,19 +122,21 @@ in {
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  config = mkIf cfg.enable (mkMerge [
 | 
					  config.vim = mkIf cfg.enable (mkMerge [
 | 
				
			||||||
    (mkIf cfg.treesitter.enable {
 | 
					    (mkIf cfg.treesitter.enable {
 | 
				
			||||||
      vim.treesitter.enable = true;
 | 
					      treesitter.enable = true;
 | 
				
			||||||
      vim.treesitter.grammars = [cfg.treesitter.package];
 | 
					      treesitter.grammars = [cfg.treesitter.package];
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (mkIf cfg.lsp.enable {
 | 
					    (mkIf cfg.lsp.enable {
 | 
				
			||||||
      vim.lsp.lspconfig.enable = true;
 | 
					      lsp.lspconfig.enable = true;
 | 
				
			||||||
      vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
 | 
					      lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (mkIf ftcfg.enable {
 | 
					    (mkIf ftcfg.enable {
 | 
				
			||||||
      vim.startPlugins = [
 | 
					      lsp.enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      startPlugins = [
 | 
				
			||||||
        (
 | 
					        (
 | 
				
			||||||
          if ftcfg.enableNoResolvePatch
 | 
					          if ftcfg.enableNoResolvePatch
 | 
				
			||||||
          then "flutter-tools-patched"
 | 
					          then "flutter-tools-patched"
 | 
				
			||||||
| 
						 | 
					@ -143,7 +145,7 @@ in {
 | 
				
			||||||
        "plenary-nvim"
 | 
					        "plenary-nvim"
 | 
				
			||||||
      ];
 | 
					      ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      vim.pluginRC.flutter-tools = entryAnywhere ''
 | 
					      pluginRC.flutter-tools = entryAfter ["lsp-setup"] ''
 | 
				
			||||||
        require('flutter-tools').setup {
 | 
					        require('flutter-tools').setup {
 | 
				
			||||||
          lsp = {
 | 
					          lsp = {
 | 
				
			||||||
            color = { -- show the derived colours for dart variables
 | 
					            color = { -- show the derived colours for dart variables
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue