Class DocumentSymbol

java.lang.Object
org.graalvm.tools.lsp.server.types.JSONBase
org.graalvm.tools.lsp.server.types.DocumentSymbol

public class DocumentSymbol extends JSONBase
Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range, e.g. the range of an identifier.
  • Method Details

    • getName

      public String getName()
      The name of this symbol. Will be displayed in the user interface and therefore must not be an empty string or a string only consisting of white spaces.
    • setName

      public DocumentSymbol setName(String name)
    • getDetail

      public String getDetail()
      More detail for this symbol, e.g the signature of a function.
    • setDetail

      public DocumentSymbol setDetail(String detail)
    • getKind

      public SymbolKind getKind()
      The kind of this symbol.
    • setKind

      public DocumentSymbol setKind(SymbolKind kind)
    • getDeprecated

      public Boolean getDeprecated()
      Indicates if this symbol is deprecated.
    • setDeprecated

      public DocumentSymbol setDeprecated(Boolean deprecated)
    • getRange

      public Range getRange()
      The range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to determine if the the clients cursor is inside the symbol to reveal in the symbol in the UI.
    • setRange

      public DocumentSymbol setRange(Range range)
    • getSelectionRange

      public Range getSelectionRange()
      The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. Must be contained by the the `range`.
    • setSelectionRange

      public DocumentSymbol setSelectionRange(Range selectionRange)
    • getChildren

      public List<DocumentSymbol> getChildren()
      Children of this symbol, e.g. properties of a class.
    • setChildren

      public DocumentSymbol setChildren(List<DocumentSymbol> children)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • create

      public static DocumentSymbol create(String name, String detail, SymbolKind kind, Range range, Range selectionRange, List<DocumentSymbol> children)
      Creates a new symbol information literal.
      Parameters:
      name - The name of the symbol.
      detail - The detail of the symbol.
      kind - The kind of the symbol.
      range - The range of the symbol.
      selectionRange - The selectionRange of the symbol.
      children - Children of the symbol.