Skip to content

Commit 19c8e43

Browse files
AmaranthineCodicestomtor
authored andcommitted
[mlir] Add window.workDoneProgress LSP capability (llvm#143449)
Adds the capability flag for [server-initiated work-done progress](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#serverInitiatedProgress).
1 parent 544292d commit 19c8e43

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

mlir/include/mlir/Tools/lsp-server-support/Protocol.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ struct ClientCapabilities {
158158
/// Client supports CodeAction return value for textDocument/codeAction.
159159
/// textDocument.codeAction.codeActionLiteralSupport.
160160
bool codeActionStructure = false;
161+
162+
/// Client supports server-initiated progress via the
163+
/// window/workDoneProgress/create method.
164+
///
165+
/// window.workDoneProgress
166+
bool workDoneProgress = false;
161167
};
162168

163169
/// Add support for JSON serialization.

mlir/lib/Tools/lsp-server-support/Protocol.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ bool mlir::lsp::fromJSON(const llvm::json::Value &value,
289289
if (codeAction->getObject("codeActionLiteralSupport"))
290290
result.codeActionStructure = true;
291291
}
292+
if (auto *window = textDocument->getObject("window")) {
293+
if (std::optional<bool> workDoneProgressSupport =
294+
window->getBoolean("workDoneProgress"))
295+
result.workDoneProgress = *workDoneProgressSupport;
296+
}
292297
}
293298
return true;
294299
}

0 commit comments

Comments
 (0)