From 52045f628e0f7f2e0bebfa1acccdf39573c0812b Mon Sep 17 00:00:00 2001 From: Weston Dransfield Date: Mon, 26 May 2025 22:19:33 -0600 Subject: [PATCH 1/2] Use new addon name in addon settings documentation --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c4c1197..b98560f 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ All configuration options must be nested under the `Ruby LSP RSpec` addon within { // ... "rubyLsp.addonSettings": { - "Ruby LSP RSpec": { + "ruby-lsp-rspec": { // Configuration options go here } } @@ -87,7 +87,7 @@ Customize the command used to run tests via CodeLens. If not set, the command wi { // ... "rubyLsp.addonSettings": { - "Ruby LSP RSpec": { + "ruby-lsp-rspec": { "rspecCommand": "rspec -f d" } } @@ -107,7 +107,7 @@ Enable debug logging. Currently, this only logs the RSpec command used by CodeLe ```json { "rubyLsp.addonSettings": { - "Ruby LSP RSpec": { + "ruby-lsp-rspec": { "debug": true } } From fa000f1fd953eea647044fa09f368df1132b989e Mon Sep 17 00:00:00 2001 From: Weston Dransfield Date: Tue, 3 Jun 2025 12:38:38 -0600 Subject: [PATCH 2/2] Print spec progress when run in terminal --- lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb b/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb index f7cfa42..a6670d8 100644 --- a/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb +++ b/lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb @@ -2,22 +2,24 @@ # frozen_string_literal: true require "rspec/core/formatters" +require "rspec/core/formatters/progress_formatter" require "ruby_lsp/test_reporters/lsp_reporter" module RubyLsp module RSpec - class RSpecFormatter + class RSpecFormatter < ::RSpec::Core::Formatters::ProgressFormatter ::RSpec::Core::Formatters.register( self, :example_passed, :example_pending, :example_failed, :example_started, + :start_dump, :stop, ) def initialize(output) - @output = output + super(output) end def example_started(notification) @@ -29,6 +31,8 @@ def example_started(notification) end def example_passed(notification) + super(notification) + example = notification.example uri = uri_for(example) id = generate_id(example) @@ -36,6 +40,8 @@ def example_passed(notification) end def example_failed(notification) + super(notification) + example = notification.example uri = uri_for(example) id = generate_id(example) @@ -43,6 +49,8 @@ def example_failed(notification) end def example_pending(notification) + super(notification) + example = notification.example uri = uri_for(example) id = generate_id(example) @@ -63,4 +71,4 @@ def generate_id(example) end end end -end +end \ No newline at end of file