vscode: fix local devel

The value of releaseTag is not undefined, but null in actual package.json
This commit is contained in:
veetaha 2020-03-25 20:56:48 +02:00
parent 3d38d4dc94
commit 68ff71e3ab
2 changed files with 7 additions and 5 deletions

View file

@ -21,7 +21,7 @@ export class Config {
readonly package: { readonly package: {
version: string; version: string;
releaseTag: string | undefined; releaseTag: string | null;
enableProposedApi: boolean | undefined; enableProposedApi: boolean | undefined;
} = vscode.extensions.getExtension(this.extensionId)!.packageJSON; } = vscode.extensions.getExtension(this.extensionId)!.packageJSON;

View file

@ -110,11 +110,13 @@ async function bootstrap(config: Config, state: PersistentState): Promise<string
} }
async function bootstrapExtension(config: Config, state: PersistentState): Promise<void> { async function bootstrapExtension(config: Config, state: PersistentState): Promise<void> {
if (config.package.releaseTag === undefined) return; if (config.package.releaseTag === null) return;
if (config.channel === "stable") { if (config.channel === "stable") {
if (config.package.releaseTag === NIGHTLY_TAG) { if (config.package.releaseTag === NIGHTLY_TAG) {
vscode.window.showWarningMessage(`You are running a nightly version of rust-analyzer extension. void vscode.window.showWarningMessage(
To switch to stable, uninstall the extension and re-install it from the marketplace`); `You are running a nightly version of rust-analyzer extension. ` +
`To switch to stable, uninstall the extension and re-install it from the marketplace`
);
} }
return; return;
}; };
@ -185,7 +187,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string
} }
return explicitPath; return explicitPath;
}; };
if (config.package.releaseTag === undefined) return "rust-analyzer"; if (config.package.releaseTag === null) return "rust-analyzer";
let binaryName: string | undefined = undefined; let binaryName: string | undefined = undefined;
if (process.arch === "x64" || process.arch === "ia32") { if (process.arch === "x64" || process.arch === "ia32") {