lsp/presets/astro-language-server: init

This commit is contained in:
Snoweuph 2026-04-12 00:17:07 +02:00
commit c7e1dedcdb
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
2 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (lib.generators) mkLuaInline;
cfg = config.vim.lsp.presets.astro-language-server;
in {
options.vim.lsp.presets.astro-language-server = {
enable = mkEnableOption "the Astro Language Server";
};
config = mkIf cfg.enable {
vim.lsp.servers.astro-language-server = {
enable = true;
cmd = [(getExe pkgs.astro-language-server) "--stdio"];
root_markers = [".git" "package.json" "tsconfig.json" "jsconfig.json"];
init_options = {
typescript = {};
};
before_init = mkLuaInline ''
function(_, config)
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
config.init_options.typescript.tsdk = util.get_typescript_server_path(config.root_dir)
end
end
'';
};
};
}

View file

@ -2,6 +2,7 @@
imports = [
./arduino-language-server.nix
./asm-lsp.nix
./astro-language-server.nix
./basedpyright.nix
./deno.nix
./harper.nix