[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).
This commit is contained in:
Lily Brown
2025-06-09 15:46:36 -07:00
committed by GitHub
parent 4e6896244f
commit c9cf5c26d8
2 changed files with 11 additions and 0 deletions

View File

@@ -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.

View File

@@ -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;
}