ruby-lsp-rspec 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +5 -3
- data/lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb +18 -2
- data/lib/ruby_lsp_rspec/version.rb +1 -1
- data/misc/example.gif +0 -0
- metadata +3 -3
- data/misc/example.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74150c02942b6d08897dfd6a7f71ffe940c5188a9859d16f8955046ba3a4e3b0
|
4
|
+
data.tar.gz: 1c2971333a4f29057b52da192da119bc0c4aada607e215c2dc9b21ae0bb0c4e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1adba0097a7596eba873dd0e5d664817b59c8c34dc6952acc9355907a87d232952447a7573e3d6462f2134a65ed38f667a14e19ea0dd231f66b10d726cc4eea1
|
7
|
+
data.tar.gz: b6a3bbfb962f5d2ac3307a12841478626189b6d07f586e096da408740ddfd134fedf3edec54298c9a002e9515f6ef05d804915ff50ac6006e361f087c9e6c378
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Ruby LSP RSpec
|
2
2
|
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/ruby-lsp-rspec)
|
4
4
|
|
5
|
-
|
5
|
+
Ruby LSP RSpec is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for displaying CodeLens for RSpec tests.
|
6
|
+
|
7
|
+

|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -15,7 +17,7 @@ group :development do
|
|
15
17
|
end
|
16
18
|
```
|
17
19
|
|
18
|
-
After running `bundle install`, restart Ruby LSP and you should start seeing
|
20
|
+
After running `bundle install`, restart Ruby LSP and you should start seeing CodeLens in your RSpec test files.
|
19
21
|
|
20
22
|
## Usages (with VS Code)
|
21
23
|
|
@@ -10,7 +10,6 @@ module RubyLsp
|
|
10
10
|
include ::RubyLsp::Requests::Support::Common
|
11
11
|
|
12
12
|
ResponseType = type_member { { fixed: T::Array[::RubyLsp::Interface::CodeLens] } }
|
13
|
-
BASE_COMMAND = T.let((File.exist?("Gemfile.lock") ? "bundle exec rspec" : "rspec"), String)
|
14
13
|
|
15
14
|
sig { override.returns(ResponseType) }
|
16
15
|
attr_reader :_response
|
@@ -21,6 +20,23 @@ module RubyLsp
|
|
21
20
|
@path = T.let(uri.to_standardized_path, T.nilable(String))
|
22
21
|
emitter.register(self, :on_command, :on_command_call, :on_call)
|
23
22
|
|
23
|
+
@base_command = T.let(
|
24
|
+
begin
|
25
|
+
cmd = if File.exist?(File.join(Dir.pwd, "bin", "rspec"))
|
26
|
+
"bin/rspec"
|
27
|
+
else
|
28
|
+
"rspec"
|
29
|
+
end
|
30
|
+
|
31
|
+
if File.exist?("Gemfile.lock")
|
32
|
+
"bundle exec #{cmd}"
|
33
|
+
else
|
34
|
+
cmd
|
35
|
+
end
|
36
|
+
end,
|
37
|
+
String,
|
38
|
+
)
|
39
|
+
|
24
40
|
super(emitter, message_queue)
|
25
41
|
end
|
26
42
|
|
@@ -103,7 +119,7 @@ module RubyLsp
|
|
103
119
|
return unless @path
|
104
120
|
|
105
121
|
line_number = node.location.start_line
|
106
|
-
command = "#{
|
122
|
+
command = "#{@base_command} #{@path}:#{line_number}"
|
107
123
|
|
108
124
|
arguments = [
|
109
125
|
@path,
|
data/misc/example.gif
ADDED
Binary file
|
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.1
|
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-09-
|
11
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-lsp
|
@@ -42,7 +42,7 @@ files:
|
|
42
42
|
- lib/ruby_lsp/ruby_lsp_rspec/code_lens.rb
|
43
43
|
- lib/ruby_lsp/ruby_lsp_rspec/extension.rb
|
44
44
|
- lib/ruby_lsp_rspec/version.rb
|
45
|
-
- misc/example.
|
45
|
+
- misc/example.gif
|
46
46
|
- sorbet/config
|
47
47
|
- sorbet/rbi/annotations/rainbow.rbi
|
48
48
|
- sorbet/rbi/gems/ast@2.4.2.rbi
|
data/misc/example.png
DELETED
Binary file
|