Class: RubyLsp::Rails::Common::Progress
- Inherits:
-
Object
- Object
- RubyLsp::Rails::Common::Progress
- Defined in:
- lib/ruby_lsp/ruby_lsp_rails/server.rb
Instance Method Summary collapse
-
#initialize(stderr, id, supports_progress) ⇒ Progress
constructor
: (IO | StringIO, String, bool) -> void.
-
#report(percentage: nil, message: nil) ⇒ Object
: (?percentage: Integer?, ?message: String?) -> void.
Constructor Details
#initialize(stderr, id, supports_progress) ⇒ Progress
: (IO | StringIO, String, bool) -> void
14 15 16 17 18 |
# File 'lib/ruby_lsp/ruby_lsp_rails/server.rb', line 14 def initialize(stderr, id, supports_progress) @stderr = stderr @id = id @supports_progress = supports_progress end |
Instance Method Details
#report(percentage: nil, message: nil) ⇒ Object
: (?percentage: Integer?, ?message: String?) -> void
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ruby_lsp/ruby_lsp_rails/server.rb', line 21 def report(percentage: nil, message: nil) return unless @supports_progress return unless percentage || = { method: "$/progress", params: { token: @id, value: { kind: "report", percentage: percentage, message: , }, }, }.to_json @stderr.write("Content-Length: #{.bytesize}\r\n\r\n#{}") end |