Skip to content

Commit

Permalink
eclipse-lsp4jGH-252: Updated the documentation of the `textDocument/d…
Browse files Browse the repository at this point in the history
…ocumentSymbol`.

Closes eclipse-lsp4j#252.

Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta committed Nov 29, 2018
1 parent 1fc6931 commit cd829c1
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.eclipse.lsp4j.DocumentOnTypeFormattingParams;
import org.eclipse.lsp4j.DocumentRangeFormattingParams;
import org.eclipse.lsp4j.DocumentSymbol;
import org.eclipse.lsp4j.DocumentSymbolCapabilities;
import org.eclipse.lsp4j.DocumentSymbolParams;
import org.eclipse.lsp4j.FoldingRange;
import org.eclipse.lsp4j.FoldingRangeRequestParams;
Expand All @@ -49,6 +50,7 @@
import org.eclipse.lsp4j.SignatureHelp;
import org.eclipse.lsp4j.SymbolInformation;
import org.eclipse.lsp4j.TextDocumentPositionParams;
import org.eclipse.lsp4j.TextDocumentRegistrationOptions;
import org.eclipse.lsp4j.TextEdit;
import org.eclipse.lsp4j.WillSaveTextDocumentParams;
import org.eclipse.lsp4j.WorkspaceEdit;
Expand Down Expand Up @@ -172,10 +174,21 @@ default CompletableFuture<List<? extends DocumentHighlight>> documentHighlight(T
}

/**
* The document symbol request is sent from the client to the server to list
* all symbols found in a given text document.
* The document symbol request is sent from the client to the server to list all
* symbols found in a given text document.
*
* Registration Options: TextDocumentRegistrationOptions
* Registration Options: {@link TextDocumentRegistrationOptions}
*
* <p>
* <b>Caveat</b>: although the return type allows mixing the
* {@link DocumentSymbol} and {@link SymbolInformation} instances into a list do
* not do it because the clients cannot accept a heterogeneous list. A list of
* {@code DocumentSymbol} instances is only a valid return value if the
* {@link DocumentSymbolCapabilities#getHierarchicalDocumentSymbolSupport()
* textDocument.documentSymbol.hierarchicalDocumentSymbolSupport} is
* {@code true}. More details on this difference between the LSP and the LSP4J
* can be found <a href="https://github.com/eclipse/lsp4j/issues/252">here</a>.
* </p>
*/
@JsonRequest
@ResponseJsonAdapter(DocumentSymbolResponseAdapter.class)
Expand Down

0 comments on commit cd829c1

Please sign in to comment.