Class: LSP::CompletionContext

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_protocol.rb

Overview

export interface CompletionContext

/**
 * How the completion was triggered.
 */
triggerKind: CompletionTriggerKind;
/**
 * The trigger character (a single character) that has trigger code complete.
 * Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`
 */
triggerCharacter?: string;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ CompletionContext

Returns a new instance of CompletionContext.



1037
1038
1039
1040
# File 'lib/lsp/lsp_protocol.rb', line 1037

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[triggerCharacter]
end

Instance Attribute Details

#triggerCharacterObject

type: CompletionTriggerKind # type: string



1035
1036
1037
# File 'lib/lsp/lsp_protocol.rb', line 1035

def triggerCharacter
  @triggerCharacter
end

#triggerKindObject

type: CompletionTriggerKind # type: string



1035
1036
1037
# File 'lib/lsp/lsp_protocol.rb', line 1035

def triggerKind
  @triggerKind
end

Instance Method Details

#from_h!(value) ⇒ Object



1042
1043
1044
1045
1046
1047
# File 'lib/lsp/lsp_protocol.rb', line 1042

def from_h!(value)
  value = {} if value.nil?
  self.triggerKind = value['triggerKind'] # Unknown type
  self.triggerCharacter = value['triggerCharacter']
  self
end