Merge pull request #133084 from happysalada/fix_vscode_rust_analyzer
This commit is contained in:
commit
820594febb
1 changed files with 11 additions and 6 deletions
|
@ -1,6 +1,11 @@
|
|||
# Update script: pkgs/development/tools/rust/rust-analyzer/update.sh
|
||||
{ lib, vscode-utils, jq, rust-analyzer, nodePackages
|
||||
{ lib
|
||||
, vscode-utils
|
||||
, jq
|
||||
, rust-analyzer
|
||||
, nodePackages
|
||||
, setDefaultServerPath ? true
|
||||
, moreutils
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -24,19 +29,19 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
in vscode-utils.buildVscodeExtension {
|
||||
in
|
||||
vscode-utils.buildVscodeExtension {
|
||||
inherit version vsix;
|
||||
name = "${pname}-${version}";
|
||||
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; {
|
||||
|
|
Loading…
Reference in a new issue