[Mlir-commits] [mlir] [mlir] Add window.workDoneProgress LSP capability (PR #143449)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 9 15:07:11 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Lily Brown (AmaranthineCodices)
<details>
<summary>Changes</summary>
Adds the capability flag for [server-initiated work-done progress](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#serverInitiatedProgress).
---
Full diff: https://github.com/llvm/llvm-project/pull/143449.diff
2 Files Affected:
- (modified) mlir/include/mlir/Tools/lsp-server-support/Protocol.h (+6)
- (modified) mlir/lib/Tools/lsp-server-support/Protocol.cpp (+5)
``````````diff
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;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/143449
More information about the Mlir-commits
mailing list