[Mlir-commits] [mlir] c9cf5c2 - [mlir] Add window.workDoneProgress LSP capability (#143449)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 9 15:46:39 PDT 2025
Author: Lily Brown
Date: 2025-06-09T18:46:36-04:00
New Revision: c9cf5c26d8d71bf58cb7ae759a615b6de1074e53
URL: https://github.com/llvm/llvm-project/commit/c9cf5c26d8d71bf58cb7ae759a615b6de1074e53
DIFF: https://github.com/llvm/llvm-project/commit/c9cf5c26d8d71bf58cb7ae759a615b6de1074e53.diff
LOG: [mlir] Add window.workDoneProgress LSP capability (#143449)
Adds the capability flag for [server-initiated work-done
progress](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#serverInitiatedProgress).
Added:
Modified:
mlir/include/mlir/Tools/lsp-server-support/Protocol.h
mlir/lib/Tools/lsp-server-support/Protocol.cpp
Removed:
################################################################################
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