solargraph 0.58.2 → 0.59.0.dev.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 (203) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +3 -0
  3. data/.github/workflows/linting.yml +4 -5
  4. data/.github/workflows/plugins.yml +41 -34
  5. data/.github/workflows/rspec.yml +44 -23
  6. data/.github/workflows/typecheck.yml +2 -2
  7. data/.rubocop.yml +32 -5
  8. data/.rubocop_todo.yml +50 -966
  9. data/Gemfile +3 -1
  10. data/README.md +3 -3
  11. data/Rakefile +26 -23
  12. data/bin/solargraph +2 -1
  13. data/lib/solargraph/api_map/cache.rb +3 -3
  14. data/lib/solargraph/api_map/constants.rb +13 -3
  15. data/lib/solargraph/api_map/index.rb +23 -18
  16. data/lib/solargraph/api_map/source_to_yard.rb +22 -9
  17. data/lib/solargraph/api_map/store.rb +33 -28
  18. data/lib/solargraph/api_map.rb +150 -82
  19. data/lib/solargraph/bench.rb +44 -45
  20. data/lib/solargraph/complex_type/conformance.rb +176 -0
  21. data/lib/solargraph/complex_type/type_methods.rb +28 -17
  22. data/lib/solargraph/complex_type/unique_type.rb +218 -57
  23. data/lib/solargraph/complex_type.rb +170 -57
  24. data/lib/solargraph/convention/data_definition/data_assignment_node.rb +61 -61
  25. data/lib/solargraph/convention/data_definition/data_definition_node.rb +7 -5
  26. data/lib/solargraph/convention/data_definition.rb +5 -2
  27. data/lib/solargraph/convention/gemfile.rb +15 -15
  28. data/lib/solargraph/convention/gemspec.rb +23 -23
  29. data/lib/solargraph/convention/rakefile.rb +17 -17
  30. data/lib/solargraph/convention/struct_definition/struct_assignment_node.rb +2 -1
  31. data/lib/solargraph/convention/struct_definition/struct_definition_node.rb +4 -3
  32. data/lib/solargraph/convention/struct_definition.rb +8 -4
  33. data/lib/solargraph/convention.rb +78 -78
  34. data/lib/solargraph/converters/dd.rb +19 -17
  35. data/lib/solargraph/converters/dl.rb +17 -15
  36. data/lib/solargraph/converters/dt.rb +17 -15
  37. data/lib/solargraph/converters/misc.rb +3 -1
  38. data/lib/solargraph/diagnostics/require_not_found.rb +1 -0
  39. data/lib/solargraph/diagnostics/rubocop.rb +11 -10
  40. data/lib/solargraph/diagnostics/rubocop_helpers.rb +5 -3
  41. data/lib/solargraph/diagnostics/type_check.rb +11 -10
  42. data/lib/solargraph/diagnostics/update_errors.rb +37 -41
  43. data/lib/solargraph/doc_map.rb +133 -373
  44. data/lib/solargraph/equality.rb +4 -4
  45. data/lib/solargraph/gem_pins.rb +21 -20
  46. data/lib/solargraph/language_server/error_codes.rb +20 -20
  47. data/lib/solargraph/language_server/host/diagnoser.rb +1 -1
  48. data/lib/solargraph/language_server/host/dispatch.rb +3 -3
  49. data/lib/solargraph/language_server/host/message_worker.rb +4 -3
  50. data/lib/solargraph/language_server/host/sources.rb +2 -1
  51. data/lib/solargraph/language_server/host.rb +30 -22
  52. data/lib/solargraph/language_server/message/base.rb +97 -97
  53. data/lib/solargraph/language_server/message/client/register_capability.rb +13 -15
  54. data/lib/solargraph/language_server/message/completion_item/resolve.rb +58 -60
  55. data/lib/solargraph/language_server/message/extended/check_gem_version.rb +12 -18
  56. data/lib/solargraph/language_server/message/extended/document.rb +1 -0
  57. data/lib/solargraph/language_server/message/extended/document_gems.rb +32 -32
  58. data/lib/solargraph/language_server/message/extended/download_core.rb +20 -19
  59. data/lib/solargraph/language_server/message/extended/search.rb +20 -20
  60. data/lib/solargraph/language_server/message/initialize.rb +197 -191
  61. data/lib/solargraph/language_server/message/text_document/completion.rb +10 -8
  62. data/lib/solargraph/language_server/message/text_document/definition.rb +41 -32
  63. data/lib/solargraph/language_server/message/text_document/document_highlight.rb +23 -16
  64. data/lib/solargraph/language_server/message/text_document/document_symbol.rb +29 -19
  65. data/lib/solargraph/language_server/message/text_document/formatting.rb +8 -6
  66. data/lib/solargraph/language_server/message/text_document/hover.rb +5 -5
  67. data/lib/solargraph/language_server/message/text_document/prepare_rename.rb +18 -11
  68. data/lib/solargraph/language_server/message/text_document/references.rb +23 -16
  69. data/lib/solargraph/language_server/message/text_document/rename.rb +26 -19
  70. data/lib/solargraph/language_server/message/text_document/signature_help.rb +3 -2
  71. data/lib/solargraph/language_server/message/text_document/type_definition.rb +25 -17
  72. data/lib/solargraph/language_server/message/workspace/did_change_configuration.rb +41 -35
  73. data/lib/solargraph/language_server/message/workspace/did_change_watched_files.rb +48 -40
  74. data/lib/solargraph/language_server/message/workspace/did_change_workspace_folders.rb +32 -26
  75. data/lib/solargraph/language_server/message/workspace/workspace_symbol.rb +27 -17
  76. data/lib/solargraph/language_server/message.rb +94 -94
  77. data/lib/solargraph/language_server/request.rb +29 -27
  78. data/lib/solargraph/language_server/transport/data_reader.rb +72 -74
  79. data/lib/solargraph/language_server/uri_helpers.rb +49 -49
  80. data/lib/solargraph/library.rb +85 -44
  81. data/lib/solargraph/location.rb +17 -14
  82. data/lib/solargraph/logging.rb +24 -4
  83. data/lib/solargraph/page.rb +92 -92
  84. data/lib/solargraph/parser/comment_ripper.rb +19 -4
  85. data/lib/solargraph/parser/flow_sensitive_typing.rb +326 -108
  86. data/lib/solargraph/parser/node_processor/base.rb +34 -4
  87. data/lib/solargraph/parser/node_processor.rb +8 -7
  88. data/lib/solargraph/parser/parser_gem/class_methods.rb +32 -14
  89. data/lib/solargraph/parser/parser_gem/flawed_builder.rb +19 -19
  90. data/lib/solargraph/parser/parser_gem/node_chainer.rb +50 -25
  91. data/lib/solargraph/parser/parser_gem/node_methods.rb +91 -70
  92. data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +4 -4
  93. data/lib/solargraph/parser/parser_gem/node_processors/args_node.rb +13 -11
  94. data/lib/solargraph/parser/parser_gem/node_processors/begin_node.rb +9 -0
  95. data/lib/solargraph/parser/parser_gem/node_processors/block_node.rb +12 -12
  96. data/lib/solargraph/parser/parser_gem/node_processors/def_node.rb +10 -3
  97. data/lib/solargraph/parser/parser_gem/node_processors/defs_node.rb +38 -37
  98. data/lib/solargraph/parser/parser_gem/node_processors/if_node.rb +36 -6
  99. data/lib/solargraph/parser/parser_gem/node_processors/ivasgn_node.rb +5 -3
  100. data/lib/solargraph/parser/parser_gem/node_processors/lvasgn_node.rb +1 -0
  101. data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +3 -1
  102. data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +3 -3
  103. data/lib/solargraph/parser/parser_gem/node_processors/or_node.rb +22 -0
  104. data/lib/solargraph/parser/parser_gem/node_processors/orasgn_node.rb +1 -1
  105. data/lib/solargraph/parser/parser_gem/node_processors/resbody_node.rb +2 -1
  106. data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +4 -5
  107. data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +124 -113
  108. data/lib/solargraph/parser/parser_gem/node_processors/until_node.rb +29 -29
  109. data/lib/solargraph/parser/parser_gem/node_processors/when_node.rb +23 -0
  110. data/lib/solargraph/parser/parser_gem/node_processors/while_node.rb +6 -2
  111. data/lib/solargraph/parser/parser_gem/node_processors.rb +4 -0
  112. data/lib/solargraph/parser/parser_gem.rb +14 -12
  113. data/lib/solargraph/parser/region.rb +9 -3
  114. data/lib/solargraph/parser/snippet.rb +3 -1
  115. data/lib/solargraph/parser.rb +25 -23
  116. data/lib/solargraph/pin/base.rb +126 -80
  117. data/lib/solargraph/pin/base_variable.rb +273 -24
  118. data/lib/solargraph/pin/block.rb +29 -6
  119. data/lib/solargraph/pin/breakable.rb +7 -1
  120. data/lib/solargraph/pin/callable.rb +65 -21
  121. data/lib/solargraph/pin/closure.rb +7 -10
  122. data/lib/solargraph/pin/common.rb +24 -6
  123. data/lib/solargraph/pin/compound_statement.rb +55 -0
  124. data/lib/solargraph/pin/constant.rb +43 -45
  125. data/lib/solargraph/pin/conversions.rb +10 -4
  126. data/lib/solargraph/pin/delegated_method.rb +19 -8
  127. data/lib/solargraph/pin/documenting.rb +4 -2
  128. data/lib/solargraph/pin/instance_variable.rb +5 -1
  129. data/lib/solargraph/pin/keyword.rb +0 -4
  130. data/lib/solargraph/pin/local_variable.rb +15 -59
  131. data/lib/solargraph/pin/method.rb +153 -104
  132. data/lib/solargraph/pin/method_alias.rb +8 -0
  133. data/lib/solargraph/pin/namespace.rb +19 -12
  134. data/lib/solargraph/pin/parameter.rb +100 -36
  135. data/lib/solargraph/pin/proxy_type.rb +4 -1
  136. data/lib/solargraph/pin/reference/override.rb +1 -1
  137. data/lib/solargraph/pin/reference/superclass.rb +2 -0
  138. data/lib/solargraph/pin/reference.rb +19 -0
  139. data/lib/solargraph/pin/search.rb +3 -2
  140. data/lib/solargraph/pin/signature.rb +15 -12
  141. data/lib/solargraph/pin/symbol.rb +2 -1
  142. data/lib/solargraph/pin/until.rb +2 -4
  143. data/lib/solargraph/pin/while.rb +2 -4
  144. data/lib/solargraph/pin.rb +2 -0
  145. data/lib/solargraph/pin_cache.rb +490 -73
  146. data/lib/solargraph/position.rb +14 -10
  147. data/lib/solargraph/range.rb +16 -15
  148. data/lib/solargraph/rbs_map/conversions.rb +343 -214
  149. data/lib/solargraph/rbs_map/core_fills.rb +91 -84
  150. data/lib/solargraph/rbs_map/core_map.rb +24 -17
  151. data/lib/solargraph/rbs_map/stdlib_map.rb +33 -5
  152. data/lib/solargraph/rbs_map.rb +77 -32
  153. data/lib/solargraph/server_methods.rb +16 -16
  154. data/lib/solargraph/shell.rb +128 -73
  155. data/lib/solargraph/source/chain/array.rb +39 -37
  156. data/lib/solargraph/source/chain/call.rb +96 -56
  157. data/lib/solargraph/source/chain/class_variable.rb +13 -13
  158. data/lib/solargraph/source/chain/constant.rb +5 -1
  159. data/lib/solargraph/source/chain/global_variable.rb +13 -13
  160. data/lib/solargraph/source/chain/hash.rb +8 -5
  161. data/lib/solargraph/source/chain/if.rb +12 -10
  162. data/lib/solargraph/source/chain/instance_variable.rb +24 -1
  163. data/lib/solargraph/source/chain/link.rb +99 -109
  164. data/lib/solargraph/source/chain/literal.rb +9 -6
  165. data/lib/solargraph/source/chain/or.rb +10 -4
  166. data/lib/solargraph/source/chain/q_call.rb +13 -11
  167. data/lib/solargraph/source/chain/variable.rb +15 -13
  168. data/lib/solargraph/source/chain/z_super.rb +28 -30
  169. data/lib/solargraph/source/chain.rb +49 -38
  170. data/lib/solargraph/source/change.rb +12 -5
  171. data/lib/solargraph/source/cursor.rb +23 -17
  172. data/lib/solargraph/source/encoding_fixes.rb +6 -7
  173. data/lib/solargraph/source/source_chainer.rb +56 -32
  174. data/lib/solargraph/source/updater.rb +5 -1
  175. data/lib/solargraph/source.rb +59 -35
  176. data/lib/solargraph/source_map/clip.rb +48 -29
  177. data/lib/solargraph/source_map/data.rb +4 -1
  178. data/lib/solargraph/source_map/mapper.rb +71 -42
  179. data/lib/solargraph/source_map.rb +21 -9
  180. data/lib/solargraph/type_checker/problem.rb +3 -1
  181. data/lib/solargraph/type_checker/rules.rb +81 -8
  182. data/lib/solargraph/type_checker.rb +195 -120
  183. data/lib/solargraph/version.rb +1 -1
  184. data/lib/solargraph/workspace/config.rb +13 -10
  185. data/lib/solargraph/workspace/gemspecs.rb +367 -0
  186. data/lib/solargraph/workspace/require_paths.rb +1 -0
  187. data/lib/solargraph/workspace.rb +149 -30
  188. data/lib/solargraph/yard_map/helpers.rb +8 -3
  189. data/lib/solargraph/yard_map/mapper/to_method.rb +13 -7
  190. data/lib/solargraph/yard_map/mapper/to_namespace.rb +2 -1
  191. data/lib/solargraph/yard_map/mapper.rb +13 -8
  192. data/lib/solargraph/yard_tags.rb +20 -20
  193. data/lib/solargraph/yardoc.rb +33 -23
  194. data/lib/solargraph.rb +29 -8
  195. data/rbs/fills/rubygems/0/dependency.rbs +193 -0
  196. data/rbs/fills/tuple/tuple.rbs +28 -0
  197. data/rbs/shims/ast/0/node.rbs +1 -1
  198. data/rbs/shims/diff-lcs/1.5/diff-lcs.rbs +11 -0
  199. data/solargraph.gemspec +36 -34
  200. metadata +38 -33
  201. data/lib/solargraph/type_checker/checks.rb +0 -124
  202. data/lib/solargraph/type_checker/param_def.rb +0 -37
  203. data/lib/solargraph/yard_map/to_method.rb +0 -89
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b608545d678dd0531b4026bea812c79fa4bbc2de028d1e2bc1780e4160897225
4
- data.tar.gz: 60390ef3b1cc67335cfd6e894fbd3605d0e4e9328ba2ee50a3ea76740912b27e
3
+ metadata.gz: 19ddbaec3539796c7153fbf1aff54f930614e54999b5f24a2b8e4ad478c6a2e7
4
+ data.tar.gz: 90eae8d9572c92b8d850e610a7bb838154e6327c0635169812355d3838243f80
5
5
  SHA512:
