From 19654466dbcddfe9be1601a36bde9351b51bc190 Mon Sep 17 00:00:00 2001 From: Dietrich Travkin Date: Tue, 13 Feb 2024 18:14:00 +0100 Subject: [PATCH] Add clangd extensions textDocument/symbolInfo and textDocument/ast --- .../org.eclipse.cdt.lsp/META-INF/MANIFEST.MF | 4 +- .../lsp/services/ClangdLanguageServer.java | 37 +++- .../eclipse/cdt/lsp/services/ast/AstNode.java | 167 ++++++++++++++++++ .../cdt/lsp/services/ast/AstParams.java | 100 +++++++++++ .../lsp/services/symbolinfo/RangeAndUri.java | 91 ++++++++++ .../services/symbolinfo/SymbolDetails.java | 160 +++++++++++++++++ 6 files changed, 557 insertions(+), 2 deletions(-) create mode 100644 bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/ast/AstNode.java create mode 100644 bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/ast/AstParams.java create mode 100644 bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/symbolinfo/RangeAndUri.java create mode 100644 bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/symbolinfo/SymbolDetails.java diff --git a/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF b/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF index eaef9c94..cc8e33ed 100644 --- a/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF @@ -7,7 +7,9 @@ Export-Package: org.eclipse.cdt.lsp, org.eclipse.cdt.lsp.editor, org.eclipse.cdt.lsp.server, org.eclipse.cdt.lsp.server.enable, - org.eclipse.cdt.lsp.services + org.eclipse.cdt.lsp.services, + org.eclipse.cdt.lsp.services.ast, + org.eclipse.cdt.lsp.services.symbolinfo Bundle-Activator: org.eclipse.cdt.lsp.LspPlugin Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.eclipse.ui, diff --git a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/ClangdLanguageServer.java b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/ClangdLanguageServer.java index 82b5397d..e7162154 100644 --- a/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/ClangdLanguageServer.java +++ b/bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/services/ClangdLanguageServer.java @@ -9,24 +9,32 @@ * * Contributors: * Dominic Scharfe (COSEDA Technologies GmbH) - initial implementation + * Dietrich Travkin (Solunar GmbH) - extensions for AST and symbol info *******************************************************************************/ package org.eclipse.cdt.lsp.services; import java.util.concurrent.CompletableFuture; +import org.eclipse.cdt.lsp.services.ast.AstNode; +import org.eclipse.cdt.lsp.services.ast.AstParams; +import org.eclipse.cdt.lsp.services.symbolinfo.SymbolDetails; import org.eclipse.lsp4j.TextDocumentIdentifier; +import org.eclipse.lsp4j.TextDocumentPositionParams; import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; import org.eclipse.lsp4j.services.LanguageServer; /** * Interface extending the {@link LanguageServer} with clangd extensions. + * More details about LSP usage and extension see the + * + * org.eclipse.lsp4j project's documentation. * * @see https://clangd.llvm.org/extensions */ public interface ClangdLanguageServer extends LanguageServer { /** - * The switchSourceHeader request is sent from the client to the server to + * The textDocument/switchSourceHeader request is sent from the client to the server to *