Class: LanguageServer::Protocol::Interface::SignatureHelpParams

Inherits:
WorkDoneProgressParams show all
Defined in:
lib/language_server/protocol/interface/signature_help_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from WorkDoneProgressParams

#work_done_token

Constructor Details

#initialize(work_done_token: nil, context: nil) ⇒ SignatureHelpParams



5
6
7
8
9
10
11
12
# File 'lib/language_server/protocol/interface/signature_help_params.rb', line 5

def initialize(work_done_token: nil, context: nil)
  @attributes = {}

  @attributes[:workDoneToken] = work_done_token if work_done_token
  @attributes[:context] = context if context

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



23
24
25
# File 'lib/language_server/protocol/interface/signature_help_params.rb', line 23

def attributes
  @attributes
end

Instance Method Details

#contextSignatureHelpContext

The signature help context. This is only available if the client specifies to send this using the client capability ‘textDocument.signatureHelp.contextSupport === true`



19
20
21
# File 'lib/language_server/protocol/interface/signature_help_params.rb', line 19

def context
  attributes.fetch(:context)
end

#to_hashObject



25
26
27
# File 'lib/language_server/protocol/interface/signature_help_params.rb', line 25

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



29
30
31
# File 'lib/language_server/protocol/interface/signature_help_params.rb', line 29

def to_json(*args)
  to_hash.to_json(*args)
end