Skip to content

Commit cb0e270

Browse files
bors[bot]lnicola
andauthored
Merge #11106
11106: internal: Remove network access from Code extension r=lnicola a=lnicola Co-authored-by: Laurențiu Nicola <[email protected]>
2 parents 4ea1f58 + af2bbce commit cb0e270

File tree

8 files changed

+54
-667
lines changed

8 files changed

+54
-667
lines changed

PRIVACY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See the [Privacy](https://rust-analyzer.github.io/manual.html#security) section of the user manual.
1+
See the [Privacy](https://rust-analyzer.github.io/manual.html#privacy) section of the user manual.

docs/user/manual.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,12 @@ Here is a **non-exhaustive** list of ways to make rust-analyzer execute arbitrar
653653
The LSP server performs no network access in itself, but runs `cargo metadata` which will update or download the crate registry and the source code of the project dependencies.
654654
If enabled (the default), build scripts and procedural macros can do anything.
655655

656-
The Code extension automatically connects to GitHub to download updated LSP binaries and, if the nightly channel is selected, to perform update checks using the GitHub API. For `rust-analyzer` developers, using `cargo xtask release` uses the same API to put together the release notes.
656+
The Code extension does not access the network.
657657

658658
Any other editor plugins are not under the control of the `rust-analyzer` developers. For any privacy concerns, you should check with their respective developers.
659659

660+
For `rust-analyzer` developers, `cargo xtask release` uses the GitHub API to put together the release notes.
661+
660662
== Features
661663

662664
include::./generated_features.adoc[]

editors/code/package-lock.json

Lines changed: 10 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editors/code/package.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
"test": "node ./out/tests/runTests.js"
3737
},
3838
"dependencies": {
39-
"https-proxy-agent": "^5.0.0",
40-
"node-fetch": "^3.0.3",
4139
"vscode-languageclient": "8.0.0-next.2",
4240
"d3": "^7.2.0",
4341
"d3-graphviz": "^4.0.0"
@@ -305,24 +303,6 @@
305303
"default": true,
306304
"description": "Whether inlay hints font size should be smaller than editor's font size."
307305
},
308-
"rust-analyzer.updates.channel": {
309-
"type": "string",
310-
"enum": [
311-
"stable",
312-
"nightly"
313-
],
314-
"default": "stable",
315-
"markdownEnumDescriptions": [
316-
"`stable` updates are shipped weekly, they don't contain cutting-edge features from VSCode proposed APIs but have less bugs in general.",
317-
"`nightly` updates are shipped daily (extension updates automatically by downloading artifacts directly from GitHub), they contain cutting-edge features and latest bug fixes. These releases help us get your feedback very quickly and speed up rust-analyzer development **drastically**."
318-
],
319-
"markdownDescription": "Choose `nightly` updates to get the latest features and bug fixes every day. While `stable` releases occur weekly and don't contain cutting-edge features from VSCode proposed APIs."
320-
},
321-
"rust-analyzer.updates.askBeforeDownload": {
322-
"type": "boolean",
323-
"default": false,
324-
"description": "Whether to ask for permission before downloading any files from the Internet."
325-
},
326306
"rust-analyzer.server.path": {
327307
"type": [
328308
"null",

editors/code/src/config.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ const NIGHTLY_TAG = "nightly";
88

99
export type RunnableEnvCfg = undefined | Record<string, string> | { mask?: string; env: Record<string, string> }[];
1010

11-
export class ProxySettings {
12-
proxy?: string = undefined;
13-
strictSSL: boolean = true;
14-
}
15-
1611
export class Config {
1712
readonly extensionId = "matklad.rust-analyzer";
1813

@@ -24,7 +19,6 @@ export class Config {
2419
"procMacro",
2520
"files",
2621
"highlighting",
27-
"updates.channel",
2822
"lens", // works as lens.*
2923
]
3024
.map(opt => `${this.rootSection}.${opt}`);
@@ -36,11 +30,9 @@ export class Config {
3630
} = vscode.extensions.getExtension(this.extensionId)!.packageJSON;
3731

3832
readonly globalStorageUri: vscode.Uri;
39-
readonly installUri: vscode.Uri;
4033

4134
constructor(ctx: vscode.ExtensionContext) {
4235
this.globalStorageUri = ctx.globalStorageUri;
43-
this.installUri = ctx.extensionUri;
4436
vscode.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration, this, ctx.subscriptions);
4537
this.refreshLogging();
4638
}
@@ -103,21 +95,7 @@ export class Config {
10395
return this.get<null | string>("server.path") ?? this.get<null | string>("serverPath");
10496
}
10597
get serverExtraEnv() { return this.get<Env | null>("server.extraEnv") ?? {}; }
106-
get channel() { return this.get<UpdatesChannel>("updates.channel"); }
107-
get askBeforeDownload() { return this.get<boolean>("updates.askBeforeDownload"); }
10898
get traceExtension() { return this.get<boolean>("trace.extension"); }
109-
get proxySettings(): ProxySettings {
110-
const proxy = vscode
111-
.workspace
112-
.getConfiguration('http')
113-
.get<null | string>("proxy")! || process.env["https_proxy"] || process.env["HTTPS_PROXY"];
114-
const strictSSL = vscode.workspace.getConfiguration("http").get<boolean>("proxyStrictSSL") ?? true;
115-
116-
return {
117-
proxy: proxy,
118-
strictSSL: strictSSL,
119-
};
120-
}
12199

122100
get inlayHints() {
123101
return {

0 commit comments

Comments
 (0)