mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 20:05:23 +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 = [
|
||||
./arduino-language-server.nix
|
||||
./asm-lsp.nix
|
||||
./astro-language-server.nix
|
||||
./basedpyright.nix
|
||||
./deno.nix
|
||||
./harper.nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue