Record Class CallHierarchyItem

java.lang.Object
java.lang.Record
smile.util.lsp.CallHierarchyItem
Record Components:
name - the symbol name.
kind - the LSP symbol kind integer.
detail - optional detail string (e.g. the signature or container).
uri - the document URI that defines this symbol.
startLine - the 1-based start line of the symbol's name range.
startCharacter - the 1-based start character of the symbol's name range.
endLine - the 1-based end line of the symbol's name range.
endCharacter - the 1-based end character of the symbol's name range.

public record CallHierarchyItem(String name, int kind, String detail, String uri, int startLine, int startCharacter, int endLine, int endCharacter) extends Record
Represents a single item in a call hierarchy — a named function or method that can serve as the focus of LanguageService.incomingCalls(smile.util.lsp.CallHierarchyItem) or LanguageService.outgoingCalls(smile.util.lsp.CallHierarchyItem) queries.

All position values are 1-based (as shown in editors).

  • Constructor Summary

    Constructors
    Constructor
    Description
    CallHierarchyItem(String name, int kind, String detail, String uri, int startLine, int startCharacter, int endLine, int endCharacter)
    Creates an instance of a CallHierarchyItem record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the detail record component.
    int
    Returns the value of the endCharacter record component.
    int
    Returns the value of the endLine record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    fromProtocol(org.eclipse.lsp4j.CallHierarchyItem item)
    Creates a CallHierarchyItem from an LSP4J CallHierarchyItem.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the kind record component.
    Returns the location of this item's name range.
    Returns the value of the name record component.
    int
    Returns the value of the startCharacter record component.
    int
    Returns the value of the startLine record component.
    org.eclipse.lsp4j.CallHierarchyItem
    Converts this item back to an LSP4J CallHierarchyItem for use in follow-up callHierarchy/incomingCalls or callHierarchy/outgoingCalls requests.
    Returns a string representation of this record class.
    uri()
    Returns the value of the uri record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CallHierarchyItem

      public CallHierarchyItem(String name, int kind, String detail, String uri, int startLine, int startCharacter, int endLine, int endCharacter)
      Creates an instance of a CallHierarchyItem record class.
      Parameters:
      name - the value for the name record component
      kind - the value for the kind record component
      detail - the value for the detail record component
      uri - the value for the uri record component
      startLine - the value for the startLine record component
      startCharacter - the value for the startCharacter record component
      endLine - the value for the endLine record component
      endCharacter - the value for the endCharacter record component
  • Method Details

    • fromProtocol

      public static CallHierarchyItem fromProtocol(org.eclipse.lsp4j.CallHierarchyItem item)
      Creates a CallHierarchyItem from an LSP4J CallHierarchyItem.
      Parameters:
      item - the LSP4J call hierarchy item.
      Returns:
      the equivalent editor-friendly item.
    • toProtocol

      public org.eclipse.lsp4j.CallHierarchyItem toProtocol()
      Converts this item back to an LSP4J CallHierarchyItem for use in follow-up callHierarchy/incomingCalls or callHierarchy/outgoingCalls requests.
      Returns:
      the LSP4J call hierarchy item with 0-based coordinates.
    • location

      public LspLocation location()
      Returns the location of this item's name range.
      Returns:
      the LspLocation.
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • kind

      public int kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • detail

      public String detail()
      Returns the value of the detail record component.
      Returns:
      the value of the detail record component
    • uri

      public String uri()
      Returns the value of the uri record component.
      Returns:
      the value of the uri record component
    • startLine

      public int startLine()
      Returns the value of the startLine record component.
      Returns:
      the value of the startLine record component
    • startCharacter

      public int startCharacter()
      Returns the value of the startCharacter record component.
      Returns:
      the value of the startCharacter record component
    • endLine

      public int endLine()
      Returns the value of the endLine record component.
      Returns:
      the value of the endLine record component
    • endCharacter

      public int endCharacter()
      Returns the value of the endCharacter record component.
      Returns:
      the value of the endCharacter record component