Class: LSP::CompletionOptions

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

Overview

export interface CompletionOptions extends WorkDoneProgressOptions { /** * Most tools trigger completion request automatically without explicitly requesting * it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user * starts to type an identifier. For example if the user types c in a JavaScript file * code complete will automatically pop up present console besides others as a * completion item. Characters that make up identifiers don't need to be listed here. * * If code complete should automatically be trigger on characters not being valid inside * an identifier (for example . in JavaScript) list them in triggerCharacters. / triggerCharacters?: string; /* * The list of all possible characters that commit a completion. This field can be used * if clients don't support individual commmit characters per completion item. See * ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport * * If a server provides both allCommitCharacters and commit characters on an individual * completion item the ones on the completion item win. * * @since 3.2.0 / allCommitCharacters?: string; /* * The server provides support to resolve additional * information for a completion item. */ resolveProvider?: boolean; }

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ CompletionOptions

Returns a new instance of CompletionOptions.



1108
1109
1110
1111
# File 'lib/lsp/lsp_protocol.rb', line 1108

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[triggerCharacters allCommitCharacters resolveProvider workDoneProgress]
end

Instance Attribute Details

#allCommitCharactersObject

type: string # type: string # type: boolean # type: boolean



1106
1107
1108
# File 'lib/lsp/lsp_protocol.rb', line 1106

def allCommitCharacters
  @allCommitCharacters
end

#resolveProviderObject

type: string # type: string # type: boolean # type: boolean



1106
1107
1108
# File 'lib/lsp/lsp_protocol.rb', line 1106

def resolveProvider
  @resolveProvider
end

#triggerCharactersObject

type: string # type: string # type: boolean # type: boolean



1106
1107
1108
# File 'lib/lsp/lsp_protocol.rb', line 1106

def triggerCharacters
  @triggerCharacters
end

#workDoneProgressObject

type: string # type: string # type: boolean # type: boolean



1106
1107
1108
# File 'lib/lsp/lsp_protocol.rb', line 1106

def workDoneProgress
  @workDoneProgress
end

Instance Method Details

#from_h!(value) ⇒ Object



1113
1114
1115
1116
1117
1118
1119
1120
# File 'lib/lsp/lsp_protocol.rb', line 1113

def from_h!(value)
  value = {} if value.nil?
  self.triggerCharacters = value['triggerCharacters'].map { |val| val } unless value['triggerCharacters'].nil?
  self.allCommitCharacters = value['allCommitCharacters'].map { |val| val } unless value['allCommitCharacters'].nil?
  self.resolveProvider = value['resolveProvider'] # Unknown type
  self.workDoneProgress = value['workDoneProgress'] # Unknown type
  self
end