solargraph 0.59.0 → 0.59.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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/linting.yml +6 -0
  3. data/.github/workflows/plugins.yml +9 -1
  4. data/.github/workflows/typecheck.yml +3 -1
  5. data/CHANGELOG.md +12 -0
  6. data/lib/solargraph/api_map/store.rb +1 -2
  7. data/lib/solargraph/api_map.rb +4 -6
  8. data/lib/solargraph/complex_type/type_methods.rb +1 -0
  9. data/lib/solargraph/complex_type/unique_type.rb +14 -15
  10. data/lib/solargraph/complex_type.rb +2 -1
  11. data/lib/solargraph/convention/active_support_concern.rb +111 -111
  12. data/lib/solargraph/convention/base.rb +50 -50
  13. data/lib/solargraph/diagnostics.rb +55 -55
  14. data/lib/solargraph/environ.rb +52 -52
  15. data/lib/solargraph/gem_pins.rb +0 -11
  16. data/lib/solargraph/language_server/host.rb +6 -7
  17. data/lib/solargraph/language_server/message/extended/environment.rb +25 -25
  18. data/lib/solargraph/language_server/message/initialized.rb +28 -28
  19. data/lib/solargraph/language_server/message/text_document.rb +28 -28
  20. data/lib/solargraph/language_server/progress.rb +143 -143
  21. data/lib/solargraph/language_server/transport/adapter.rb +68 -68
  22. data/lib/solargraph/language_server.rb +20 -20
  23. data/lib/solargraph/parser/parser_gem/node_chainer.rb +1 -0
  24. data/lib/solargraph/parser/parser_gem/node_methods.rb +91 -4
  25. data/lib/solargraph/parser/parser_gem/node_processors/alias_node.rb +24 -24
  26. data/lib/solargraph/parser/parser_gem/node_processors/casgn_node.rb +36 -36
  27. data/lib/solargraph/parser/parser_gem/node_processors/cvasgn_node.rb +24 -24
  28. data/lib/solargraph/parser/parser_gem/node_processors/gvasgn_node.rb +24 -24
  29. data/lib/solargraph/parser/parser_gem/node_processors/namespace_node.rb +40 -40
  30. data/lib/solargraph/parser/parser_gem/node_processors/sym_node.rb +20 -20
  31. data/lib/solargraph/pin/base.rb +3 -3
  32. data/lib/solargraph/pin/method.rb +2 -0
  33. data/lib/solargraph/pin/parameter.rb +3 -1
  34. data/lib/solargraph/pin/reference/require.rb +14 -14
  35. data/lib/solargraph/pin/search.rb +5 -5
  36. data/lib/solargraph/pin/singleton.rb +11 -11
  37. data/lib/solargraph/rbs_map/conversions.rb +15 -8
  38. data/lib/solargraph/shell.rb +1 -1
  39. data/lib/solargraph/source/chain/array.rb +1 -12
  40. data/lib/solargraph/source/chain/block_symbol.rb +13 -13
  41. data/lib/solargraph/source/chain/block_variable.rb +13 -13
  42. data/lib/solargraph/source/chain/head.rb +19 -19
  43. data/lib/solargraph/source/chain/literal.rb +18 -14
  44. data/lib/solargraph/source/cursor.rb +11 -2
  45. data/lib/solargraph/source/source_chainer.rb +4 -4
  46. data/lib/solargraph/source_map/clip.rb +6 -1
  47. data/lib/solargraph/type_checker.rb +4 -4
  48. data/lib/solargraph/version.rb +1 -1
  49. data/lib/solargraph/yard_map/cache.rb +25 -25
  50. data/lib/solargraph/yard_map/mapper/to_constant.rb +28 -28
  51. data/lib/solargraph/yard_map/mapper/to_method.rb +1 -1
  52. data/lib/solargraph.rb +2 -2
  53. metadata +1 -2
  54. data/rbs/fills/tuple/tuple.rbs +0 -177
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48702da784ad5e4ba9333e3389532a20af5bd0474cde01f0b00b9b07a53203ce
4
- data.tar.gz: 93df9a47dde759e2de2f92f6e65609e4de5ba83403c4f481915e984d05111bab
3
+ metadata.gz: d71c58a0d918c5c6c034e7011a8bf543e0bc4adc5046936fa57cc4f698ccda05
4
+ data.tar.gz: c16b441272fb5aa6f908fdf643d524ff3e5f955dc8b636fd7bf7927836085047
5
5
  SHA512:
