vscode-extensions.matklad.rust-analyzer: fix server path

This commit is contained in:
happysalada 2021-08-08 13:09:22 +09:00
parent 0f70b1bc9e
commit a687f1aef4

View file

@ -5,6 +5,7 @@
, rust-analyzer
, nodePackages
, setDefaultServerPath ? true
, moreutils
}:
let
@ -35,13 +36,12 @@ vscode-utils.buildVscodeExtension {
src = "${vsix}/${pname}.zip";
vscodeExtUniqueId = "${publisher}.${pname}";
nativeBuildInputs = lib.optional setDefaultServerPath jq;
nativeBuildInputs = lib.optionals setDefaultServerPath [ jq moreutils ];
preInstall = lib.optionalString setDefaultServerPath ''
jq '.contributes.configuration.properties."rust-analyzer.serverPath".default = $s' \
jq '.contributes.configuration.properties."rust-analyzer.server.path".default = $s' \
--arg s "${rust-analyzer}/bin/rust-analyzer" \
package.json >package.json.new
mv package.json.new package.json
package.json | sponge package.json
'';
meta = with lib; {