Class: LSP::FoldingRange

Inherits:
LSPBase show all
Defined in:
lib/lsp/lsp_types.rb,
lib/lsp/lsp_protocol_foldingrange.rb

Overview

export interface FoldingRange

/**
 * The zero-based line number from where the folded range starts.
 */
startLine: number;
/**
 * The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
 */
startCharacter?: number;
/**
 * The zero-based line number where the folded range ends.
 */
endLine: number;
/**
 * The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
 */
endCharacter?: number;
/**
 * Describes the kind of the folding range such as `comment' or 'region'. The kind
 * is used to categorize folding ranges and used by commands like 'Fold all comments'. See
 * [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
 */
kind?: string;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ FoldingRange

Returns a new instance of FoldingRange.



233
234
235
236
# File 'lib/lsp/lsp_types.rb', line 233

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[startCharacter endCharacter kind]
end

Instance Attribute Details

#endCharacterObject

type: number # type: number # type: number # type: number # type: string



231
232
233
# File 'lib/lsp/lsp_types.rb', line 231

def endCharacter
  @endCharacter
end

#endLineObject

type: number # type: number # type: number # type: number # type: string



231
232
233
# File 'lib/lsp/lsp_types.rb', line 231

def endLine
  @endLine
end

#kindObject

type: number # type: number # type: number # type: number # type: string



231
232
233
# File 'lib/lsp/lsp_types.rb', line 231

def kind
  @kind
end

#startCharacterObject

type: number # type: number # type: number # type: number # type: string



231
232
233
# File 'lib/lsp/lsp_types.rb', line 231

def startCharacter
  @startCharacter
end

#startLineObject

type: number # type: number # type: number # type: number # type: string



231
232
233
# File 'lib/lsp/lsp_types.rb', line 231

def startLine
  @startLine
end

Instance Method Details

#from_h!(value) ⇒ Object



238
239
240
241
242
243
244
245
246
# File 'lib/lsp/lsp_types.rb', line 238

def from_h!(value)
  value = {} if value.nil?
  self.startLine = value['startLine']
  self.startCharacter = value['startCharacter']
  self.endLine = value['endLine']
  self.endCharacter = value['endCharacter']
  self.kind = value['kind']
  self
end