Record Class LspSymbol
java.lang.Object
java.lang.Record
smile.util.lsp.LspSymbol
- Record Components:
name- the symbol name.kind- the LSP symbol kind integer (1 = File, 2 = Module, 3 = Namespace, 5 = Class, 6 = Method, 7 = Property, 8 = Field, 12 = Function, 13 = Variable, etc.).containerName- the name of the containing symbol, ornull.uri- the document URI that contains this symbol.startLine- the 1-based start line.startCharacter- the 1-based start character offset.endLine- the 1-based end line.endCharacter- the 1-based end character offset.
public record LspSymbol(String name, int kind, String containerName, String uri, int startLine, int startCharacter, int endLine, int endCharacter)
extends Record
Represents a named symbol (class, method, field, variable, …) inside a
document or workspace, as returned by the
documentSymbol and
workspaceSymbol operations.
All position values are 1-based (as shown in editors).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontainerNamerecord component.intReturns the value of theendCharacterrecord component.intendLine()Returns the value of theendLinerecord component.final booleanIndicates whether some other object is "equal to" this one.static LspSymbolfromDocumentSymbol(org.eclipse.lsp4j.DocumentSymbol ds, String uri) Creates anLspSymbolfrom an LSP4JDocumentSymboland its parent document URI.static LspSymbolfromSymbolInformation(org.eclipse.lsp4j.SymbolInformation si) Creates anLspSymbolfrom an LSP4JSymbolInformation.final inthashCode()Returns a hash code value for this object.intkind()Returns the value of thekindrecord component.static StringkindName(int kind) Returns a human-readable name for the given LSP symbol kind integer.location()Returns the location of this symbol.name()Returns the value of thenamerecord component.intReturns the value of thestartCharacterrecord component.intReturns the value of thestartLinerecord component.toString()Returns a string representation of this record class.uri()Returns the value of theurirecord component.
-
Constructor Details
-
LspSymbol
public LspSymbol(String name, int kind, String containerName, String uri, int startLine, int startCharacter, int endLine, int endCharacter) Creates an instance of aLspSymbolrecord class.- Parameters:
name- the value for thenamerecord componentkind- the value for thekindrecord componentcontainerName- the value for thecontainerNamerecord componenturi- the value for theurirecord componentstartLine- the value for thestartLinerecord componentstartCharacter- the value for thestartCharacterrecord componentendLine- the value for theendLinerecord componentendCharacter- the value for theendCharacterrecord component
-
-
Method Details
-
fromSymbolInformation
Creates anLspSymbolfrom an LSP4JSymbolInformation.- Parameters:
si- the LSP4J symbol information.- Returns:
- the equivalent editor-friendly symbol.
-
fromDocumentSymbol
Creates anLspSymbolfrom an LSP4JDocumentSymboland its parent document URI.- Parameters:
ds- the LSP4J document symbol.uri- the document URI that contains this symbol.- Returns:
- the equivalent editor-friendly symbol.
-
location
-
kindName
Returns a human-readable name for the given LSP symbol kind integer.- Parameters:
kind- the LSP symbol kind value.- Returns:
- a short descriptive string.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
kind
-
containerName
Returns the value of thecontainerNamerecord component.- Returns:
- the value of the
containerNamerecord component
-
uri
-
startLine
-
startCharacter
public int startCharacter()Returns the value of thestartCharacterrecord component.- Returns:
- the value of the
startCharacterrecord component
-
endLine
-
endCharacter
public int endCharacter()Returns the value of theendCharacterrecord component.- Returns:
- the value of the
endCharacterrecord component
-