ruby-lsp-rspec 0.1.16 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ee975e071dae85f67f651eae432c395c5e1e11ce0e49d3287a109f4b6bb4015
4
- data.tar.gz: fe19cccd32213234a643ed076809a9dda8a5e732c5df4a3f692cc8b48976dc82
3
+ metadata.gz: c3d538a0710e094d883741c214205396a1f9e5dedaa4bec86e67cddec760dfe4
4
+ data.tar.gz: d691bbbd965a24925ce5d4e0fd417f8a81b921ce53ca1980bd55beb2f0f4c1fb
5
5
  SHA512:
6
- metadata.gz: b413a288abc15b33c20447eea18e8c6825b3ec27c16e3919c9012c492062491b628952d7b3507b5067751f6ae4cba30de1baa069e087e3f6c30940c10835135b
7
- data.tar.gz: ff98f027f9d7be1a9d2db2ddde55dc5fce4039a22ce406e34afd6beeadc526bd412ed0e57343bf36a712db23d4b9aff393bf5f555918da6884d5847d7770ff30
6
+ metadata.gz: e6407d4ed11b7d5dc20d05162b5ea5305cd5653a9e8c9cee845d48f82e70a2a5df0270db38445ddf0f53d695ea6856a26ccf927243c300812cec5fb0755f8806
7
+ data.tar.gz: 2574e33ff311af3a0c160bc3dc38f9e16595a98aaea4b3a50c5f1acd83071747d3d26df62e82ee252504bcbb272d03f2ebab3a8674bcfaeeca23251f098f726d
@@ -17,7 +17,7 @@ module RubyLsp
17
17
  sig { override.params(global_state: GlobalState, message_queue: Thread::Queue).void }
18
18
  def activate(global_state, message_queue)
19
19
  @index = T.let(global_state.index, T.nilable(RubyIndexer::Index))
20
- global_state.index.register_enhancement(IndexingEnhancement.new)
20
+ global_state.index.register_enhancement(IndexingEnhancement.new(global_state.index))
21
21
  end
22
22
 
23
23
  sig { override.void }
@@ -64,6 +64,8 @@ module RubyLsp
64
64
  ).void
65
65
  end
66
66
  def create_definition_listener(response_builder, uri, node_context, dispatcher)
67
+ return unless uri.to_standardized_path&.end_with?("_test.rb") || uri.to_standardized_path&.end_with?("_spec.rb")
68
+
67
69
  Definition.new(response_builder, uri, node_context, T.must(@index), dispatcher)
68
70
  end
69
71
 
@@ -3,13 +3,11 @@
3
3
 
4
4
  module RubyLsp
5
5
  module RSpec
6
- class IndexingEnhancement
6
+ class IndexingEnhancement < RubyIndexer::Enhancement
7
7
  extend T::Sig
8
- include RubyIndexer::Enhancement
9
8
 
10
9
  sig do
11
10
  override.params(
12
- index: RubyIndexer::Index,
13
11
  owner: T.nilable(RubyIndexer::Entry::Namespace),
14
12
  node: Prism::CallNode,
15
13
  file_path: String,
@@ -19,7 +17,7 @@ module RubyLsp
19
17
  ),
20
18
  ).void
21
19
  end
22
- def on_call_node(index, owner, node, file_path, code_units_cache)
20
+ def on_call_node_enter(owner, node, file_path, code_units_cache)
23
21
  return if node.receiver
24
22
 
25
23
  name = node.name
@@ -45,7 +43,7 @@ module RubyLsp
45
43
 
46
44
  return unless method_name
47
45
 
48
- index.add(RubyIndexer::Entry::Method.new(
46
+ @index.add(RubyIndexer::Entry::Method.new(
49
47
  method_name,
50
48
  file_path,
51
49
  RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
@@ -78,7 +76,7 @@ module RubyLsp
78
76
 
79
77
  return unless method_name
80
78
 
81
- index.add(RubyIndexer::Entry::Method.new(
79
+ @index.add(RubyIndexer::Entry::Method.new(
82
80
  method_name,
83
81
  file_path,
84
82
  RubyIndexer::Location.from_prism_location(block_node.location, code_units_cache),
@@ -3,6 +3,6 @@
3
3
 
4
4
  module RubyLsp
5
5
  module RSpec
6
- VERSION = "0.1.16"
6
+ VERSION = "0.1.18"
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.16
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Lo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-19 00:00:00.000000000 Z
11
+ date: 2024-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-lsp
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.20.1
19
+ version: 0.21.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.20.1
26
+ version: 0.21.0
27
27
  description: RSpec addon for ruby-lsp
28
28
  email:
29
29
  - stan001212@gmail.com