mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Remove unnecessary dep
This commit is contained in:
parent
80f8e474a0
commit
1f1bda2c5a
3 changed files with 8 additions and 26 deletions
11
editors/code/package-lock.json
generated
11
editors/code/package-lock.json
generated
|
@ -112,12 +112,6 @@
|
|||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/throttle-debounce": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz",
|
||||
"integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/vscode": {
|
||||
"version": "1.42.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.42.0.tgz",
|
||||
|
@ -1517,11 +1511,6 @@
|
|||
"integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
|
||||
"dev": true
|
||||
},
|
||||
"throttle-debounce": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-2.1.0.tgz",
|
||||
"integrity": "sha512-AOvyNahXQuU7NN+VVvOOX+uW6FPaWdAOdRP5HfwYxAfCzXTFKRMoIMk+n+po318+ktcChx+F1Dd91G3YHeMKyg=="
|
||||
},
|
||||
"through": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
"dependencies": {
|
||||
"jsonc-parser": "^2.1.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"throttle-debounce": "^2.1.0",
|
||||
"vscode-languageclient": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -35,7 +34,6 @@
|
|||
"@rollup/plugin-node-resolve": "^7.1.1",
|
||||
"@types/node": "^12.12.27",
|
||||
"@types/node-fetch": "^2.5.4",
|
||||
"@types/throttle-debounce": "^2.1.0",
|
||||
"@types/vscode": "^1.42.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.20.0",
|
||||
"@typescript-eslint/parser": "^2.20.0",
|
||||
|
|
|
@ -5,7 +5,6 @@ import { strict as assert } from "assert";
|
|||
|
||||
import { ArtifactReleaseInfo } from "./interfaces";
|
||||
import { downloadFile } from "./download_file";
|
||||
import { throttle } from "throttle-debounce";
|
||||
|
||||
/**
|
||||
* Downloads artifact from given `downloadUrl`.
|
||||
|
@ -38,19 +37,15 @@ export async function downloadArtifact(
|
|||
async (progress, _cancellationToken) => {
|
||||
let lastPrecentage = 0;
|
||||
const filePermissions = 0o755; // (rwx, r_x, r_x)
|
||||
await downloadFile(downloadUrl, installationPath, filePermissions, throttle(
|
||||
200,
|
||||
/* noTrailing: */ true,
|
||||
(readBytes, totalBytes) => {
|
||||
const newPercentage = (readBytes / totalBytes) * 100;
|
||||
progress.report({
|
||||
message: newPercentage.toFixed(0) + "%",
|
||||
increment: newPercentage - lastPrecentage
|
||||
});
|
||||
await downloadFile(downloadUrl, installationPath, filePermissions, (readBytes, totalBytes) => {
|
||||
const newPercentage = (readBytes / totalBytes) * 100;
|
||||
progress.report({
|
||||
message: newPercentage.toFixed(0) + "%",
|
||||
increment: newPercentage - lastPrecentage
|
||||
});
|
||||
|
||||
lastPrecentage = newPercentage;
|
||||
})
|
||||
);
|
||||
lastPrecentage = newPercentage;
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue