ruby-lsp 0.16.0 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/ruby_lsp/global_state.rb +8 -4
- data/lib/ruby_lsp/listeners/code_lens.rb +9 -4
- data/lib/ruby_lsp/server.rb +1 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3b197d35d03d1b5b78894bce8b03c6aa76be7586fc7034422415d0656ddea7a
|
4
|
+
data.tar.gz: 2fd148c0ab5d8b3ac55784722ab49a3be6b1b4885c8b284e8a6cf40c503b4066
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1994f1d014bc3f70ff96e90d5b3961c279166e5f58be6b38415ec1e2515b7557c6a00f4cde45ba3a66e0d9dd6c1402f7e4754c6f8addb6efb848ec7a65fbadc7
|
7
|
+
data.tar.gz: ffec2a6c5321eb159ea4d505f9b6c6dd56b64cb16d2f052666b9c15f406d59fa478d9e7f7c9734219874c3ca3bb8dcae9b2cbdd683576a3d74b523cf769298e4
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ The Ruby LSP features include
|
|
29
29
|
- Debugging support
|
30
30
|
- Running and debugging tests through VS Code's UI
|
31
31
|
- Go to definition for classes, modules, constants and required files
|
32
|
-
- Showing
|
32
|
+
- Showing documentation on hover for classes, modules and constants
|
33
33
|
- Completion for classes, modules, constants and require paths
|
34
34
|
- Fuzzy search classes, modules and constants anywhere in the project and its dependencies (workspace symbol)
|
35
35
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.16.
|
1
|
+
0.16.2
|
@@ -21,7 +21,7 @@ module RubyLsp
|
|
21
21
|
def initialize
|
22
22
|
@workspace_uri = T.let(URI::Generic.from_path(path: Dir.pwd), URI::Generic)
|
23
23
|
|
24
|
-
@formatter = T.let(
|
24
|
+
@formatter = T.let("auto", String)
|
25
25
|
@test_library = T.let(detect_test_library, String)
|
26
26
|
@typechecker = T.let(detect_typechecker, T::Boolean)
|
27
27
|
@index = T.let(RubyIndexer::Index.new, RubyIndexer::Index)
|
@@ -42,6 +42,10 @@ module RubyLsp
|
|
42
42
|
def apply_options(options)
|
43
43
|
workspace_uri = options.dig(:workspaceFolders, 0, :uri)
|
44
44
|
@workspace_uri = URI(workspace_uri) if workspace_uri
|
45
|
+
|
46
|
+
specified_formatter = options.dig(:initializationOptions, :formatter)
|
47
|
+
@formatter = specified_formatter if specified_formatter
|
48
|
+
@formatter = detect_formatter if @formatter == "auto"
|
45
49
|
end
|
46
50
|
|
47
51
|
sig { returns(String) }
|
@@ -63,17 +67,17 @@ module RubyLsp
|
|
63
67
|
|
64
68
|
sig { returns(String) }
|
65
69
|
def detect_test_library
|
70
|
+
if direct_dependency?(/^rspec/)
|
71
|
+
"rspec"
|
66
72
|
# A Rails app may have a dependency on minitest, but we would instead want to use the Rails test runner provided
|
67
73
|
# by ruby-lsp-rails.
|
68
|
-
|
74
|
+
elsif direct_dependency?(/^rails$/)
|
69
75
|
"rails"
|
70
76
|
# NOTE: Intentionally ends with $ to avoid mis-matching minitest-reporters, etc. in a Rails app.
|
71
77
|
elsif direct_dependency?(/^minitest$/)
|
72
78
|
"minitest"
|
73
79
|
elsif direct_dependency?(/^test-unit/)
|
74
80
|
"test-unit"
|
75
|
-
elsif direct_dependency?(/^rspec/)
|
76
|
-
"rspec"
|
77
81
|
else
|
78
82
|
"unknown"
|
79
83
|
end
|
@@ -68,17 +68,22 @@ module RubyLsp
|
|
68
68
|
command: generate_test_command(group_stack: @group_stack),
|
69
69
|
kind: :group,
|
70
70
|
)
|
71
|
-
end
|
72
71
|
|
73
|
-
|
74
|
-
|
72
|
+
@group_id_stack.push(@group_id)
|
73
|
+
@group_id += 1
|
74
|
+
end
|
75
75
|
end
|
76
76
|
|
77
77
|
sig { params(node: Prism::ClassNode).void }
|
78
78
|
def on_class_node_leave(node)
|
79
79
|
@visibility_stack.pop
|
80
80
|
@group_stack.pop
|
81
|
-
|
81
|
+
|
82
|
+
class_name = node.constant_path.slice
|
83
|
+
|
84
|
+
if @path && class_name.end_with?("Test")
|
85
|
+
@group_id_stack.pop
|
86
|
+
end
|
82
87
|
end
|
83
88
|
|
84
89
|
sig { params(node: Prism::DefNode).void }
|
data/lib/ruby_lsp/server.rb
CHANGED
@@ -129,8 +129,6 @@ module RubyLsp
|
|
129
129
|
|
130
130
|
progress = options.dig(:capabilities, :window, :workDoneProgress)
|
131
131
|
@store.supports_progress = progress.nil? ? true : progress
|
132
|
-
formatter = options.dig(:initializationOptions, :formatter) || "auto"
|
133
|
-
|
134
132
|
configured_features = options.dig(:initializationOptions, :enabledFeatures)
|
135
133
|
@store.experimental_features = options.dig(:initializationOptions, :experimentalFeaturesEnabled) || false
|
136
134
|
|
@@ -177,7 +175,7 @@ module RubyLsp
|
|
177
175
|
document_link_provider: document_link_provider,
|
178
176
|
folding_range_provider: folding_ranges_provider,
|
179
177
|
semantic_tokens_provider: semantic_tokens_provider,
|
180
|
-
document_formatting_provider: enabled_features["formatting"] && formatter != "none",
|
178
|
+
document_formatting_provider: enabled_features["formatting"] && @global_state.formatter != "none",
|
181
179
|
document_highlight_provider: enabled_features["documentHighlights"],
|
182
180
|
code_action_provider: code_action_provider,
|
183
181
|
document_on_type_formatting_provider: on_type_formatting_provider,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lsp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: language_server-protocol
|