spoom 1.3.0 → 1.3.2

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: 1993e4b43cf1c9d97475b654c049e8b14a27189561471b2bfb4bb077ac2f7b9e
4
- data.tar.gz: ad6a269fe90e77df95564a13e222d58e9993c7ffef389c2be3a0e2fc7a1aed9a
3
+ metadata.gz: bf02e50bf4a9482c7895022115de973e0be60b79cf781760cb8e6ecb48013eaf
4
+ data.tar.gz: 73ba081a87afdde5b57672b5a67ca860089506254a1b65fa5309ba28a7014bf3
5
5
  SHA512:
6
- metadata.gz: 8eab661cb5d9aa290bea6dba5ab3808ad4df7847213229616c4eb912faf012208da053bcb4019700e390f57ce156ff7852a9ef4b01ab48c819acc1453a62b8eb
7
- data.tar.gz: 7f74c0655f781be1c9832d33dcc9a1cb088705f201998f431dae80a90dae259fe09a85cb0ffec1bd53369694b842c5bfe10a3b32ff25a9b1c61ee712fd934900
6
+ metadata.gz: 19c39e380ddc81c38aaaf1b954232a4e068e88b14ad8a4690bb2810b62467578a3e836477c6d0c6db398eeec81a7d212e6b630b070f3b23c9990139a17ca0a60
7
+ data.tar.gz: ab920946c6ed779638788550f27b5c66ad1c1c21951d6cedc57b0a80fb58d7be094625d55b177e7c5479bfab9e24b733e10ec6f39de0039d3c80c98f45026514
data/lib/spoom/cli.rb CHANGED
@@ -63,7 +63,7 @@ module Spoom
63
63
 
64
64
  desc "coverage", "Collect metrics related to Sorbet coverage"
65
65
  def coverage(*args)
66
- say_warning("This command is deprecated. Please use `spoom srb bump` instead.")
66
+ say_warning("This command is deprecated. Please use `spoom srb coverage` instead.")
67
67
 
68
68
  invoke(Cli::Srb::Coverage, args, options)
69
69
  end
@@ -73,7 +73,7 @@ module Spoom
73
73
 
74
74
  desc "lsp", "Send LSP requests to Sorbet"
75
75
  def lsp(*args)
76
- say_warning("This command is deprecated. Please use `spoom srb bump` instead.")
76
+ say_warning("This command is deprecated. Please use `spoom srb lsp` instead.")
77
77
 
78
78
  invoke(Cli::Srb::LSP, args, options)
79
79
  end
@@ -312,7 +312,7 @@ module Spoom
312
312
  # Adjust the lines to remove to include following blank lines
313
313
  after = context.next_node
314
314
  if before.nil? && after && after.location.start_line > end_line + 1
315
- end_line = after.location.end_line - 1
315
+ end_line = after.location.start_line - 1
316
316
  elsif after.nil? && context.parent_node.location.end_line > end_line + 1
317
317
  end_line = context.parent_node.location.end_line - 1
318
318
  end
@@ -564,7 +564,7 @@ module Spoom
564
564
  raise ParserError, "Error while parsing #{location.file}: #{message}"
565
565
  end
566
566
 
567
- visitor = new(location)
567
+ visitor = new(location, kind)
568
568
  visitor.visit(result.value)
569
569
 
570
570
  node = visitor.node
@@ -617,10 +617,11 @@ module Spoom
617
617
  sig { returns(T::Array[Prism::Node]) }
618
618
  attr_reader :nodes_nesting
619
619
 
620
- sig { params(location: Location).void }
621
- def initialize(location)
620
+ sig { params(location: Location, kind: T.nilable(Definition::Kind)).void }
621
+ def initialize(location, kind)
622
622
  super()
623
623
  @location = location
624
+ @kind = kind
624
625
  @node = T.let(nil, T.nilable(Prism::Node))
625
626
  @nodes_nesting = T.let([], T::Array[Prism::Node])
626
627
  end
@@ -635,6 +636,9 @@ module Spoom
635
636
  # We found the node we're looking for at `@location`
636
637
  @node = node
637
638
 
639
+ # The node we found matches the kind we're looking for, we can stop here
640
+ return if @kind && self.class.node_match_kind?(node, @kind)
641
+
638
642
  # There may be a more precise child inside the node that also matches `@location`, let's visit them
639
643
  @nodes_nesting << node
640
644
  super(node)
data/lib/spoom/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Spoom
5
- VERSION = "1.3.0"
5
+ VERSION = "1.3.2"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Terrasa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-26 00:00:00.000000000 Z
11
+ date: 2024-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 13.1.0
61
+ version: 13.2.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 13.1.0
68
+ version: 13.2.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: erubi
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  - !ruby/object:Gem::Version
227
227
  version: '0'
228
228
  requirements: []
229
- rubygems_version: 3.5.7
229
+ rubygems_version: 3.5.9
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: Useful tools for Sorbet enthusiasts.