lsp/presets/vala-language-server: init

This commit is contained in:
Snoweuph 2026-04-11 12:35:11 +02:00
commit 78eac1d1c2
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
3 changed files with 41 additions and 0 deletions

View file

@ -71,6 +71,8 @@
- Renamed `tsgo` to `typescript-go`. - Renamed `tsgo` to `typescript-go`.
- Renamed `vala_ls` to `vala-language-server`.
## Changelog {#sec-release-0-9-changelog} ## Changelog {#sec-release-0-9-changelog}
[SecBear](https://github.com/SecBear): [SecBear](https://github.com/SecBear):
@ -240,6 +242,9 @@
- Added `vim.lsp.presets.<name>` to contain LSP configurations. This allows for - Added `vim.lsp.presets.<name>` to contain LSP configurations. This allows for
more flexibility in nvf and reuse of LSPs across languages. more flexibility in nvf and reuse of LSPs across languages.
- Fix `vim.lsp.presets.vala-language-server` to be wrapped correctly with
`uncrustify`.
- Fix `tressiter` to allow `null` in grammar options, so they can be filtered - Fix `tressiter` to allow `null` in grammar options, so they can be filtered
out. out.

View file

@ -7,5 +7,6 @@
./twig-language-server.nix ./twig-language-server.nix
./typescript-go.nix ./typescript-go.nix
./typescript-language-server.nix ./typescript-language-server.nix
./vala-language-server.nix
]; ];
} }

View file

@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.vim.lsp.presets.vala-language-server;
in {
options.vim.lsp.presets.vala-language-server = {
enable = mkEnableOption "the Vala Language Server";
};
config = mkIf cfg.enable {
vim.lsp.servers.vala-language-server = {
enable = true;
# We are wrapping the LSP with uncrustify in the path,
# because it is an optional dependency to support formatting
# <https://github.com/vala-lang/vala-language-server#dependencies>
cmd = [
(getExe (pkgs.symlinkJoin {
name = "vala-language-server-wrapper";
paths = [pkgs.vala-language-server];
meta.mainProgram = "vala-language-server";
buildInputs = [pkgs.makeBinaryWrapper];
postBuild = "wrapProgram $out/bin/vala-language-server --prefix PATH : ${pkgs.uncrustify}/bin";
}))
];
root_markers = [".git"];
};
};
}