Class: LSP::WorkDoneProgressReport

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

Overview

export interface WorkDoneProgressReport

kind: 'report';
/**
 * Controls enablement state of a cancel button. This property is only valid if a cancel
 * button got requested in the `WorkDoneProgressStart` payload.
 *
 * Clients that don't support cancellation or don't support control the button's
 * enablement state 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

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ WorkDoneProgressReport

Returns a new instance of WorkDoneProgressReport.



128
129
130
131
# File 'lib/lsp/lsp_protocol_progress.rb', line 128

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[cancellable message percentage]
end

Instance Attribute Details

#cancellableObject

type: string with value ‘report’ # type: boolean # type: string # type: number



126
127
128
# File 'lib/lsp/lsp_protocol_progress.rb', line 126

def cancellable
  @cancellable
end

#kindObject

type: string with value ‘report’ # type: boolean # type: string # type: number



126
127
128
# File 'lib/lsp/lsp_protocol_progress.rb', line 126

def kind
  @kind
end

#messageObject

type: string with value ‘report’ # type: boolean # type: string # type: number



126
127
128
# File 'lib/lsp/lsp_protocol_progress.rb', line 126

def message
  @message
end

#percentageObject

type: string with value ‘report’ # type: boolean # type: string # type: number



126
127
128
# File 'lib/lsp/lsp_protocol_progress.rb', line 126

def percentage
  @percentage
end

Instance Method Details

#from_h!(value) ⇒ Object



133
134
135
136
137
138
139
140
# File 'lib/lsp/lsp_protocol_progress.rb', line 133

def from_h!(value)
  value = {} if value.nil?
  self.kind = value['kind'] # Unknown type
  self.cancellable = value['cancellable'] # Unknown type
  self.message = value['message']
  self.percentage = value['percentage']
  self
end