Class: LSP::CompletionParams

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

Overview

export interface CompletionParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams

/**
 * The completion context. This is only available it the client specifies
 * to send this using the client capability `textDocument.completion.contextSupport === true`
 */
context?: CompletionContext;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ CompletionParams

Returns a new instance of CompletionParams.



1060
1061
1062
1063
# File 'lib/lsp/lsp_protocol.rb', line 1060

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[context workDoneToken partialResultToken]
end

Instance Attribute Details

#contextObject

type: CompletionContext # type: TextDocumentIdentifier # type: Position # type: ProgressToken # type: ProgressToken



1058
1059
1060
# File 'lib/lsp/lsp_protocol.rb', line 1058

def context
  @context
end

#partialResultTokenObject

type: CompletionContext # type: TextDocumentIdentifier # type: Position # type: ProgressToken # type: ProgressToken



1058
1059
1060
# File 'lib/lsp/lsp_protocol.rb', line 1058

def partialResultToken
  @partialResultToken
end

#positionObject

type: CompletionContext # type: TextDocumentIdentifier # type: Position # type: ProgressToken # type: ProgressToken



1058
1059
1060
# File 'lib/lsp/lsp_protocol.rb', line 1058

def position
  @position
end

#textDocumentObject

type: CompletionContext # type: TextDocumentIdentifier # type: Position # type: ProgressToken # type: ProgressToken



1058
1059
1060
# File 'lib/lsp/lsp_protocol.rb', line 1058

def textDocument
  @textDocument
end

#workDoneTokenObject

type: CompletionContext # type: TextDocumentIdentifier # type: Position # type: ProgressToken # type: ProgressToken



1058
1059
1060
# File 'lib/lsp/lsp_protocol.rb', line 1058

def workDoneToken
  @workDoneToken
end

Instance Method Details

#from_h!(value) ⇒ Object



1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/lsp/lsp_protocol.rb', line 1065

def from_h!(value)
  value = {} if value.nil?
  self.context = CompletionContext.new(value['context']) unless value['context'].nil?
  self.textDocument = value['textDocument'] # Unknown type
  self.position = value['position'] # Unknown type
  self.workDoneToken = value['workDoneToken'] # Unknown type
  self.partialResultToken = value['partialResultToken'] # Unknown type
  self
end