6
- metadata.gz: 150c25946a8485d3a7443900e49096a489761bcff7d16056a48328478f365b1d77d66f6c93ab99d927d8d5518ae2bdb3ce14ffda5a6db0808bfb597296e076f7
7
- data.tar.gz: 47475436921ff5e04f69869a5be28a2e174ddf5a4b0ce243115bd5b5ad5c699a7370f27da76bdad88b85cb7d4462438ea11567e3c41419b7af057fa43e332535
6
+ metadata.gz: becab03886479b51dc82e71ee532204409c47693951d83c7c12fb17172ed16ab9684ac994b5450dac9cf8ee66796f44af5ad3f6f66de2d3e2786189421f262d9
7
+ data.tar.gz: 826aee919004aa45ae2d5dec314d4e3d466e79771a7f2a56e1738de93ecabdf649a8b45162d605ed5b7ea9271db17015edc2dc7e8de9a8c6557aa9785ae8fa33
data/.envrc ADDED
@@ -0,0 +1,3 @@
1
+ # current git branch
2
+ SOLARGRAPH_FORCE_VERSION=0.0.1.dev-$(git rev-parse --abbrev-ref HEAD | tr -d '\n' | tr -d '/' | tr -d '-'| tr -d '_')
3
+ export SOLARGRAPH_FORCE_VERSION
@@ -8,10 +8,10 @@ name: Linting
8
8
  on:
