Class: LanguageServer::Protocol::Interface::CompletionOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/completion_options.rb

Overview

Completion options.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resolve_provider: nil, trigger_characters: nil) ⇒ CompletionOptions

Returns a new instance of CompletionOptions.



8
9
10
11
12
13
14
15
# File 'lib/language_server/protocol/interface/completion_options.rb', line 8

def initialize(resolve_provider: nil, trigger_characters: nil)
  @attributes = {}

  @attributes[:resolveProvider] = resolve_provider if resolve_provider
  @attributes[:triggerCharacters] = trigger_characters if trigger_characters

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



34
35
36
# File 'lib/language_server/protocol/interface/completion_options.rb', line 34

def attributes
  @attributes
end

Instance Method Details

#resolve_providerboolean

The server provides support to resolve additional information for a completion item.

Returns:

  • (boolean)


22
23
24
# File 'lib/language_server/protocol/interface/completion_options.rb', line 22

def resolve_provider
  attributes.fetch(:resolveProvider)
end

#to_hashObject



36
37
38
# File 'lib/language_server/protocol/interface/completion_options.rb', line 36

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



40
41
42
# File 'lib/language_server/protocol/interface/completion_options.rb', line 40

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

#trigger_charactersstring[]

The characters that trigger completion automatically.

Returns:

  • (string[])


30
31
32
# File 'lib/language_server/protocol/interface/completion_options.rb', line 30

def trigger_characters
  attributes.fetch(:triggerCharacters)
end