[Mlir-commits] [mlir] [vscode-mlir] Added per-LSP-server executable arguments (PR #79671)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Mar 19 09:41:54 PDT 2024


https://github.com/jjalowie updated https://github.com/llvm/llvm-project/pull/79671

>From a82dd7cc1be467cdb8e583e2d393e32669b3a61c Mon Sep 17 00:00:00 2001
From: Kuba Jalowiec <jakub.jalowiec at intel.com>
Date: Sat, 27 Jan 2024 01:49:26 +0000
Subject: [PATCH 1/2] [vscode-mlir] Added per-LSP-server executable arguments

---
 mlir/utils/vscode/package.json       | 19 +++++++++++++++++--
 mlir/utils/vscode/src/mlirContext.ts |  5 +++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/mlir/utils/vscode/package.json b/mlir/utils/vscode/package.json
index bd550e2b6e61e2..6d0f6f5c88adb8 100644
--- 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.11",
+  "version": "0.0.12",
   "publisher": "llvm-vs-code-extensions",
   "homepage": "https://mlir.llvm.org/",
   "icon": "icon.png",
@@ -47,7 +47,7 @@
     "@types/vscode": "~1.67.0",
     "@vscode/vsce": "^2.19.0",
     "clang-format": "^1.8.0",
-    "typescript": "^4.6.4",
+    "typescript": "^4.9.5",
     "vscode-test": "^1.3.0"
   },
   "repository": {
@@ -155,6 +155,11 @@
           "type": "string",
           "description": "The file path of the mlir-lsp-server executable."
         },
+        "mlir.mlir_additional_server_args": {
+          "scope": "resource",
+          "type": "array",
+          "description": "A list of additional arguments for mlir-lsp-server executable. E.g. --log=verbose."
+        },
         "mlir.pdll_server_path": {
           "scope": "resource",
           "type": "string",
@@ -165,6 +170,11 @@
           "type": "array",
           "description": "A list of `pdll_compile_commands.yml` database files containing information about .pdll files processed by the server."
         },
+        "mlir.pdll_additional_server_args": {
+          "scope": "resource",
+          "type": "array",
+          "description": "A list of additional arguments for pdll-lsp-server executable. E.g. --log=verbose."
+        },
         "mlir.tablegen_server_path": {
           "scope": "resource",
           "type": "string",
@@ -175,6 +185,11 @@
           "type": "array",
           "description": "A list of `tablegen_compile_commands.yml` database files containing information about .td files processed by the server."
         },
+        "mlir.tablegen_additional_server_args": {
+          "scope": "resource",
+          "type": "array",
+          "description": "A list of additional arguments for tblgen-lsp-server executable. E.g. --log=verbose."
+        },
         "mlir.onSettingsChanged": {
           "type": "string",
           "default": "prompt",
diff --git a/mlir/utils/vscode/src/mlirContext.ts b/mlir/utils/vscode/src/mlirContext.ts
index c7b6de6322d27f..adfca60c446a02 100644
--- a/mlir/utils/vscode/src/mlirContext.ts
+++ b/mlir/utils/vscode/src/mlirContext.ts
@@ -179,14 +179,19 @@ export class MLIRContext implements vscode.Disposable {
 
     // Initialize additional configurations for this server.
     if (languageName === 'pdll') {
+      additionalServerArgs = config.get<string[]>("pdll_additional_server_args", null, []);
       await this.preparePDLLServerOptions(workspaceFolder, configsToWatch,
                                           filepathsToWatch,
                                           additionalServerArgs);
     } else if (languageName == 'tablegen') {
+      additionalServerArgs = config.get<string[]>("table_additional_server_args", null, []);
       await this.prepareTableGenServerOptions(workspaceFolder, configsToWatch,
                                               filepathsToWatch,
                                               additionalServerArgs);
     }
+     else {
+      additionalServerArgs = config.get<string[]>("mlir_additional_server_args", null, []);
+     }
 
     // Try to activate the language client.
     const [server, serverPath] = await this.startLanguageClient(

>From fe3d7e5f8f1a0821a98199430ebaa572bf59289a Mon Sep 17 00:00:00 2001
From: Kuba Jalowiec <jakub.jalowiec at intel.com>
Date: Tue, 19 Mar 2024 16:41:41 +0000
Subject: [PATCH 2/2] [vscode-mlir] Refactored additional server argument
 initialization

---
 mlir/utils/vscode/src/mlirContext.ts | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mlir/utils/vscode/src/mlirContext.ts b/mlir/utils/vscode/src/mlirContext.ts
index adfca60c446a02..e12aa92522d083 100644
--- a/mlir/utils/vscode/src/mlirContext.ts
+++ b/mlir/utils/vscode/src/mlirContext.ts
@@ -176,22 +176,18 @@ export class MLIRContext implements vscode.Disposable {
     let configsToWatch: string[] = [];
     let filepathsToWatch: string[] = [];
     let additionalServerArgs: string[] = [];
+    additionalServerArgs = config.get<string[]>(languageName + "_additional_server_args", null, []);
 
     // Initialize additional configurations for this server.
     if (languageName === 'pdll') {
-      additionalServerArgs = config.get<string[]>("pdll_additional_server_args", null, []);
       await this.preparePDLLServerOptions(workspaceFolder, configsToWatch,
                                           filepathsToWatch,
                                           additionalServerArgs);
     } else if (languageName == 'tablegen') {
-      additionalServerArgs = config.get<string[]>("table_additional_server_args", null, []);
       await this.prepareTableGenServerOptions(workspaceFolder, configsToWatch,
                                               filepathsToWatch,
                                               additionalServerArgs);
     }
-     else {
-      additionalServerArgs = config.get<string[]>("mlir_additional_server_args", null, []);
-     }
 
     // Try to activate the language client.
     const [server, serverPath] = await this.startLanguageClient(



More information about the Mlir-commits mailing list