mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-17 20:48:18 +00:00
lsp/presets/astro-language-server: init
This commit is contained in:
parent
9ac800a85a
commit
c7e1dedcdb
2 changed files with 36 additions and 0 deletions
35
modules/plugins/lsp/presets/astro-language-server.nix
Normal file
35
modules/plugins/lsp/presets/astro-language-server.nix
Normal 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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./arduino-language-server.nix
|
./arduino-language-server.nix
|
||||||
./asm-lsp.nix
|
./asm-lsp.nix
|
||||||
|
./astro-language-server.nix
|
||||||
./basedpyright.nix
|
./basedpyright.nix
|
||||||
./deno.nix
|
./deno.nix
|
||||||
./harper.nix
|
./harper.nix
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue