ruby-lsp 0.23.21 → 0.23.22

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: 336c4740e2cc0c03bec77c7854065bc9115ed14ab88949d41ae8a8da7d58b1da
4
- data.tar.gz: 0b1ccf86525c8db95beb310c23977353520e0951f7c627199db567c50b8b29f8
3
+ metadata.gz: 48c7e1cdc0e7f0a31cbc69002bf6a6c3dea0779272757ee40ae90e4199199446
4
+ data.tar.gz: 1cd0d4a426ed4b1c44540e9e3344f73623f0ea0193374cab8faa727528474bf2
5
5
  SHA512:
6
- metadata.gz: ffb2a4605bf6c3b7e82dde8ca73cd624c22aa16a2cf91569b7b38d06a7d876a932023efa4a4dea1871ca0e5965a923be97b9e870f2fd9f0b36d70d354213e9ea
7
- data.tar.gz: e488ffda15f9d7a0549294d70f607c09620144ff3a1fea3441d834c3c2db06cf691997005c357cffcf596b4e41e83599111c48da07d92ea26bde293ae6edde0a
6
+ metadata.gz: ac87c3a6dcc52b2696076d9793b42f03f56a4e0fbe258cc20f09502bbb289f91acccb3593ebfd36d61b5eeb0ec0bc3ab697acc332b61889fd256db2600029eca
7
+ data.tar.gz: be146b667f656ddb1103756a4cf79bd294981fa5f3d0cebc38e44498168799b14941c1768e9f030e80d4f4f7e8c4e4b0107e9cbaf694184ddc037824a05a2f1f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.23.21
1
+ 0.23.22
@@ -103,7 +103,7 @@ module RubyIndexer
103
103
  #: (RBS::AST::Members::MethodDefinition member, Entry::Namespace owner) -> void
104
104
  def handle_method(member, owner)
105
105
  name = member.name.name
106
- uri = URI::Generic.from_path(path: member.location.buffer.name)
106
+ uri = URI::Generic.from_path(path: member.location.buffer.name.to_s)
107
107
  location = to_ruby_indexer_location(member.location)
108
108
  comments = comments_to_string(member)
109
109
 
@@ -267,7 +267,7 @@ module RubyIndexer
267
267
 
268
268
  #: (RBS::AST::Members::Alias member, Entry::Namespace owner_entry) -> void
269
269
  def handle_signature_alias(member, owner_entry)
270
- uri = URI::Generic.from_path(path: member.location.buffer.name)
270
+ uri = URI::Generic.from_path(path: member.location.buffer.name.to_s)
271
271
  comments = comments_to_string(member)
272
272
 
273
273
  entry = Entry::UnresolvedMethodAlias.new(
@@ -44,7 +44,7 @@ module RubyLsp
44
44
  # If all of the children of the current test group are other groups, then there's no need to add it to the
45
45
  # aggregated examples
46
46
  unless children.any? && children.all? { |child| child[:tags].include?("test_group") }
47
- aggregated_tests[path][item[:label]] = { tags: tags, examples: [] }
47
+ aggregated_tests[path][item[:id]] = { tags: tags, examples: [] }
48
48
  end
49
49
  else
50
50
  class_name, method_name = item[:id].split("#")
@@ -92,7 +92,7 @@ module RubyLsp
92
92
  #: (String, Hash[String, Hash[Symbol, untyped]]) -> String
93
93
  def handle_minitest_groups(file_path, groups_and_examples)
94
94
  regexes = groups_and_examples.flat_map do |group, info|
95
- examples = info[:examples]
95
+ examples = info[:examples].map { |e| e.gsub(/test_\d{4}/, "test_\\d{4}") }
96
96
  group_regex = Shellwords.escape(group).gsub(
97
97
  Shellwords.escape(TestDiscovery::DYNAMIC_REFERENCE_MARKER),
98
98
  ".*",
@@ -197,6 +197,18 @@ module RubyLsp
197
197
  super
198
198
  end
199
199
 
200
+ #: (Prism::ModuleNode node) -> void
201
+ def on_module_node_enter(node) # rubocop:disable RubyLsp/UseRegisterWithHandlerMethod
202
+ @parent_stack << nil
203
+ super
204
+ end
205
+
206
+ #: (Prism::ModuleNode node) -> void
207
+ def on_module_node_leave(node) # rubocop:disable RubyLsp/UseRegisterWithHandlerMethod
208
+ @parent_stack.pop
209
+ super
210
+ end
211
+
200
212
  #: (Prism::DefNode node) -> void
201
213
  def on_def_node_enter(node)
202
214
  return if @visibility_stack.last != :public
@@ -30,6 +30,30 @@ module RubyLsp
30
30
  end
31
31
  end
32
32
 
33
+ # This patch is here to prevent other gems from overriding or adding more Minitest reporters. Otherwise, they may
34
+ # break the integration between the server and extension
35
+ module PreventReporterOverridePatch
36
+ @lsp_reporters = [] #: Array[Minitest::AbstractReporter]
37
+
38
+ class << self
39
+ #: Array[Minitest::AbstractReporter]
40
+ attr_accessor :lsp_reporters
41
+ end
42
+
43
+ # Patch the writer to prevent replacing the entire array
44
+ #: (untyped) -> void
45
+ def reporters=(reporters)
46
+ # Do nothing. We don't want other gems to override our reporter
47
+ end
48
+
49
+ # Patch the reader to prevent appending more reporters. This method always returns a temporary copy of the real
50
+ # reporters so that if any gem mutates it, it continues to return the original reporters
51
+ #: -> Array[untyped]
52
+ def reporters
53
+ PreventReporterOverridePatch.lsp_reporters.dup
54
+ end
55
+ end
56
+
33
57
  class MinitestReporter < Minitest::AbstractReporter
34
58
  class << self
35
59
  #: (Hash[untyped, untyped]) -> void
@@ -45,6 +69,8 @@ module RubyLsp
45
69
 
46
70
  # Add the JSON RPC reporter
47
71
  reporters << MinitestReporter.new
72
+ PreventReporterOverridePatch.lsp_reporters = reporters
73
+ Minitest.reporter.class.prepend(PreventReporterOverridePatch)
48
74
  end
49
75
  end
50
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.21
4
+ version: 0.23.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
@@ -52,7 +52,7 @@ dependencies:
52
52
  version: '3'
53
53
  - - "<"
54
54
  - !ruby/object:Gem::Version
55
- version: '4'
55
+ version: '5'
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
@@ -62,7 +62,7 @@ dependencies:
62
62
  version: '3'
63
63
  - - "<"
64
64
  - !ruby/object:Gem::Version
65
- version: '4'
65
+ version: '5'
66
66
  - !ruby/object:Gem::Dependency
67
67
  name: sorbet-runtime
68
68
  requirement: !ruby/object:Gem::Requirement