aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/config.ts
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-09 09:05:45 +0000
committerGitHub <[email protected]>2020-03-09 09:05:45 +0000
commitfcaab594518bb097e207e94453cfe11ef5413c39 (patch)
tree83a8d0f856feb789047a2af2b60d342d98084a81 /editors/code/src/config.ts
parentbeb4f4954179998e317db33e47a48a9bb7374977 (diff)
parentce65cc949f9e183c7c166212b4f3d7d4abd102b0 (diff)
Merge #3514
3514: vscode: askBeforeDownload option r=matklad a=Veetaha This is a small step towards #3402, also implements my proposal stated in #3403 Also renamed `BinarySource` to `ArtifactSource` in anticipation of nightlies installation that requires downloading not a binary itself but `.vsix` package, thus generalized to `artifact` term. @matklad @lnicola Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r--editors/code/src/config.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index bf915102c..b72206d3c 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -1,6 +1,6 @@
1import * as os from "os"; 1import * as os from "os";
2import * as vscode from 'vscode'; 2import * as vscode from 'vscode';
3import { BinarySource } from "./installation/interfaces"; 3import { ArtifactSource } from "./installation/interfaces";
4import { log } from "./util"; 4import { log } from "./util";
5 5
6const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; 6const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG;
@@ -114,12 +114,12 @@ export class Config {
114 } 114 }
115 } 115 }
116 116
117 get serverSource(): null | BinarySource { 117 get serverSource(): null | ArtifactSource {
118 const serverPath = RA_LSP_DEBUG ?? this.cfg.get<null | string>("serverPath"); 118 const serverPath = RA_LSP_DEBUG ?? this.cfg.get<null | string>("serverPath");
119 119
120 if (serverPath) { 120 if (serverPath) {
121 return { 121 return {
122 type: BinarySource.Type.ExplicitPath, 122 type: ArtifactSource.Type.ExplicitPath,
123 path: Config.replaceTildeWithHomeDir(serverPath) 123 path: Config.replaceTildeWithHomeDir(serverPath)
124 }; 124 };
125 } 125 }
@@ -129,11 +129,12 @@ export class Config {
129 if (!prebuiltBinaryName) return null; 129 if (!prebuiltBinaryName) return null;
130 130
131 return { 131 return {
132 type: BinarySource.Type.GithubRelease, 132 type: ArtifactSource.Type.GithubRelease,
133 dir: this.ctx.globalStoragePath, 133 dir: this.ctx.globalStoragePath,
134 file: prebuiltBinaryName, 134 file: prebuiltBinaryName,
135 storage: this.ctx.globalState, 135 storage: this.ctx.globalState,
136 version: Config.extensionVersion, 136 tag: Config.extensionVersion,
137 askBeforeDownload: this.cfg.get("updates.askBeforeDownload") as boolean,
137 repo: { 138 repo: {
138 name: "rust-analyzer", 139 name: "rust-analyzer",
139 owner: "rust-analyzer", 140 owner: "rust-analyzer",