6
- metadata.gz: 40c2a0be04ee36e8c0c7328e51e751c04becaddd5f405a302ec369bb7bae365705f75bf3852c1c99183e8ac00d58a61177216e75f60b2af9fb0d064c95496715
7
- data.tar.gz: 41c1a1dd7c926debbb79a8f63b24e550d6b3a389ad71f09e392ce8216b66fa33b73d2a6269d5b624ecdf5aa86add0a81e40c2b3b24483a4555fb3a53d61e1e9c
6
+ metadata.gz: e7f83cd6982410d73623b44dd7b69bb5513266f778aeb33574b30155ccea7a4f53d9649150df2685efee70bdc5ae8227bd02ccdabbf9b633b66809be7c838307
7
+ data.tar.gz: 83b5822ecf5528f3196e1fbd283ac474d27cbc603f2bb81b8d8bff1b0b99d32023fec6e50b691bb390e5c8873875376d28f182ccb12498513f34a0fa4cb575e8
@@ -59,6 +59,8 @@ jobs:
59
59
  run: |
60
60
  bundle exec overcommit --sign
61
61
  SOLARGRAPH_ASSERTS=on bundle exec overcommit --run --diff origin/master
62
+ # @todo Temporary, expect to revert in 0.60
63
+ continue-on-error: true
62
64
  rubocop:
63
65
  name: rubocop
64
66
  runs-on: ubuntu-latest
@@ -95,6 +97,8 @@ jobs:
95
97
 
96
98
  - name: Run rbs validate
97
99
  run: bundle exec rbs validate
100
+ # @todo Temporary, expect to revert in 0.60
101
+ continue-on-error: true
98
102
  rubocop_todo:
99
103
  name: .rubocop_todo.yml
100
104
  runs-on: ubuntu-latest
@@ -112,6 +116,8 @@ jobs:
112
116
 
113
117
  - name: Run RuboCop
114
118
  run: bundle exec rubocop -c .rubocop.yml
119
+ # @todo Temporary, expect to revert in 0.60
120
+ continue-on-error: true
115
121
 
116
122
  - name: Run RuboCop against todo file
117
123
  continue-on-error: true
@@ -23,7 +23,7 @@ jobs:
23
23
  - name: Set up Ruby
24
24
  uses: ruby/setup-ruby@v1
25
25
  with:
26
- ruby-version: 3.4 # keep same as typecheck.yml
26
+ ruby-version: 4.0 # keep same as typecheck.yml
27
27
  bundler-cache: true
28
28
  - uses: awalsh128/cache-apt-pkgs-action@latest
29
29
  with:
@@ -45,6 +45,8 @@ jobs:
45
45
  run: bundle exec rbs collection update
46
46
  - name: Ensure typechecking still works
47
47
  run: bundle exec solargraph typecheck --level strong
48
+ # @todo Temporary, expect to revert in 0.60
49
+ continue-on-error: true
48
50
  - name: Ensure specs still run
49
51
  run: bundle exec rake spec
50
52
  rails:
@@ -78,6 +80,8 @@ jobs:
78
80
  run: bundle exec rbs collection update
79
81
  - name: Ensure typechecking still works
80
82
  run: bundle exec solargraph typecheck --level strong
83
+ # @todo Temporary, expect to revert in 0.60
84
+ continue-on-error: true
81
85
  - name: Ensure specs still run
82
86
  run: bundle exec rake spec
83
87
  rspec:
@@ -109,6 +113,8 @@ jobs:
109
113
  run: bundle exec rbs collection update
110
114
  - name: Ensure typechecking still works
111
115
  run: bundle exec solargraph typecheck --level strong
116
+ # @todo Temporary, expect to revert in 0.60
117
+ continue-on-error: true
112
118
  - name: Ensure specs still run
