Sha256: a049fdafee11705d28533f689358a0a7ac7b211275b624ecbbf4a3510d0ec52d
Contents?: true
Size: 1.35 KB
Versions: 10
Compression:
Stored size: 1.35 KB
Contents
module Steep module Server class WorkDoneProgress attr_reader :sender, :guid, :percentage def initialize(guid, &block) @sender = block @guid = guid @percentage = 0 end def begin(title, message = nil, request_id:) sender.call( { id: request_id, method: "window/workDoneProgress/create", params: { token: guid } } ) value = { kind: "begin", cancellable: false, title: title, percentage: percentage } value[:message] = message if message sender.call( { method: "$/progress", params: { token: guid, value: value } } ) self end def report(percentage, message = nil) @percentage = percentage value = { kind: "report", percentage: percentage } value[:message] = message if message sender.call( { method: "$/progress", params: { token: guid, value: value } } ) self end def end(message = nil) value = { kind: "end" } value[:message] = message if message sender.call( { method: "$/progress", params: { token: guid, value: value } } ) self end end end end
Version data entries
10 entries across 10 versions & 1 rubygems