Class: LanguageServer::Protocol::Interface::CompletionParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::CompletionParams
- Defined in:
- lib/language_server/protocol/interface/completion_params.rb
Overview
Completion parameters
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#context ⇒ CompletionContext | nil
The completion context.
-
#initialize(context: nil, text_document:, position:, work_done_token: nil, partial_result_token: nil) ⇒ CompletionParams
constructor
A new instance of CompletionParams.
-
#partial_result_token ⇒ ProgressToken | nil
An optional token that a server can use to report partial results (e.g. streaming) to the client.
-
#position ⇒ Position
The position inside the text document.
-
#text_document ⇒ TextDocumentIdentifier
The text document.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
Constructor Details
#initialize(context: nil, text_document:, position:, work_done_token: nil, partial_result_token: nil) ⇒ CompletionParams
Returns a new instance of CompletionParams.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 8 def initialize(context: nil, text_document:, position:, work_done_token: nil, partial_result_token: nil) @attributes = {} @attributes[:context] = context if context @attributes[:textDocument] = text_document @attributes[:position] = position @attributes[:workDoneToken] = work_done_token if work_done_token @attributes[:partialResultToken] = partial_result_token if partial_result_token @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
62 63 64 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 62 def attributes @attributes end |
Instance Method Details
#context ⇒ CompletionContext | nil
The completion context. This is only available it the client specifies to send this using the client capability ‘textDocument.completion.contextSupport === true`
25 26 27 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 25 def context attributes.fetch(:context) end |
#partial_result_token ⇒ ProgressToken | nil
An optional token that a server can use to report partial results (e.g. streaming) to the client.
58 59 60 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 58 def partial_result_token attributes.fetch(:partialResultToken) end |
#position ⇒ Position
The position inside the text document.
41 42 43 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 41 def position attributes.fetch(:position) end |
#text_document ⇒ TextDocumentIdentifier
The text document.
33 34 35 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 33 def text_document attributes.fetch(:textDocument) end |
#to_hash ⇒ Object
64 65 66 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 64 def to_hash attributes end |
#to_json(*args) ⇒ Object
68 69 70 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 68 def to_json(*args) to_hash.to_json(*args) end |
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
49 50 51 |
# File 'lib/language_server/protocol/interface/completion_params.rb', line 49 def work_done_token attributes.fetch(:workDoneToken) end |