9
9
  workflow_dispatch: {}
10
10
  pull_request:
11
- branches: [ master ]
11
+ branches: ['*']
12
12
  push:
13
13
  branches:
14
- - 'main'
14
+ - 'master'
15
15
  tags:
16
16
  - 'v*'
17
17
 
@@ -31,13 +31,12 @@ jobs:
31
31
  - uses: ruby/setup-ruby@v1
32
32
  with:
33
33
  ruby-version: 3.4
34
- bundler: latest
35
34
  bundler-cache: true
36
- cache-version: 2025-06-06
35
+ cache-version: 2026-01-11
37
36
 
38
37
  - name: Update to best available RBS
39
38
  run: |
40
- bundle update rbs # use latest available for this Ruby version
39
+ bundle update --pre rbs # use latest available for this Ruby version
41
40
 
42
41
  - name: Restore cache of gem annotations
43
42
  id: dot-cache-restore
@@ -9,7 +9,7 @@ on:
9
9
  push:
10
10
  branches: [master]
11
11
  pull_request:
12
- branches: [master]
12
+ branches: ['*']
13
13
 
14
14
  permissions:
15
15
  contents: read
@@ -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
26
+ ruby-version: 3.4 # keep same as typecheck.yml
27
27
  bundler-cache: true
28
28
  - uses: awalsh128/cache-apt-pkgs-action@latest
