vala: wrapping uncrustify

This commit is contained in:
Soliprem 2024-11-03 19:44:35 +01:00
parent f6d3a11f33
commit 8eb4f87969

View file

@ -17,10 +17,15 @@
defaultServer = "vala_ls"; defaultServer = "vala_ls";
servers = { servers = {
vala_ls = { vala_ls = {
package = pkgs.writeShellScriptBin "vala-language-server-wrapper" '' package = pkgs.symlinkJoin {
export PATH="${lib.makeBinPath [pkgs.uncrustify]}:$PATH" name = "vala-language-server-wrapper";
exec ${pkgs.vala-language-server}/bin/vala-language-server "$@" paths = [pkgs.vala-language-server];
buildInputs = [pkgs.makeBinaryWrapper];
postBuild = ''
wrapProgram $out/bin/vala-language-server \
--prefix PATH : ${pkgs.uncrustify}/bin
''; '';
};
internalFormatter = true; internalFormatter = true;
lspConfig = '' lspConfig = ''
lspconfig.vala_ls.setup { lspconfig.vala_ls.setup {
@ -29,7 +34,7 @@
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/vala-language-server-wrapper"}'' else ''{"${cfg.lsp.package}/bin/vala-language-server"}''
}, },
} }
''; '';
@ -54,7 +59,6 @@ in {
package = mkOption { package = mkOption {
description = "Vala LSP server package, or the command to run as a list of strings"; description = "Vala LSP server package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.vala-language-server]'';
type = either package (listOf str); type = either package (listOf str);
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };