Open
Conversation
Created using jj-spr 0.1.0
Member
|
@llvm/pr-subscribers-mlir Author: Jacques Pienaar (jpienaar) ChangesFixes lvm/vscode-mlir#9 Full diff: https://github.com/llvm/llvm-project/pull/191957.diff 2 Files Affected:
diff --git a/mlir/utils/vscode/package.json b/mlir/utils/vscode/package.json
index c52da0af1b18b..93e8ac3f67a5c 100644
--- a/mlir/utils/vscode/package.json
+++ b/mlir/utils/vscode/package.json
@@ -154,6 +154,12 @@
"type": "object",
"title": "MLIR",
"properties": {
+ "mlir.enable": {
+ "scope": "resource",
+ "type": "boolean",
+ "default": true,
+ "description": "Enable the MLIR language server (mlir-lsp-server)."
+ },
"mlir.server_path": {
"scope": "resource",
"type": "string",
@@ -164,6 +170,12 @@
"type": "array",
"description": "A list of additional arguments for mlir-lsp-server executable. E.g. --log=verbose."
},
+ "mlir.pdll_enable": {
+ "scope": "resource",
+ "type": "boolean",
+ "default": true,
+ "description": "Enable the MLIR PDLL language server (mlir-pdll-lsp-server)."
+ },
"mlir.pdll_server_path": {
"scope": "resource",
"type": "string",
@@ -179,6 +191,12 @@
"type": "array",
"description": "A list of additional arguments for pdll-lsp-server executable. E.g. --log=verbose."
},
+ "mlir.tablegen_enable": {
+ "scope": "resource",
+ "type": "boolean",
+ "default": true,
+ "description": "Enable the MLIR TableGen language server (tblgen-lsp-server)."
+ },
"mlir.tablegen_server_path": {
"scope": "resource",
"type": "string",
diff --git a/mlir/utils/vscode/src/mlirContext.ts b/mlir/utils/vscode/src/mlirContext.ts
index e12aa92522d08..2738b41cb0ad6 100644
--- a/mlir/utils/vscode/src/mlirContext.ts
+++ b/mlir/utils/vscode/src/mlirContext.ts
@@ -93,6 +93,14 @@ export class MLIRContext implements vscode.Disposable {
folderContext = new WorkspaceFolderContext();
this.workspaceFolders.set(workspaceFolderStr, folderContext);
}
+
+ // Check to see if the language client should be enabled.
+ const enableSettingName =
+ (languageId === 'mlir') ? 'enable' : `${languageId}_enable`;
+ if (!config.get<boolean>(enableSettingName, workspaceFolder, true)) {
+ return null;
+ }
+
// Start the client for this language if necessary.
let client = folderContext.clients.get(languageId);
if (!client) {
@@ -194,6 +202,10 @@ export class MLIRContext implements vscode.Disposable {
workspaceFolder, outputChannel, serverSettingName, languageName,
additionalServerArgs);
configsToWatch.push(serverSettingName);
+
+ const enableSettingName =
+ (languageName === 'mlir') ? 'enable' : `${languageName}_enable`;
+ configsToWatch.push(enableSettingName);
filepathsToWatch.push(serverPath);
// Watch for configuration changes on this folder.
|
Created using jj-spr 0.1.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes llvm/vscode-mlir#9