29
29
  with:
@@ -34,7 +34,7 @@ jobs:
34
34
  echo 'gem "solargraph-rails"' > .Gemfile
35
35
  echo 'gem "solargraph-rspec"' >> .Gemfile
36
36
  bundle install
37
- bundle update rbs
37
+ bundle update --pre rbs
38
38
  - name: Configure to use plugins
39
39
  run: |
40
40
  bundle exec solargraph config
@@ -43,7 +43,7 @@ jobs:
43
43
  - name: Install gem types
44
44
  run: bundle exec rbs collection update
45
45
  - name: Ensure typechecking still works
46
- run: bundle exec solargraph typecheck --level typed
46
+ run: bundle exec solargraph typecheck --level strong
47
47
  - name: Ensure specs still run
48
48
  run: bundle exec rake spec
49
49
  rails:
@@ -54,7 +54,9 @@ jobs:
54
54
  - name: Set up Ruby
55
55
  uses: ruby/setup-ruby@v1
56
56
  with:
57
- ruby-version: 3.4
57
+ ruby-version: 3.4 # keep same as typecheck.yml
58
+ # See https://github.com/castwide/solargraph/actions/runs/19000135777/job/54265647107?pr=1119
59
+ rubygems: latest
58
60
  bundler-cache: false
59
61
  - uses: awalsh128/cache-apt-pkgs-action@latest
