diff --git a/mlir/utils/vscode/package.json b/mlir/utils/vscode/package.json --- a/mlir/utils/vscode/package.json +++ b/mlir/utils/vscode/package.json @@ -2,7 +2,7 @@ "name": "vscode-mlir", "displayName": "MLIR", "description": "MLIR Language Extension", - "version": "0.0.5", + "version": "0.0.6", "publisher": "llvm-vs-code-extensions", "homepage": "https://mlir.llvm.org/", "icon": "icon.png", diff --git a/mlir/utils/vscode/src/extension.ts b/mlir/utils/vscode/src/extension.ts --- a/mlir/utils/vscode/src/extension.ts +++ b/mlir/utils/vscode/src/extension.ts @@ -16,13 +16,10 @@ // Initialize the commands of the extension. context.subscriptions.push( vscode.commands.registerCommand('mlir.restart', async () => { - // Dispose and reactivate the context. This is essentially the same as - // the start of the extension, but we don't re-emit warnings for - // uninitialized settings. + // Dispose and reactivate the context. mlirContext.dispose(); - await mlirContext.activate(outputChannel, - /*warnOnEmptyServerPath=*/ false); + await mlirContext.activate(outputChannel); })); - mlirContext.activate(outputChannel, /*warnOnEmptyServerPath=*/ true); + mlirContext.activate(outputChannel); } diff --git a/mlir/utils/vscode/src/mlirContext.ts b/mlir/utils/vscode/src/mlirContext.ts --- a/mlir/utils/vscode/src/mlirContext.ts +++ b/mlir/utils/vscode/src/mlirContext.ts @@ -29,8 +29,7 @@ /** * Activate the MLIR context, and start the language clients. */ - async activate(outputChannel: vscode.OutputChannel, - warnOnEmptyServerPath: boolean) { + async activate(outputChannel: vscode.OutputChannel) { // This lambda is used to lazily start language clients for the given // document. It removes the need to pro-actively start language clients for // every folder within the workspace and every language type we provide. @@ -64,7 +63,7 @@ if (!folderContext.clients.has(document.languageId)) { let client = await this.activateWorkspaceFolder( workspaceFolder, serverSettingName, document.languageId, - outputChannel, warnOnEmptyServerPath); + outputChannel); folderContext.clients.set(document.languageId, client); } }; @@ -92,12 +91,10 @@ */ async activateWorkspaceFolder(workspaceFolder: vscode.WorkspaceFolder, serverSettingName: string, languageName: string, - outputChannel: vscode.OutputChannel, - warnOnEmptyServerPath: boolean): + outputChannel: vscode.OutputChannel): Promise { const [server, serverPath] = await this.startLanguageClient( - workspaceFolder, outputChannel, warnOnEmptyServerPath, - serverSettingName, languageName); + workspaceFolder, outputChannel, serverSettingName, languageName); // Watch for configuration changes on this folder. await configWatcher.activate(this, workspaceFolder, serverSettingName, @@ -112,7 +109,6 @@ */ async startLanguageClient(workspaceFolder: vscode.WorkspaceFolder, outputChannel: vscode.OutputChannel, - warnOnEmptyServerPath: boolean, serverSettingName: string, languageName: string): Promise<[ vscodelc.LanguageClient, string ]> { const clientTitle = languageName.toUpperCase() + ' Language Client'; @@ -122,14 +118,14 @@ var serverPath = await this.resolveServerPath(serverSettingName, workspaceFolder); - // If we aren't emitting warnings on an empty server path, and the server - // path is empty, bail. - if (!warnOnEmptyServerPath && serverPath === '') { + // If the server path is empty, bail. We don't emit errors if the user + // hasn't explicitly configured the server. + if (serverPath === '') { return [ null, serverPath ]; } // Check that the file actually exists. - if (serverPath === '' || !fs.existsSync(serverPath)) { + if (!fs.existsSync(serverPath)) { vscode.window .showErrorMessage( `${clientTitle}: Unable to resolve path for '${