[Mlir-commits] [mlir] [mlir] Add window.workDoneProgress LSP capability (PR #143449)

Lily Brown llvmlistbot at llvm.org
Mon Jun 9 15:06:42 PDT 2025


https://github.com/AmaranthineCodices created https://github.com/llvm/llvm-project/pull/143449

Adds the capability flag for [server-initiated work-done progress](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#serverInitiatedProgress).

>From a9121f53a21ba977b8520d03d10069d0de3cefdb Mon Sep 17 00:00:00 2001
From: Lily Brown <lbrown at modular.com>
Date: Mon, 9 Jun 2025 15:04:47 -0700
Subject: [PATCH] [mlir] Add window.workDoneProgress LSP capability

---
 mlir/include/mlir/Tools/lsp-server-support/Protocol.h | 6 ++++++
 mlir/lib/Tools/lsp-server-support/Protocol.cpp        | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/mlir/include/mlir/Tools/lsp-server-support/Protocol.h b/mlir/include/mlir/Tools/lsp-server-support/Protocol.h
index 5d2eb01a523a7..cc06dbfedb42a 100644
--- a/mlir/include/mlir/Tools/lsp-server-support/Protocol.h
+++ b/mlir/include/mlir/Tools/lsp-server-support/Protocol.h
@@ -158,6 +158,12 @@ struct ClientCapabilities {
   /// Client supports CodeAction return value for textDocument/codeAction.
   /// textDocument.codeAction.codeActionLiteralSupport.
   bool codeActionStructure = false;
+
+  /// Client supports server-initiated progress via the
+  /// window/workDoneProgress/create method.
+  ///
+  /// window.workDoneProgress
+  bool workDoneProgress = false;
 };
 
 /// Add support for JSON serialization.
diff --git a/mlir/lib/Tools/lsp-server-support/Protocol.cpp b/mlir/lib/Tools/lsp-server-support/Protocol.cpp
index e4eb2518e079e..0054dc37b39cb 100644
--- a/mlir/lib/Tools/lsp-server-support/Protocol.cpp
+++ b/mlir/lib/Tools/lsp-server-support/Protocol.cpp
@@ -289,6 +289,11 @@ bool mlir::lsp::fromJSON(const llvm::json::Value &value,
       if (codeAction->getObject("codeActionLiteralSupport"))
         result.codeActionStructure = true;
     }
+    if (auto *window = textDocument->getObject("window")) {
+      if (std::optional<bool> workDoneProgressSupport =
+              window->getBoolean("workDoneProgress"))
+        result.workDoneProgress = *workDoneProgressSupport;
+    }
   }
   return true;
 }



More information about the Mlir-commits mailing list