60
62
  with:
@@ -64,7 +66,7 @@ jobs:
64
66
  run: |
65
67
  echo 'gem "solargraph-rails"' > .Gemfile
66
68
  bundle install
67
- bundle update rbs
69
+ bundle update --pre rbs
68
70
  - name: Configure to use plugins
69
71
  run: |
70
72
  bundle exec solargraph config
@@ -72,7 +74,7 @@ jobs:
72
74
  - name: Install gem types
73
75
  run: bundle exec rbs collection update
74
76
  - name: Ensure typechecking still works
75
- run: bundle exec solargraph typecheck --level typed
77
+ run: bundle exec solargraph typecheck --level strong
76
78
  - name: Ensure specs still run
77
79
  run: bundle exec rake spec
78
80
  rspec:
@@ -83,7 +85,7 @@ jobs:
83
85
  - name: Set up Ruby
84
86
  uses: ruby/setup-ruby@v1
85
87
  with:
86
- ruby-version: 3.4
88
+ ruby-version: 3.4 # keep same as typecheck.yml
87
89
  bundler-cache: false
88
90
  - uses: awalsh128/cache-apt-pkgs-action@latest
89
91
  with:
@@ -93,7 +95,7 @@ jobs:
93
95
  run: |
94
96
  echo 'gem "solargraph-rspec"' >> .Gemfile
95
97
  bundle install
96
- bundle update rbs
98
+ bundle update --pre rbs
97
99
  - name: Configure to use plugins
98
100
  run: |
99
101
  bundle exec solargraph config
@@ -101,7 +103,7 @@ jobs:
101
103
  - name: Install gem types
102
104
  run: bundle exec rbs collection update
103
105
  - name: Ensure typechecking still works
104
- run: bundle exec solargraph typecheck --level typed
106
+ run: bundle exec solargraph typecheck --level strong
105
107
  - name: Ensure specs still run
106
108
  run: bundle exec rake spec
107
109
 
@@ -118,45 +120,48 @@ jobs:
118
120
  cd ..
119
121
  # git clone https://github.com/lekemula/solargraph-rspec.git
120
122
 
121
- # pending https://github.com/lekemula/solargraph-rspec/pull/30
123
+ # pending https://github.com/lekemula/solargraph-rspec/pull/31
122
124
  git clone https://github.com/apiology/solargraph-rspec.git
123
125
  cd solargraph-rspec
124
- git checkout reset_closures
126
+ git checkout test_solargraph_prereleases
125
127
  - name: Set up Ruby
126
128
  uses: ruby/setup-ruby@v1
127
129
  with:
128
- ruby-version: '3.1'
130
+ ruby-version: 3.4
129
131
  rubygems: latest
130
132
  bundler-cache: false
131
133
  - name: Install gems
132
134
  run: |
133
- set -x
135
+ set -x
134
136
 
135
- cd ../solargraph-rspec
136
- echo "gem 'solargraph', path: '../solargraph'" >> Gemfile
137
- bundle config path ${{ env.BUNDLE_PATH }}
138
- bundle install --jobs 4 --retry 3
139
- bundle exec appraisal install
140
- # @todo some kind of appraisal/bundle conflict?
141
- # https://github.com/castwide/solargraph/actions/runs/19038710934/job/54369767122?pr=1116
142
- # /home/runner/work/solargraph/solargraph-rspec/vendor/bundle/ruby/3.1.0/gems/bundler-2.6.9/lib/bundler/runtime.rb:317:in
143
- # `check_for_activated_spec!': You have already activated date
144
- # 3.5.0, but your Gemfile requires date 3.4.1. Prepending
145
- # `bundle exec` to your command may solve
146
- # this. (Gem::LoadError)
147
- bundle exec appraisal update date
148
- # For some reason on ruby 3.1 it defaults to an old version: 1.3.2
149
- # https://github.com/lekemula/solargraph-rspec/actions/runs/17814581205/job/50645370316?pr=22
150
- # We update manually to the latest
151
- bundle exec appraisal update rspec-rails
137
+ cd ../solargraph-rspec
138
+ echo "gem 'solargraph', path: '../solargraph'" >> Gemfile
139
+ bundle config path ${{ env.BUNDLE_PATH }}
140
+ bundle install --jobs 4 --retry 3
141
+ bundle exec appraisal install
142
+ # @todo some kind of appraisal/bundle conflict?
143
+ # https://github.com/castwide/solargraph/actions/runs/19038710934/job/54369767122?pr=1116
144
+ # /home/runner/work/solargraph/solargraph-rspec/vendor/bundle/ruby/3.1.0/gems/bundler-2.6.9/lib/bundler/runtime.rb:317:in
145
+ # `check_for_activated_spec!': You have already activated date
146
+ # 3.5.0, but your Gemfile requires date 3.4.1. Prepending
147
+ # `bundle exec` to your command may solve
148
+ # this. (Gem::LoadError)
149
+ bundle exec appraisal update date
150
+ # For some reason on ruby 3.1 it defaults to an old version: 1.3.2
151
+ # https://github.com/lekemula/solargraph-rspec/actions/runs/17814581205/job/50645370316?pr=22
152
+ # We update manually to the latest
153
+ bundle exec appraisal update rspec-rails
152
154
  - name: Configure .solargraph.yml
153
155
  run: |
154
156
  cd ../solargraph-rspec
155
157
  cp .solargraph.yml.example .solargraph.yml
156
- - name: Solargraph generate RSpec gems YARD and RBS pins
158
+ - name: Solargraph generate RSpec gems YARD pins
157
159
  run: |
158
160
  cd ../solargraph-rspec
159
- bundle exec appraisal rbs collection update
161
+ # solargraph-rspec's specs don't pass a workspace, so it
162
+ # doesn't know where to look for the RBS collection - let's
163
+ # not load one so that the solargraph gems command below works
164
+
160
165
  rspec_gems=$(bundle exec appraisal ruby -r './lib/solargraph-rspec' -e 'puts Solargraph::Rspec::Gems.gem_names.join(" ")' 2>/dev/null | tail -n1)
161
166
  bundle exec appraisal solargraph gems $rspec_gems
162
167
  - name: Run specs
@@ -180,6 +185,8 @@ jobs:
180
185
  # solargraph-rails supports Ruby 3.0+
181
186
  ruby-version: '3.0'
182
187
  bundler-cache: false
