Class: LSP::WorkDoneProgressBegin
- Defined in:
- lib/lsp/lsp_protocol_progress.rb
Overview
export interface WorkDoneProgressBegin
kind: 'begin';
/**
* Mandatory title of the progress operation. Used to briefly inform about
* the kind of operation being performed.
*
* Examples: "Indexing" or "Linking dependencies".
*/
title: string;
/**
* Controls if a cancel button should show to allow the user to cancel the
* long running operation. Clients that don't support cancellation are allowed
* to ignore the setting.
*/
cancellable?: boolean;
/**
* Optional, more detailed associated progress message. Contains
* complementary information to the `title`.
*
* Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
* If unset, the previous progress message (if any) is still valid.
*/
message?: string;
/**
* Optional progress percentage to display (value 100 is considered 100%).
* If not provided infinite progress is assumed and clients are allowed
* to ignore the `percentage` value in subsequent in report notifications.
*
* The value should be steadily rising. Clients are free to ignore values
* that are not following this rule.
*/
percentage?: number;
Instance Attribute Summary collapse
-
#cancellable ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number.
-
#kind ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number.
-
#message ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number.
-
#percentage ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number.
-
#title ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ WorkDoneProgressBegin
constructor
A new instance of WorkDoneProgressBegin.
Methods inherited from LSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ WorkDoneProgressBegin
Returns a new instance of WorkDoneProgressBegin.
81 82 83 84 |
# File 'lib/lsp/lsp_protocol_progress.rb', line 81 def initialize(initial_hash = nil) super @optional_method_names = %i[cancellable message percentage] end |
Instance Attribute Details
#cancellable ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number
79 80 81 |
# File 'lib/lsp/lsp_protocol_progress.rb', line 79 def cancellable @cancellable end |
#kind ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number
79 80 81 |
# File 'lib/lsp/lsp_protocol_progress.rb', line 79 def kind @kind end |
#message ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number
79 80 81 |
# File 'lib/lsp/lsp_protocol_progress.rb', line 79 def @message end |
#percentage ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number
79 80 81 |
# File 'lib/lsp/lsp_protocol_progress.rb', line 79 def percentage @percentage end |
#title ⇒ Object
type: string with value ‘begin’ # type: string # type: boolean # type: string # type: number
79 80 81 |
# File 'lib/lsp/lsp_protocol_progress.rb', line 79 def title @title end |
Instance Method Details
#from_h!(value) ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/lsp/lsp_protocol_progress.rb', line 86 def from_h!(value) value = {} if value.nil? self.kind = value['kind'] # Unknown type self.title = value['title'] self.cancellable = value['cancellable'] # Unknown type self. = value['message'] self.percentage = value['percentage'] self end |