113
119
  run: bundle exec rake spec
114
120
 
@@ -229,3 +235,5 @@ jobs:
229
235
  ALLOW_IMPROVEMENTS=true bundle exec rake spec
230
236
  env:
231
237
  MATRIX_RAILS_VERSION: "7.0"
238
+ # @todo Temporary, expect to revert in 0.60
239
+ continue-on-error: true
@@ -27,7 +27,7 @@ jobs:
27
27
  - name: Set up Ruby
28
28
  uses: ruby/setup-ruby@v1
29
29
  with:
30
- ruby-version: 3.4
30
+ ruby-version: 4.0
31
31
  bundler-cache: false
32
32
  - name: Install gems
33
33
  run: |
@@ -38,3 +38,5 @@ jobs:
38
38
  run: bundle exec rbs collection install
39
39
  - name: Typecheck self
40
40
  run: SOLARGRAPH_ASSERTS=on bundle exec solargraph typecheck --level strong
41
+ # @todo Temporary, expect to revert in 0.60
42
+ continue-on-error: true
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.59.2 - May 22, 2026
2
+ - Convert RBS implicit nil annotations (#1197)
3
+ - Temporary job stubs (#1200)
4
+ - Limit pin combination to doc maps (#1195)
5
+ - Ignore literal values in type inference (#1201)
6
+ - Fix for clips with flaky node recipients
7
+
8
+ ## 0.59.1 - May 18, 2026
9
+ - Fix signatureHelp bug (#1185)
10
+ - Linting fixes for Ruby 3.1 (#1193)
11
+ - Parameters shadow local variables with same name (#1192)
12
+
1
13
  ## 0.59.0 - May 13, 2026
2
14
  - Ensure pathname is required for rbs in shell caching processes (#1183)
3
15
  - Pre-release branch 2026-01-12 (#1152)
@@ -71,10 +71,9 @@ module Solargraph
71
71
  # @param visibility [Array<Symbol>]
72
72
  # @return [Enumerable<Solargraph::Pin::Method>]
73
73
  def get_methods fqns, scope: :instance, visibility: [:public]
74
- all_pins = namespace_children(fqns).select do |pin|
74
+ namespace_children(fqns).select do |pin|
75
75
  pin.is_a?(Pin::Method) && pin.scope == scope && visibility.include?(pin.visibility)
76
76
  end
77
- GemPins.combine_method_pins_by_path(all_pins)
78
77
  end
79
78
 
80
79
  BOOLEAN_SUPERCLASS_PIN = Pin::Reference::Superclass.new(name: 'Boolean', closure: Pin::ROOT_PIN,
@@ -375,6 +375,9 @@ module Solargraph
375
375
  #
376
376
  # @return [Pin::BaseVariable, nil]
377
377
  def var_at_location candidates, name, closure, location
378
+ # @todo Location can be nil if clips have trouble finding node recipients
379
+ return unless location
380
+
378
381
  with_correct_name = candidates.select { |pin| pin.name == name }
379
382
  vars_at_location = with_correct_name.reject do |pin|
380
383
  # visible_at? excludes the starting position, but we want to
@@ -416,11 +419,6 @@ module Solargraph
416
419
  # @param deep [Boolean] True to include superclasses, mixins, etc.
417
420
  # @return [Array<Solargraph::Pin::Method>]
418
421
  def get_methods rooted_tag, scope: :instance, visibility: [:public], deep: true
419
- if rooted_tag.start_with? 'Array('
420
- # Array() are really tuples - use our fill, as the RBS repo
421
- # does not give us definitions for it
422
- rooted_tag = "Solargraph::Fills::Tuple(#{rooted_tag[6..-2]})"
423
- end
424
422
  rooted_type = ComplexType.try_parse(rooted_tag)
425
423
  fqns = rooted_type.namespace
426
424
  namespace_pin = store.get_path_pins(fqns).select { |p| p.is_a?(Pin::Namespace) }.first
@@ -721,7 +719,7 @@ module Solargraph
721
719
  logger.debug do
722
720
  "ApiMap#resolve_method_aliases(pins=#{pins.map(&:name)}, visibility=#{visibility}) => #{with_resolved_aliases.map(&:name)}"
723
721
  end
724
- GemPins.combine_method_pins_by_path(with_resolved_aliases)
722
+ with_resolved_aliases
725
723
  end
726
724
 
727
725
  # @return [Workspace, nil]
@@ -59,6 +59,7 @@ module Solargraph
59
59
  end
60
60
 
61
61
  def tuple?
62
+ return false
62
63
  @tuple ||= (name == 'Tuple') || (name == 'Array' && subtypes.length >= 1 && fixed_parameters?)
63
64
  end
64
65
 
@@ -147,6 +147,7 @@ module Solargraph
147
147
  end
148
148
 
149
149
  def literal?
150
+ return false
150
151
  non_literal_name != name
151
152
  end
152
153
 
@@ -228,11 +229,11 @@ module Solargraph
228
229
  # covariant
229
230
  # contravariant?: Proc - can be changed, so we can pass
230
231
  # in less specific super types
231
- if %w[Hash Tuple Array Set Enumerable].include?(name) && fixed_parameters?
232
- :covariant
233
- else
234
- default
235
- end
232
+ # if %w[Hash Tuple Array Set Enumerable].include?(name) && fixed_parameters?
233
+ # :covariant
234
+ # else
235
+ default
236
+ # end
236
237
  end
237
238
 
238
239
  # Whether this is an RBS interface like _ToAry or Hash::_Key.
@@ -374,6 +375,7 @@ module Solargraph
374
375
 
375
376
  # @return [UniqueType]
376
377
  def downcast_to_literal_if_possible
378
+ return self
377
379
  SINGLE_SUBTYPE.fetch(rooted_tag, self)
378
380
  end
379
381
 
@@ -456,15 +458,12 @@ module Solargraph
456
458
  else
457
459
  next ComplexType::UNDEFINED
458
460
  end
459
- elsif context_type.all?(&:implicit_union?)
460
- if idx.zero? && !context_type.all_params.empty?
461
- ComplexType.new(context_type.all_params)
462
- else
463
- ComplexType::UNDEFINED
464
- end
461
+ # @todo Treating parameterized classes and tuples the same for now
462
+ # elsif context_type.all?(&:implicit_union?) || true
463
+ elsif idx.zero? && !context_type.all_params.empty?
464
+ ComplexType.new(context_type.all_params)
465
465
  else
466
- # @sg-ignore Need to add nil check here
467
- context_type.all_params[idx] || definitions.generic_defaults[generic_name] || ComplexType::UNDEFINED
466
+ ComplexType::UNDEFINED
468
467
  end
469
468
  else
470
469
  t
@@ -482,8 +481,8 @@ module Solargraph
482
481
  # @yieldparam t [self]
483
482
  # @yieldreturn [self]
484
483
  # @return [Enumerable<self>]
485
- def each &block
486
- [self].each(&block)
484
+ def each(&)
485
+ [self].each(&)
487
486
  end
488
487
 
489
488
  # @return [Array<UniqueType>]
@@ -166,7 +166,7 @@ module Solargraph
166
166
  # @param name [Symbol]
167
167
  # @param include_private [Boolean]
168
168
  def respond_to_missing? name, include_private = false
169
- TypeMethods.public_instance_methods.include?(name) || super
169
+ TypeMethods.public_method_defined?(name) || super
170
170
  end
171
171
 
172
172
  def to_s
@@ -189,6 +189,7 @@ module Solargraph
189
189
 
190
190
  # @return [ComplexType]
191
191
  def downcast_to_literal_if_possible
192
+ return self
192
193
  ComplexType.new(items.map(&:downcast_to_literal_if_possible))
193
194
  end
194
195
 
@@ -1,111 +1,111 @@
1
- # frozen_string_literal: true
2
-
3
- module Solargraph
4
- module Convention
5
- # ActiveSupport::Concern is syntactic sugar for a common
6
- # pattern to include class methods while mixing-in a Module
7
- # See https://api.rubyonrails.org/classes/ActiveSupport/Concern.html
8
- class ActiveSupportConcern < Base
9
- include Logging
10
-
11
- # @return [Array<Pin::Base>]
12
- attr_reader :pins
13
-
14
- # @param api_map [ApiMap]
15
- # @param rooted_tag [String]
16
- # @param scope [Symbol] :class or :instance
17
- # @param visibility [Array<Symbol>] :public, :protected, and/or :private
18
- # @param deep [Boolean] whether to include methods from included modules
19
- # @param skip [Set<String>]
20
- # @param _no_core [Boolean]n whether to skip core methods
21
- def object api_map, rooted_tag, scope, visibility, deep, skip, _no_core
22
- moo = ObjectProcessor.new(api_map, rooted_tag, scope, visibility, deep, skip)
23
- moo.environ
24
- end
25
-
26
- # yard-activesupport-concern pulls methods inside
27
- # 'class_methods' blocks into main class visible from YARD
28
- #
29
- # @param _doc_map [DocMap]
30
- def global _doc_map
31
- Environ.new(yard_plugins: ['activesupport-concern'])
32
- end
33
-
34
- # Process an object to add any class methods brought in via
35
- # ActiveSupport::Concern
36
- class ObjectProcessor
37
- include Logging
38
-
39
- attr_reader :environ
40
-
41
- # @param api_map [ApiMap]
42
- # @param rooted_tag [String] the tag of the class or module being processed
43
- # @param scope [Symbol] :class or :instance
44
- # @param visibility [Array<Symbol>] :public, :protected, and/or :private
45
- # @param deep [Boolean] whether to include methods from included modules
46
- # @param skip [Set<String>] a set of tags to skip
47
- def initialize api_map, rooted_tag, scope, visibility, deep, skip
48
- @api_map = api_map
49
- @rooted_tag = rooted_tag
50
- @scope = scope
51
- @visibility = visibility
52
- @deep = deep
53
- @skip = skip
54
-
55
- @environ = Environ.new
56
- return unless scope == :class
57
-
58
- @rooted_type = ComplexType.parse(rooted_tag).force_rooted
59
- @fqns = rooted_type.namespace
60
- @namespace_pin = api_map.get_path_pins(fqns).select { |p| p.is_a?(Pin::Namespace) }.first
61
-
62
- api_map.get_includes(fqns).reverse.each do |include_tag|
63
- process_include include_tag
64
- end
65
- end
66
-
67
- private
68
-
69
- attr_reader :api_map, :rooted_tag, :rooted_type, :scope,
70
- :visibility, :deep, :skip, :namespace_pin,
71
- :fqns
72
-
73
- # @param include_tag [Pin::Reference::Include] the include reference pin
74
- #
75
- # @return [void]
76
- def process_include include_tag
77
- rooted_include_tag = api_map.dereference(include_tag)
78
- return if rooted_include_tag.nil?
79
- logger.debug do
80
- "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
81
- "Handling class include include_tag=#{include_tag}"
82
- end
83
- module_extends = api_map.get_extends(rooted_include_tag).map(&:type).map(&:to_s)
84
- logger.debug do
85
- "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
86
- "found module extends of #{rooted_include_tag}: #{module_extends}"
87
- end
88
- return unless module_extends.include? 'ActiveSupport::Concern'
89
- included_class_pins = api_map.inner_get_methods_from_reference(rooted_include_tag, namespace_pin, rooted_type,
90
- :class, visibility, deep, skip, true)
91
- logger.debug do
92
- "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
93
- "Found #{included_class_pins.length} inluded class methods for #{rooted_include_tag}"
94
- end
95
- environ.pins.concat included_class_pins
96
- # another pattern is to put class methods inside a submodule
97
- classmethods_include_tag = "#{rooted_include_tag}::ClassMethods"
98
- included_classmethods_pins =
99
- api_map.inner_get_methods_from_reference(classmethods_include_tag, namespace_pin, rooted_type,
100
- :instance, visibility, deep, skip, true)
101
- logger.debug do
102
- "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
103
- "Found #{included_classmethods_pins.length} included classmethod " \
104
- "class methods for #{classmethods_include_tag}"
105
- end
106
- environ.pins.concat included_classmethods_pins
107
- end
108
- end
109
- end
110
- end
111
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Solargraph
4
+ module Convention
5
+ # ActiveSupport::Concern is syntactic sugar for a common
6
+ # pattern to include class methods while mixing-in a Module
7
+ # See https://api.rubyonrails.org/classes/ActiveSupport/Concern.html
8
+ class ActiveSupportConcern < Base
9
+ include Logging
10
+
11
+ # @return [Array<Pin::Base>]
12
+ attr_reader :pins
13
+
14
+ # @param api_map [ApiMap]
15
+ # @param rooted_tag [String]
16
+ # @param scope [Symbol] :class or :instance
17
+ # @param visibility [Array<Symbol>] :public, :protected, and/or :private
18
+ # @param deep [Boolean] whether to include methods from included modules
19
+ # @param skip [Set<String>]
20
+ # @param _no_core [Boolean]n whether to skip core methods
21
+ def object api_map, rooted_tag, scope, visibility, deep, skip, _no_core
22
+ moo = ObjectProcessor.new(api_map, rooted_tag, scope, visibility, deep, skip)
23
+ moo.environ
24
+ end
25
+
26
+ # yard-activesupport-concern pulls methods inside
27
+ # 'class_methods' blocks into main class visible from YARD
28
+ #
29
+ # @param _doc_map [DocMap]
30
+ def global _doc_map
31
+ Environ.new(yard_plugins: ['activesupport-concern'])
32
+ end
33
+
34
+ # Process an object to add any class methods brought in via
35
+ # ActiveSupport::Concern
36
+ class ObjectProcessor
37
+ include Logging
38
+
39
+ attr_reader :environ
40
+
41
+ # @param api_map [ApiMap]
42
+ # @param rooted_tag [String] the tag of the class or module being processed
43
+ # @param scope [Symbol] :class or :instance
44
+ # @param visibility [Array<Symbol>] :public, :protected, and/or :private
45
+ # @param deep [Boolean] whether to include methods from included modules
46
+ # @param skip [Set<String>] a set of tags to skip
47
+ def initialize api_map, rooted_tag, scope, visibility, deep, skip
48
+ @api_map = api_map
49
+ @rooted_tag = rooted_tag
50
+ @scope = scope
51
+ @visibility = visibility
52
+ @deep = deep
53
+ @skip = skip
54
+
55
+ @environ = Environ.new
56
+ return unless scope == :class
57
+
58
+ @rooted_type = ComplexType.parse(rooted_tag).force_rooted
59
+ @fqns = rooted_type.namespace
60
+ @namespace_pin = api_map.get_path_pins(fqns).select { |p| p.is_a?(Pin::Namespace) }.first
61
+
62
+ api_map.get_includes(fqns).reverse.each do |include_tag|
63
+ process_include include_tag
64
+ end
65
+ end
66
+
67
+ private
68
+
69
+ attr_reader :api_map, :rooted_tag, :rooted_type, :scope,
70
+ :visibility, :deep, :skip, :namespace_pin,
71
+ :fqns
72
+
73
+ # @param include_tag [Pin::Reference::Include] the include reference pin
74
+ #
75
+ # @return [void]
76
+ def process_include include_tag
77
+ rooted_include_tag = api_map.dereference(include_tag)
78
+ return if rooted_include_tag.nil?
79
+ logger.debug do
80
+ "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
81
+ "Handling class include include_tag=#{include_tag}"
82
+ end
83
+ module_extends = api_map.get_extends(rooted_include_tag).map(&:type).map(&:to_s)
84
+ logger.debug do
85
+ "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
86
+ "found module extends of #{rooted_include_tag}: #{module_extends}"
87
+ end
88
+ return unless module_extends.include? 'ActiveSupport::Concern'
89
+ included_class_pins = api_map.inner_get_methods_from_reference(rooted_include_tag, namespace_pin, rooted_type,
90
+ :class, visibility, deep, skip, true)
91
+ logger.debug do
92
+ "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
93
+ "Found #{included_class_pins.length} inluded class methods for #{rooted_include_tag}"
94
+ end
95
+ environ.pins.concat included_class_pins
96
+ # another pattern is to put class methods inside a submodule
97
+ classmethods_include_tag = "#{rooted_include_tag}::ClassMethods"
98
+ included_classmethods_pins =
99
+ api_map.inner_get_methods_from_reference(classmethods_include_tag, namespace_pin, rooted_type,
100
+ :instance, visibility, deep, skip, true)
101
+ logger.debug do
102
+ "ActiveSupportConcern#object(#{fqns}, #{scope}, #{visibility}, #{deep}) - " \
103
+ "Found #{included_classmethods_pins.length} included classmethod " \
104
+ "class methods for #{classmethods_include_tag}"
105
+ end
106
+ environ.pins.concat included_classmethods_pins
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -1,50 +1,50 @@
1
- # frozen_string_literal: true
2
-
3
- module Solargraph
4
- module Convention
5
- # The base class for Conventions.
6
- #
7
- # A Convention provides Environs that customize ApiMaps with additional
8
- # pins and other information. Subclasses should implement the `local` and
9
- # `global` methods as necessary.
10
- #
11
- class Base
12
- EMPTY_ENVIRON = Environ.new
13
-
14
- # The Environ for a source map.
15
- # Subclasses can override this method.
16
- #
17
- # @param source_map [SourceMap]
18
- # @return [Environ]
19
- def local source_map
20
- EMPTY_ENVIRON
21
- end
22
-
23
- # The Environ for a DocMap.
24
- # Subclasses can override this method.
25
- #
26
- # @param doc_map [DocMap]
27
- # @return [Environ]
28
- def global doc_map
29
- EMPTY_ENVIRON
30
- end
31
-
32
- # Provides any additional method pins based on e the described object.
33
- #
34
- # @param api_map [ApiMap]
35
- # @param rooted_tag [String] A fully qualified namespace, with
36
- # generic parameter values if applicable
37
- # @param scope [Symbol] :class or :instance
38
- # @param visibility [Array<Symbol>] :public, :protected, and/or :private
39
- # @param deep [Boolean]
40
- # @param skip [Set<String>]
41
- # @param no_core [Boolean] Skip core classes if true
42
- #
43
- # @return [Environ]
44
- def object api_map, rooted_tag, scope, visibility,
45
- deep, skip, no_core
46
- EMPTY_ENVIRON
47
- end
48
- end
49
- end
50
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Solargraph
4
+ module Convention
5
+ # The base class for Conventions.
6
+ #
7
+ # A Convention provides Environs that customize ApiMaps with additional
8
+ # pins and other information. Subclasses should implement the `local` and
9
+ # `global` methods as necessary.
10
+ #
11
+ class Base
12
+ EMPTY_ENVIRON = Environ.new
13
+
14
+ # The Environ for a source map.
15
+ # Subclasses can override this method.
16
+ #
17
+ # @param source_map [SourceMap]
18
+ # @return [Environ]
19
+ def local source_map
20
+ EMPTY_ENVIRON
21
+ end
22
+
23
+ # The Environ for a DocMap.
24
+ # Subclasses can override this method.
25
+ #
26
+ # @param doc_map [DocMap]
27
+ # @return [Environ]
28
+ def global doc_map
29
+ EMPTY_ENVIRON
30
+ end
31
+
32
+ # Provides any additional method pins based on e the described object.
33
+ #
34
+ # @param api_map [ApiMap]
35
+ # @param rooted_tag [String] A fully qualified namespace, with
36
+ # generic parameter values if applicable
37
+ # @param scope [Symbol] :class or :instance
38
+ # @param visibility [Array<Symbol>] :public, :protected, and/or :private
39
+ # @param deep [Boolean]
40
+ # @param skip [Set<String>]
41
+ # @param no_core [Boolean] Skip core classes if true
42
+ #
43
+ # @return [Environ]
44
+ def object api_map, rooted_tag, scope, visibility,
45
+ deep, skip, no_core
46
+ EMPTY_ENVIRON
47
+ end
48
+ end
49
+ end
50
+ end