188
+ # https://github.com/apiology/solargraph/actions/runs/19400815835/job/55508092473?pr=17
189
+ rubygems: latest
183
190
  bundler: latest
184
191
  env:
185
192
  MATRIX_RAILS_VERSION: "7.0"
@@ -191,7 +198,7 @@ jobs:
191
198
  cd ../solargraph-rails
192
199
  echo "gem 'solargraph', path: '${GITHUB_WORKSPACE:?}'" >> Gemfile
193
200
  bundle install
194
- bundle update rbs
201
+ bundle update --pre rbs
195
202
  RAILS_DIR="$(pwd)/spec/rails7"
196
203
  export RAILS_DIR
197
204
  cd ${RAILS_DIR}
@@ -11,7 +11,7 @@ on:
11
11
  push:
12
12
  branches: [ master ]
13
13
  pull_request:
14
- branches: [ master ]
14
+ branches: ['*']
15
15
 
16
16
  permissions:
17
17
  contents: read
@@ -21,31 +21,56 @@ jobs:
21
21
  runs-on: ubuntu-latest
22
22
  strategy:
23
23
  matrix:
24
- ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
25
- rbs-version: ['3.6.1', '3.9.5', '4.0.0.dev.4']
24
+ ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0', 'head']
25
+ rbs-version: ['3.6.1', '3.8.1', '3.9.5', '3.10.0', '4.0.0.dev.5']
26
26
  # Ruby 3.0 doesn't work with RBS 3.9.4 or 4.0.0.dev.4
27
27
  exclude:
28
+ # only include the 3.0 variants we include later
28
29
  - ruby-version: '3.0'
29
- rbs-version: '3.9.5'
30
- - ruby-version: '3.0'
31
- rbs-version: '4.0.0.dev.4'
32
- # Missing require in 'rbs collection update' - hopefully
33
- # fixed in next RBS release
30
+ # only include the 3.1 variants we include later
31
+ - ruby-version: '3.1'
32
+ # only include the 3.2 variants we include later
33
+ - ruby-version: '3.2'
34
+ # only include the 3.3 variants we include later
35
+ - ruby-version: '3.3'
36
+ # only include the 3.4 variants we include later
37
+ - ruby-version: '3.4'
38
+ # only include the 4.0 variants we include later
34
39
  - ruby-version: '4.0'
40
+ # Don't exclude 'head' - let's test all RBS versions we
41
+ # can there.
42
+ #
43
+ #
44
+ # Just exclude some odd-ball compatibility issues we can't
45
+ # work around:
46
+ #
47
+ # https://github.com/castwide/solargraph/actions/runs/20627923548/job/59241444380?pr=1102
48
+ - ruby-version: 'head'
49
+ rbs-version: '3.6.1'
50
+ - ruby-version: 'head'
51
+ rbs-version: '3.8.1'
52
+ include:
53
+ - ruby-version: '3.0'
35
54
  rbs-version: '3.6.1'
55
+ - ruby-version: '3.1'
56
+ rbs-version: '3.6.1'
57
+ - ruby-version: '3.2'
58
+ rbs-version: '3.8.1'
59
+ - ruby-version: '3.3'
60
+ rbs-version: '3.9.5'
61
+ - ruby-version: '3.3'
62
+ rbs-version: '3.10.0'
63
+ - ruby-version: '3.4'
64
+ rbs-version: '4.0.0.dev.5'
36
65
  - ruby-version: '4.0'
37
- rbs-version: '4.0.0.dev.4'
66
+ rbs-version: '4.0.0.dev.5'
38
67
  steps:
39
68
  - uses: actions/checkout@v3
40
69
  - name: Set up Ruby
41
70
  uses: ruby/setup-ruby@v1
42
71
  with:
43
72
  ruby-version: ${{ matrix.ruby-version }}
44
- # see https://github.com/castwide/solargraph/actions/runs/19391419903/job/55485410493?pr=1119
45
- #
46
- # match version in Gemfile.lock and use same version below
47
- bundler: 2.5.23
48
- bundler-cache: false
73
+ bundler-cache: true
49
74
  - name: Set rbs version
50
75
  run: echo "gem 'rbs', '${{ matrix.rbs-version }}'" >> .Gemfile
51
76
  # /home/runner/.rubies/ruby-head/lib/ruby/gems/3.5.0+2/gems/rbs-3.9.4/lib/rbs.rb:11:
