Class: LSP::DocumentSymbol
Overview
export interface DocumentSymbol
/**
* 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.
*/
name: string;
/**
* More detail for this symbol, e.g the signature of a function.
*/
detail?: string;
/**
* The kind of this symbol.
*/
kind: SymbolKind;
/**
* Indicates if this symbol is deprecated.
*/
deprecated?: boolean;
/**
* 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.
*/
range: Range;
/**
* 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`.
*/
selectionRange: Range;
/**
* Children of this symbol, e.g. properties of a class.
*/
children?: DocumentSymbol[];
Instance Attribute Summary collapse
-
#children ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[].
-
#deprecated ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[].
-
#detail ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[].
-
#kind ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[].
-
#name ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[].
-
#range ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[].
-
#selectionRange ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[].
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ DocumentSymbol
constructor
A new instance of DocumentSymbol.
Methods inherited from LSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ DocumentSymbol
Returns a new instance of DocumentSymbol.
1160 1161 1162 1163 |
# File 'lib/lsp/lsp_types.rb', line 1160 def initialize(initial_hash = nil) super @optional_method_names = %i[detail deprecated children] end |
Instance Attribute Details
#children ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1158 1159 1160 |
# File 'lib/lsp/lsp_types.rb', line 1158 def children @children end |
#deprecated ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1158 1159 1160 |
# File 'lib/lsp/lsp_types.rb', line 1158 def deprecated @deprecated end |
#detail ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1158 1159 1160 |
# File 'lib/lsp/lsp_types.rb', line 1158 def detail @detail end |
#kind ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1158 1159 1160 |
# File 'lib/lsp/lsp_types.rb', line 1158 def kind @kind end |
#name ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1158 1159 1160 |
# File 'lib/lsp/lsp_types.rb', line 1158 def name @name end |
#range ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1158 1159 1160 |
# File 'lib/lsp/lsp_types.rb', line 1158 def range @range end |
#selectionRange ⇒ Object
type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1158 1159 1160 |
# File 'lib/lsp/lsp_types.rb', line 1158 def selectionRange @selectionRange end |
Instance Method Details
#from_h!(value) ⇒ Object
1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 |
# File 'lib/lsp/lsp_types.rb', line 1165 def from_h!(value) value = {} if value.nil? self.name = value['name'] self.detail = value['detail'] self.kind = value['kind'] # Unknown type self.deprecated = value['deprecated'] # Unknown type self.range = Range.new(value['range']) unless value['range'].nil? self.selectionRange = Range.new(value['selectionRange']) unless value['selectionRange'].nil? self.children = to_typed_aray(value['children'], DocumentSymbol) self end |