ruby-lsp-rspec 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb +9 -4
- data/lib/ruby_lsp_rspec/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea19794fda048857798f87bb194d7c693da87320ba684cb7bcfb834ee7aaf124
|
4
|
+
data.tar.gz: 4daa91246afac9919461a362d0ce2f289c03f531840811ef25e8c94bb75f43b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ddbd1cb07a8856899e0587d42e565d114b2317178617c116d8b11836a5cadc79f6c14145e45c35562af4287105834d789be5dc96dcba305361f05047ee098d2
|
7
|
+
data.tar.gz: c8efb631e8d65970138c4b8d1bbe3e84afaccbc0b20c94150014afbb7c439c19fdf99117edf7ab6c320337cbe30e2dc8ac2c32fa213b1bd7ce8c1a2f362ba88b
|
@@ -50,7 +50,7 @@ module RubyLsp
|
|
50
50
|
name = generate_name(node)
|
51
51
|
add_test_code_lens(node, name: name, kind: :example)
|
52
52
|
when "context", "describe"
|
53
|
-
return
|
53
|
+
return unless valid_group?(node)
|
54
54
|
|
55
55
|
name = generate_name(node)
|
56
56
|
add_test_code_lens(node, name: name, kind: :group)
|
@@ -64,12 +64,19 @@ module RubyLsp
|
|
64
64
|
def on_call_node_leave(node)
|
65
65
|
case node.message
|
66
66
|
when "context", "describe"
|
67
|
-
return
|
67
|
+
return unless valid_group?(node)
|
68
68
|
|
69
69
|
@group_id_stack.pop
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
private
|
74
|
+
|
75
|
+
sig { params(node: Prism::CallNode).returns(T::Boolean) }
|
76
|
+
def valid_group?(node)
|
77
|
+
!(node.block.nil? || (node.receiver && node.receiver&.slice != "RSpec"))
|
78
|
+
end
|
79
|
+
|
73
80
|
sig { params(node: Prism::CallNode).returns(String) }
|
74
81
|
def generate_name(node)
|
75
82
|
arguments = node.arguments&.arguments
|
@@ -92,8 +99,6 @@ module RubyLsp
|
|
92
99
|
end
|
93
100
|
end
|
94
101
|
|
95
|
-
private
|
96
|
-
|
97
102
|
sig { params(node: Prism::Node, name: String, kind: Symbol).void }
|
98
103
|
def add_test_code_lens(node, name:, kind:)
|
99
104
|
line_number = node.location.start_line
|
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
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stan Lo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-lsp
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
67
|
+
rubygems_version: 3.5.1
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: RSpec addon for ruby-lsp
|