@@ -54,15 +79,11 @@ jobs:
54
79
  # starting from Ruby 3.6.0
55
80
  - name: Work around legacy rbs deprecation on ruby > 3.4
56
81
  run: echo "gem 'tsort'" >> .Gemfile
57
- - name: Install gems
82
+ - name: Update gems
58
83
  run: |
59
- bundle _2.5.23_ install
60
84
  bundle update rbs # use latest available for this Ruby version
61
- bundle list
62
- bundle exec solargraph pin 'Bundler::Dsl#source'
63
85
  - name: Update types
64
- run: |
65
- bundle exec rbs collection update
86
+ run: bundle exec rbs collection update
66
87
  - name: Run tests
67
88
  run: bundle exec rake spec
68
89
  undercover:
@@ -77,9 +98,9 @@ jobs:
77
98
  uses: ruby/setup-ruby@v1
78
99
  with:
79
100
  ruby-version: '3.4'
80
- bundler-cache: false
81
- - name: Install gems
82
- run: bundle install
101
+ bundler-cache: true
102
+ - name: Update types
103
+ run: bundle exec rbs collection update
83
104
  - name: Run tests
84
105
  run: bundle exec rake spec
85
106
  - name: Check PR coverage
@@ -11,7 +11,7 @@ on:
11
11
  push:
12
12
  branches: [ master ]
13
13
  pull_request:
14
- branches: [ master ]
14
+ branches: ['*']
15
15
 
16
16
  permissions:
17
17
  contents: read
@@ -32,7 +32,7 @@ jobs:
32
32
  - name: Install gems
33
33
  run: |
34
34
  bundle install
35
- bundle update rbs # use latest available for this Ruby version
35
+ bundle update --pre rbs # use latest available for this Ruby version
36
36
  - name: Install gem types
37
37
  run: bundle exec rbs collection install
38
38
  - name: Typecheck self
data/.rubocop.yml CHANGED
@@ -21,6 +21,25 @@ AllCops:
21
21
  - "vendor/**/.*"
22
22
  TargetRubyVersion: 3.0
23
23
 
24
+ Gemspec/RequiredRubyVersion:
25
+ Exclude:
26
+ - 'spec/fixtures/rdoc-lib/rdoc-lib.gemspec'
27
+ - 'spec/fixtures/rubocop-custom-version/specifications/rubocop-0.0.0.gemspec'
28
+ - 'spec/fixtures/vendored/vendor/do_not_use.gemspec'
29
+
30
+ Gemspec/DevelopmentDependencies:
31
+ EnforcedStyle: gemspec
32
+ Exclude:
33
+ - 'spec/fixtures/**/*'
34
+
35
+ Lint/EmptyFile:
36
+ Exclude:
37
+ - 'spec/fixtures/vendored/vendor/do_not_use.gemspec'
38
+
39
+ Naming/VariableName:
40
+ Exclude:
41
+ - 'spec/fixtures/unicode.rb'
42
+
24
43
  # We don't use the spec/solargraph directory
25
44
  RSpec/SpecFilePathFormat:
26
45
  Enabled: false
@@ -31,6 +50,14 @@ Style/MethodDefParentheses:
31
50
  Layout/EmptyLineAfterGuardClause:
32
51
  Enabled: false
33
52
 
53
+ Naming/AsciiIdentifiers:
54
+ Exclude:
55
+ - 'spec/fixtures/unicode.rb'
56
+
57
+ Lint/EmptyClass:
58
+ Exclude:
59
+ - spec/fixtures/**/*.rb
60
+
34
61
  Lint/UnusedMethodArgument:
35
62
  AllowUnusedKeywordArguments: true
36
63
 
@@ -48,17 +75,17 @@ Style/ClassVars:
48
75
  # improve existing code!
49
76
  #
50
77
  Metrics/AbcSize:
51
- Max: 65
78
+ Max: 110
52
79
  Metrics/MethodLength:
53
- Max: 60
80
+ Max: 70
54
81
  Metrics/ClassLength:
55
82
  Max: 500
56
83
  Metrics/CyclomaticComplexity:
57
- Max: 23
84
+ Max: 40
58
85
  Metrics/PerceivedComplexity:
59
- Max: 29
86
+ Max: 40
60
87
  RSpec/ExampleLength:
61
- Max: 17
88
+ Max: 310
62
89
 
63
90
  plugins:
64
91
  - rubocop-rspec