From 933e2b38725f29b3c13bd4e64ac4ceec33b20144 Mon Sep 17 00:00:00 2001 From: Gesa Hentschke Date: Sun, 18 Aug 2024 13:50:04 +0200 Subject: [PATCH] Support inactive regions this feature is needed for a clangd protocol extension. See this cdt-lsp issue https://github.com/eclipse-cdt/cdt-lsp/issues/299 and this clangd commit: https://reviews.llvm.org/D143974 It is needed for macro enable in the C/C++ language --- .../java/org/eclipse/lsp4j/Protocol.xtend | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend index 5e5565113..4efbe8b0f 100644 --- a/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend +++ b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend @@ -2240,6 +2240,8 @@ class TextDocumentClientCapabilities { * Since 3.17.0 */ DiagnosticCapabilities diagnostic + + InactiveRegionsCapabilities inactiveRegionsCapabilities new() { } @@ -9956,6 +9958,46 @@ class InlineValueWorkspaceCapabilities { } } +/** + * Capabilities specific to the `textDocument/inactiveRegionsCapabilities` notification. + */ +@JsonRpcData +class InactiveRegionsCapabilities { + + Boolean inactiveRegions + + new() { + } + + new(Boolean inactiveRegions) { + this.inactiveRegions = inactiveRegions + } +} + +@JsonRpcData +class InactiveRegionsParams { + /** + * The document for which inactive regions information is reported. + */ + @NonNull + TextDocumentIdentifier textDocument + + /** + * An array of ranges information items. + */ + @NonNull + List regions + + new() { + this.regions = new ArrayList + } + + new(@NonNull VersionedTextDocumentIdentifier textDocument, @NonNull List regions) { + this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument') + this.regions = Preconditions.checkNotNull(regions, 'regions') + } +} + /** * A set of predefined position encoding kinds indicating how * positions are encoded, specifically what column offsets mean.