aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/config.ts
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-03-07 22:01:48 +0000
committerVeetaha <[email protected]>2020-03-07 22:01:48 +0000
commitc29a502e2549aba7e47a6f40581e5ccf74b5f481 (patch)
tree72e84436a18794f40ffc93757d4c29075f9c3de8 /editors/code/src/config.ts
parent9dae94a78dd5b660dd97f884b91067c55b4a418e (diff)
vscode: care about alwaysDownloadServer option before asking
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
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..c4acb632d 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("alwaysDownloadServer") as boolean),
137 repo: { 138 repo: {
138 name: "rust-analyzer", 139 name: "rust-analyzer",
139 owner: "rust-analyzer", 140 owner: "rust-analyzer",