Class: LanguageServer::Protocol::Interface::CompletionClientCapabilities

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dynamic_registration: nil, completion_item: nil, completion_item_kind: nil, context_support: nil, insert_text_mode: nil, completion_list: nil) ⇒ CompletionClientCapabilities

Returns a new instance of CompletionClientCapabilities.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 5

def initialize(dynamic_registration: nil, completion_item: nil, completion_item_kind: nil, context_support: nil, insert_text_mode: nil, completion_list: nil)
  @attributes = {}

  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
  @attributes[:completionItem] = completion_item if completion_item
  @attributes[:completionItemKind] = completion_item_kind if completion_item_kind
  @attributes[:contextSupport] = context_support if context_support
  @attributes[:insertTextMode] = insert_text_mode if insert_text_mode
  @attributes[:completionList] = completion_list if completion_list

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



67
68
69
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 67

def attributes
  @attributes
end

Instance Method Details

#completion_item{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]; deprecatedSupport?: boolean; preselectSupport?: boolean; tagSupport?: { valueSet: 1[]; }; insertReplaceSupport?: boolean; resolveSupport?: { ...; }; insertTextModeSupport?: { ...; }; labelDetailsSupport?: boolean; }

The client supports the following ‘CompletionItem` specific capabilities.

Returns:

  • ({ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]; deprecatedSupport?: boolean; preselectSupport?: boolean; tagSupport?: { valueSet: 1[]; }; insertReplaceSupport?: boolean; resolveSupport?: { ...; }; insertTextModeSupport?: { ...; }; labelDetailsSupport?: boolean; })


31
32
33
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 31

def completion_item
  attributes.fetch(:completionItem)
end

#completion_item_kind{ valueSet?: CompletionItemKind[]; }

Returns:

  • ({ valueSet?: CompletionItemKind[]; })


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

def completion_item_kind
  attributes.fetch(:completionItemKind)
end

#completion_list{ itemDefaults?: string[]; }

The client supports the following ‘CompletionList` specific capabilities.

Returns:

  • ({ itemDefaults?: string[]; })


63
64
65
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 63

def completion_list
  attributes.fetch(:completionList)
end

#context_supportboolean

The client supports to send additional context information for a ‘textDocument/completion` request.

Returns:

  • (boolean)


45
46
47
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 45

def context_support
  attributes.fetch(:contextSupport)
end

#dynamic_registrationboolean

Whether completion supports dynamic registration.

Returns:

  • (boolean)


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

def dynamic_registration
  attributes.fetch(:dynamicRegistration)
end

#insert_text_modeInsertTextMode

The client’s default when the completion item doesn’t provide a ‘insertTextMode` property.

Returns:

  • (InsertTextMode)


54
55
56
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 54

def insert_text_mode
  attributes.fetch(:insertTextMode)
end

#to_hashObject



69
70
71
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 69

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



73
74
75
# File 'lib/language_server/protocol/interface/completion_client_capabilities.rb', line 73

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