ruby-lsp-rspec 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '069b0b51df97131fda2b2f12ae5c60b121e137264ebfed035f7598109b6736d6'
4
- data.tar.gz: ef08e13d94031ddb243085a85f24cf53ec57d67bcd32ef2feeae44c7c6e672a7
3
+ metadata.gz: 52e1c8cb1ca3e54b0f8ffc4431f2a3b9193d60e530ed2ef375768dd4dba1594c
4
+ data.tar.gz: a23b9805e5ec053fa305d193e23c84cf85f4c1835206e9c1218649c007485caa
5
5
  SHA512:
6
- metadata.gz: 9f09130b66123ed6d61f9857e7da3bcc575d5b154b53b331c77dfd0a578c46b5bb92276e53778b0148500986190da677efb2afea20804732b58e687f4933ddfa
7
- data.tar.gz: 6b33d00c07a2ec17fc3fc9c77f6efcb3fda86481b40357f32e7cb5b9f045a6928c47ec2bc0d2d0781f11de9156cc72cf881b6f06f6179d5174d0b3204387b1e5
6
+ metadata.gz: f84c03e348ed98af6c14cebb31333a5e4300e2ae90e2470ca852b4234accf9957e11e6a92e0c02fa20cbad7682f26e48ab09c8edc4482f5d324ca773d84b2c36
7
+ data.tar.gz: 4fcb8195d12d181b12ad9e1b765a99c1992e8be4508fd5c050a2e191be18e88eaf6586192636ba6cc7e8c6b3bdd6e661f41aab50385920083ae3dd1282baa80e
@@ -26,6 +26,8 @@ module RubyLsp
26
26
  ).returns(T.nilable(Listener[T::Array[Interface::CodeLens]]))
27
27
  end
28
28
  def create_code_lens_listener(uri, emitter, message_queue)
29
+ return unless uri.to_standardized_path&.end_with?("_test.rb") || uri.to_standardized_path&.end_with?("_spec.rb")
30
+
29
31
  CodeLens.new(uri, emitter, message_queue)
30
32
  end
31
33
 
@@ -17,7 +17,8 @@ module RubyLsp
17
17
  sig { params(uri: URI::Generic, dispatcher: Prism::Dispatcher, message_queue: Thread::Queue).void }
18
18
  def initialize(uri, dispatcher, message_queue)
19
19
  @_response = T.let([], ResponseType)
20
- @path = T.let(uri.to_standardized_path, T.nilable(String))
20
+ # Listener is only initialized if uri.to_standardized_path is valid
21
+ @path = T.let(T.must(uri.to_standardized_path), String)
21
22
  dispatcher.register(self, :on_call_node_enter)
22
23
 
23
24
  @base_command = T.let(
@@ -78,8 +79,6 @@ module RubyLsp
78
79
 
79
80
  sig { params(node: Prism::Node, name: String, kind: Symbol).void }
80
81
  def add_test_code_lens(node, name:, kind:)
81
- return unless @path
82
-
83
82
  line_number = node.location.start_line
84
83
  command = "#{@base_command} #{@path}:#{line_number}"
85
84
 
@@ -3,6 +3,6 @@
3
3
 
4
4
  module RubyLsp
5
5
  module RSpec
6
- VERSION = "0.1.4"
6
+ VERSION = "0.1.5"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Lo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-19 00:00:00.000000000 Z
11
+ date: 2023-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-lsp