lsp/presets/dart: init

This commit is contained in:
Snoweuph 2026-04-12 14:59:41 +02:00
commit f01641b208
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
2 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.vim.lsp.presets.dart;
in {
options.vim.lsp.presets.dart = {
enable = mkEnableOption "the Dart Language Server";
};
config = mkIf cfg.enable {
vim.lsp.servers.dart = {
enable = true;
cmd = [(getExe pkgs.dart) "language-server" "--protocol=lsp"];
root_markers = [".git" "pubspec.yaml"];
init_options = {
onlyAnalyzeProjectsWithOpenFiles = true;
suggestFromUnimportedLibraries = true;
closingLabels = true;
outline = true;
flutterOutline = true;
};
settings = {
dart = {
completeFunctionCalls = true;
showTodos = true;
};
};
};
};
}