solargraph 0.58.3 → 0.59.0

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 (206) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +3 -0
  3. data/.github/workflows/linting.yml +6 -5
  4. data/.github/workflows/plugins.yml +46 -34
  5. data/.github/workflows/rspec.yml +15 -28
  6. data/.github/workflows/typecheck.yml +3 -2
  7. data/.rubocop.yml +38 -6
  8. data/.rubocop_todo.yml +53 -966
  9. data/CHANGELOG.md +12 -0
  10. data/Gemfile +3 -1
  11. data/README.md +3 -3
  12. data/Rakefile +26 -23
  13. data/bin/solargraph +2 -1
  14. data/lib/solargraph/api_map/cache.rb +3 -3
  15. data/lib/solargraph/api_map/constants.rb +12 -3
  16. data/lib/solargraph/api_map/index.rb +29 -18
  17. data/lib/solargraph/api_map/source_to_yard.rb +22 -9
  18. data/lib/solargraph/api_map/store.rb +39 -28
  19. data/lib/solargraph/api_map.rb +156 -72
  20. data/lib/solargraph/bench.rb +2 -3
  21. data/lib/solargraph/complex_type/conformance.rb +176 -0
  22. data/lib/solargraph/complex_type/type_methods.rb +30 -18
  23. data/lib/solargraph/complex_type/unique_type.rb +216 -57
  24. data/lib/solargraph/complex_type.rb +171 -58
  25. data/lib/solargraph/convention/data_definition/data_assignment_node.rb +1 -1
  26. data/lib/solargraph/convention/data_definition/data_definition_node.rb +7 -5
  27. data/lib/solargraph/convention/data_definition.rb +5 -2
  28. data/lib/solargraph/convention/gemfile.rb +1 -1
  29. data/lib/solargraph/convention/gemspec.rb +1 -1
  30. data/lib/solargraph/convention/rakefile.rb +1 -1
  31. data/lib/solargraph/convention/struct_definition/struct_assignment_node.rb +2 -1
  32. data/lib/solargraph/convention/struct_definition/struct_definition_node.rb +4 -3
  33. data/lib/solargraph/convention/struct_definition.rb +8 -4
  34. data/lib/solargraph/convention.rb +2 -2
  35. data/lib/solargraph/converters/dd.rb +2 -0
  36. data/lib/solargraph/converters/dl.rb +2 -0
  37. data/lib/solargraph/converters/dt.rb +2 -0
  38. data/lib/solargraph/converters/misc.rb +2 -0
  39. data/lib/solargraph/diagnostics/require_not_found.rb +1 -0
  40. data/lib/solargraph/diagnostics/rubocop.rb +11 -10
  41. data/lib/solargraph/diagnostics/rubocop_helpers.rb +5 -3
  42. data/lib/solargraph/diagnostics/type_check.rb +11 -10
  43. data/lib/solargraph/diagnostics/update_errors.rb +4 -8
  44. data/lib/solargraph/doc_map.rb +38 -39
  45. data/lib/solargraph/equality.rb +4 -4
  46. data/lib/solargraph/gem_pins.rb +6 -6
  47. data/lib/solargraph/language_server/error_codes.rb +10 -10
  48. data/lib/solargraph/language_server/host/diagnoser.rb +1 -1
  49. data/lib/solargraph/language_server/host/dispatch.rb +3 -3
  50. data/lib/solargraph/language_server/host/message_worker.rb +4 -3
  51. data/lib/solargraph/language_server/host/sources.rb +2 -1
  52. data/lib/solargraph/language_server/host.rb +30 -22
  53. data/lib/solargraph/language_server/message/base.rb +1 -1
  54. data/lib/solargraph/language_server/message/client/register_capability.rb +1 -3
  55. data/lib/solargraph/language_server/message/completion_item/resolve.rb +6 -8
  56. data/lib/solargraph/language_server/message/extended/check_gem_version.rb +12 -18
  57. data/lib/solargraph/language_server/message/extended/document.rb +1 -0
  58. data/lib/solargraph/language_server/message/extended/document_gems.rb +7 -7
  59. data/lib/solargraph/language_server/message/extended/download_core.rb +2 -1
  60. data/lib/solargraph/language_server/message/extended/search.rb +1 -1
  61. data/lib/solargraph/language_server/message/initialize.rb +20 -14
  62. data/lib/solargraph/language_server/message/text_document/completion.rb +10 -8
  63. data/lib/solargraph/language_server/message/text_document/definition.rb +41 -32
  64. data/lib/solargraph/language_server/message/text_document/document_highlight.rb +17 -10
  65. data/lib/solargraph/language_server/message/text_document/document_symbol.rb +29 -19
  66. data/lib/solargraph/language_server/message/text_document/formatting.rb +8 -6
  67. data/lib/solargraph/language_server/message/text_document/hover.rb +5 -5
  68. data/lib/solargraph/language_server/message/text_document/prepare_rename.rb +13 -6
  69. data/lib/solargraph/language_server/message/text_document/references.rb +17 -10
  70. data/lib/solargraph/language_server/message/text_document/rename.rb +20 -13
  71. data/lib/solargraph/language_server/message/text_document/signature_help.rb +3 -2
  72. data/lib/solargraph/language_server/message/text_document/type_definition.rb +25 -17
  73. data/lib/solargraph/language_server/message/workspace/did_change_configuration.rb +34 -28
  74. data/lib/solargraph/language_server/message/workspace/did_change_watched_files.rb +38 -30
  75. data/lib/solargraph/language_server/message/workspace/did_change_workspace_folders.rb +23 -17
  76. data/lib/solargraph/language_server/message/workspace/workspace_symbol.rb +27 -17
  77. data/lib/solargraph/language_server/message.rb +1 -1
  78. data/lib/solargraph/language_server/request.rb +4 -2
  79. data/lib/solargraph/language_server/transport/data_reader.rb +11 -13
  80. data/lib/solargraph/language_server/uri_helpers.rb +2 -2
  81. data/lib/solargraph/library.rb +57 -38
  82. data/lib/solargraph/location.rb +17 -14
  83. data/lib/solargraph/logging.rb +22 -4
  84. data/lib/solargraph/page.rb +1 -1
  85. data/lib/solargraph/parser/comment_ripper.rb +19 -4
  86. data/lib/solargraph/parser/flow_sensitive_typing.rb +324 -108
  87. data/lib/solargraph/parser/node_processor/base.rb +34 -4
  88. data/lib/solargraph/parser/node_processor.rb +8 -7
  89. data/lib/solargraph/parser/parser_gem/class_methods.rb +30 -14
  90. data/lib/solargraph/parser/parser_gem/flawed_builder.rb +1 -1
  91. data/lib/solargraph/parser/parser_gem/node_chainer.rb +50 -25
  92. data/lib/solargraph/parser/parser_gem/node_methods.rb +91 -70
  93. data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +4 -4
  94. data/lib/solargraph/parser/parser_gem/node_processors/args_node.rb +13 -11
  95. data/lib/solargraph/parser/parser_gem/node_processors/begin_node.rb +9 -0
  96. data/lib/solargraph/parser/parser_gem/node_processors/block_node.rb +11 -12
  97. data/lib/solargraph/parser/parser_gem/node_processors/def_node.rb +10 -3
  98. data/lib/solargraph/parser/parser_gem/node_processors/defs_node.rb +9 -8
  99. data/lib/solargraph/parser/parser_gem/node_processors/if_node.rb +36 -6
  100. data/lib/solargraph/parser/parser_gem/node_processors/ivasgn_node.rb +5 -3
  101. data/lib/solargraph/parser/parser_gem/node_processors/lvasgn_node.rb +1 -0
  102. data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +3 -1
  103. data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +3 -3
  104. data/lib/solargraph/parser/parser_gem/node_processors/or_node.rb +22 -0
  105. data/lib/solargraph/parser/parser_gem/node_processors/orasgn_node.rb +1 -1
  106. data/lib/solargraph/parser/parser_gem/node_processors/resbody_node.rb +2 -1
  107. data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +4 -5
  108. data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +124 -113
  109. data/lib/solargraph/parser/parser_gem/node_processors/until_node.rb +1 -1
  110. data/lib/solargraph/parser/parser_gem/node_processors/when_node.rb +23 -0
  111. data/lib/solargraph/parser/parser_gem/node_processors/while_node.rb +6 -2
  112. data/lib/solargraph/parser/parser_gem/node_processors.rb +4 -0
  113. data/lib/solargraph/parser/parser_gem.rb +2 -0
  114. data/lib/solargraph/parser/region.rb +9 -3
  115. data/lib/solargraph/parser/snippet.rb +3 -1
  116. data/lib/solargraph/parser.rb +2 -0
  117. data/lib/solargraph/pin/base.rb +124 -80
  118. data/lib/solargraph/pin/base_variable.rb +273 -24
  119. data/lib/solargraph/pin/block.rb +29 -6
  120. data/lib/solargraph/pin/breakable.rb +7 -1
  121. data/lib/solargraph/pin/callable.rb +65 -21
  122. data/lib/solargraph/pin/closure.rb +7 -10
  123. data/lib/solargraph/pin/common.rb +24 -6
  124. data/lib/solargraph/pin/compound_statement.rb +55 -0
  125. data/lib/solargraph/pin/constant.rb +3 -5
  126. data/lib/solargraph/pin/conversions.rb +10 -4
  127. data/lib/solargraph/pin/delegated_method.rb +19 -8
  128. data/lib/solargraph/pin/documenting.rb +4 -2
  129. data/lib/solargraph/pin/instance_variable.rb +5 -1
  130. data/lib/solargraph/pin/keyword.rb +0 -4
  131. data/lib/solargraph/pin/local_variable.rb +15 -59
  132. data/lib/solargraph/pin/method.rb +156 -104
  133. data/lib/solargraph/pin/method_alias.rb +8 -0
  134. data/lib/solargraph/pin/namespace.rb +19 -12
  135. data/lib/solargraph/pin/parameter.rb +100 -36
  136. data/lib/solargraph/pin/proxy_type.rb +4 -1
  137. data/lib/solargraph/pin/reference/override.rb +1 -1
  138. data/lib/solargraph/pin/reference/superclass.rb +2 -0
  139. data/lib/solargraph/pin/reference/type_alias.rb +16 -0
  140. data/lib/solargraph/pin/reference.rb +20 -0
  141. data/lib/solargraph/pin/search.rb +3 -2
  142. data/lib/solargraph/pin/signature.rb +15 -12
  143. data/lib/solargraph/pin/symbol.rb +2 -1
  144. data/lib/solargraph/pin/until.rb +2 -4
  145. data/lib/solargraph/pin/while.rb +2 -4
  146. data/lib/solargraph/pin.rb +2 -0
  147. data/lib/solargraph/pin_cache.rb +22 -19
  148. data/lib/solargraph/position.rb +17 -10
  149. data/lib/solargraph/range.rb +16 -15
  150. data/lib/solargraph/rbs_map/conversions.rb +358 -229
  151. data/lib/solargraph/rbs_map/core_fills.rb +18 -11
  152. data/lib/solargraph/rbs_map/core_map.rb +24 -17
  153. data/lib/solargraph/rbs_map/stdlib_map.rb +33 -5
  154. data/lib/solargraph/rbs_map.rb +76 -32
  155. data/lib/solargraph/server_methods.rb +1 -1
  156. data/lib/solargraph/shell.rb +258 -66
  157. data/lib/solargraph/source/chain/array.rb +4 -2
  158. data/lib/solargraph/source/chain/call.rb +96 -56
  159. data/lib/solargraph/source/chain/class_variable.rb +1 -1
  160. data/lib/solargraph/source/chain/constant.rb +5 -1
  161. data/lib/solargraph/source/chain/global_variable.rb +1 -1
  162. data/lib/solargraph/source/chain/hash.rb +8 -5
  163. data/lib/solargraph/source/chain/if.rb +12 -10
  164. data/lib/solargraph/source/chain/instance_variable.rb +24 -1
  165. data/lib/solargraph/source/chain/link.rb +12 -22
  166. data/lib/solargraph/source/chain/literal.rb +9 -6
  167. data/lib/solargraph/source/chain/or.rb +10 -4
  168. data/lib/solargraph/source/chain/q_call.rb +2 -0
  169. data/lib/solargraph/source/chain/variable.rb +3 -1
  170. data/lib/solargraph/source/chain/z_super.rb +1 -3
  171. data/lib/solargraph/source/chain.rb +51 -38
  172. data/lib/solargraph/source/change.rb +12 -5
  173. data/lib/solargraph/source/cursor.rb +23 -17
  174. data/lib/solargraph/source/encoding_fixes.rb +6 -7
  175. data/lib/solargraph/source/source_chainer.rb +56 -32
  176. data/lib/solargraph/source/updater.rb +5 -1
  177. data/lib/solargraph/source.rb +59 -35
  178. data/lib/solargraph/source_map/clip.rb +48 -29
  179. data/lib/solargraph/source_map/data.rb +4 -1
  180. data/lib/solargraph/source_map/mapper.rb +69 -42
  181. data/lib/solargraph/source_map.rb +21 -9
  182. data/lib/solargraph/type_checker/problem.rb +3 -1
  183. data/lib/solargraph/type_checker/rules.rb +81 -8
  184. data/lib/solargraph/type_checker.rb +195 -121
  185. data/lib/solargraph/version.rb +1 -1
  186. data/lib/solargraph/workspace/config.rb +14 -11
  187. data/lib/solargraph/workspace/gemspecs.rb +367 -0
  188. data/lib/solargraph/workspace/require_paths.rb +1 -0
  189. data/lib/solargraph/workspace.rb +50 -28
  190. data/lib/solargraph/yard_map/helpers.rb +8 -3
  191. data/lib/solargraph/yard_map/mapper/to_method.rb +13 -7
  192. data/lib/solargraph/yard_map/mapper/to_namespace.rb +2 -1
  193. data/lib/solargraph/yard_map/mapper.rb +13 -8
  194. data/lib/solargraph/yard_map.rb +17 -18
  195. data/lib/solargraph/yard_tags.rb +2 -2
  196. data/lib/solargraph/yardoc.rb +7 -4
  197. data/lib/solargraph.rb +31 -8
  198. data/rbs/fills/rubygems/0/dependency.rbs +193 -0
  199. data/rbs/fills/tuple/tuple.rbs +28 -0
  200. data/rbs/shims/ast/0/node.rbs +1 -1
  201. data/rbs/shims/diff-lcs/1.5/diff-lcs.rbs +11 -0
  202. data/solargraph.gemspec +37 -35
  203. metadata +41 -41
  204. data/lib/solargraph/type_checker/checks.rb +0 -124
  205. data/lib/solargraph/type_checker/param_def.rb +0 -37
  206. 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: 2e2913913dac1fa336d5f2a7ac51a5cc7d7afb085fc14e0aea405ec4fc6f482c
4
- data.tar.gz: 180f4779d6e070e919c8d4d1af3d4c72edb79370cbb9592671213db049254d2b
3
+ metadata.gz: 48702da784ad5e4ba9333e3389532a20af5bd0474cde01f0b00b9b07a53203ce
4
+ data.tar.gz: 93df9a47dde759e2de2f92f6e65609e4de5ba83403c4f481915e984d05111bab
5
5
  SHA512:
6
- metadata.gz: d30d4d79505a7bd37d906bd8eaf5351426e21a87ae23e922677a149dd946536c05a02debf70e1198d2f8b75dbf0a4941f9a2df34aa9ce2938b35da6458477fa5
7
- data.tar.gz: 18a7d22d68a432c3b4e7c75385852a3f6f875a77269cabdfef4e91d229c93275236f04df50d5ff527cee7ba3a3100f41151e6f50f3d5947df0cbba83a304252e
6
+ metadata.gz: 40c2a0be04ee36e8c0c7328e51e751c04becaddd5f405a302ec369bb7bae365705f75bf3852c1c99183e8ac00d58a61177216e75f60b2af9fb0d064c95496715
7
+ data.tar.gz: 41c1a1dd7c926debbb79a8f63b24e550d6b3a389ad71f09e392ce8216b66fa33b73d2a6269d5b624ecdf5aa86add0a81e40c2b3b24483a4555fb3a53d61e1e9c
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,14 @@ 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
+ # Add optional gem to be able to typecheck related code
40
+ echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
41
+ bundle install
41
42
 
42
43
  - name: Restore cache of gem annotations
43
44
  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:
@@ -33,8 +33,9 @@ jobs:
33
33
  run: |
34
34
  echo 'gem "solargraph-rails"' > .Gemfile
35
35
  echo 'gem "solargraph-rspec"' >> .Gemfile
36
+ # Add optional gem to be able to typecheck related code
37
+ echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
36
38
  bundle install
37
- bundle update rbs
38
39
  - name: Configure to use plugins
39
40
  run: |
40
41
  bundle exec solargraph config
@@ -43,7 +44,7 @@ jobs:
43
44
  - name: Install gem types
44
45
  run: bundle exec rbs collection update
45
46
  - name: Ensure typechecking still works
46
- run: bundle exec solargraph typecheck --level typed
47
+ run: bundle exec solargraph typecheck --level strong
47
48
  - name: Ensure specs still run
48
49
  run: bundle exec rake spec
49
50
  rails:
@@ -54,7 +55,9 @@ jobs:
54
55
  - name: Set up Ruby
55
56
  uses: ruby/setup-ruby@v1
56
57
  with:
57
- ruby-version: 3.4
58
+ ruby-version: 3.4 # keep same as typecheck.yml
59
+ # See https://github.com/castwide/solargraph/actions/runs/19000135777/job/54265647107?pr=1119
60
+ rubygems: latest
58
61
  bundler-cache: false
59
62
  - uses: awalsh128/cache-apt-pkgs-action@latest
60
63
  with:
@@ -63,8 +66,10 @@ jobs:
63
66
  - name: Install gems
64
67
  run: |
65
68
  echo 'gem "solargraph-rails"' > .Gemfile
69
+ # Add optional gem to be able to typecheck related code
70
+ echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
66
71
  bundle install
67
- bundle update rbs
72
+ bundle update --pre rbs
68
73
  - name: Configure to use plugins
69
74
  run: |
70
75
  bundle exec solargraph config
@@ -72,7 +77,7 @@ jobs:
72
77
  - name: Install gem types
73
78
  run: bundle exec rbs collection update
74
79
  - name: Ensure typechecking still works
75
- run: bundle exec solargraph typecheck --level typed
80
+ run: bundle exec solargraph typecheck --level strong
76
81
  - name: Ensure specs still run
77
82
  run: bundle exec rake spec
78
83
  rspec:
@@ -83,7 +88,7 @@ jobs:
83
88
  - name: Set up Ruby
84
89
  uses: ruby/setup-ruby@v1
85
90
  with:
86
- ruby-version: 3.4
91
+ ruby-version: 3.4 # keep same as typecheck.yml
87
92
  bundler-cache: false
88
93
  - uses: awalsh128/cache-apt-pkgs-action@latest
89
94
  with:
@@ -92,8 +97,10 @@ jobs:
92
97
  - name: Install gems
93
98
  run: |
94
99
  echo 'gem "solargraph-rspec"' >> .Gemfile
100
+ # Add optional gem to be able to typecheck related code
101
+ echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
95
102
  bundle install
96
- bundle update rbs
103
+ bundle update --pre rbs
97
104
  - name: Configure to use plugins
98
105
  run: |
99
106
  bundle exec solargraph config
@@ -101,7 +108,7 @@ jobs:
101
108
  - name: Install gem types
102
109
  run: bundle exec rbs collection update
103
110
  - name: Ensure typechecking still works
104
- run: bundle exec solargraph typecheck --level typed
111
+ run: bundle exec solargraph typecheck --level strong
105
112
  - name: Ensure specs still run
106
113
  run: bundle exec rake spec
107
114
 
@@ -118,45 +125,48 @@ jobs:
118
125
  cd ..
119
126
  # git clone https://github.com/lekemula/solargraph-rspec.git
120
127
 
121
- # pending https://github.com/lekemula/solargraph-rspec/pull/30
128
+ # pending https://github.com/lekemula/solargraph-rspec/pull/31
122
129
  git clone https://github.com/apiology/solargraph-rspec.git
123
130
  cd solargraph-rspec
124
- git checkout reset_closures
131
+ git checkout test_solargraph_prereleases
125
132
  - name: Set up Ruby
126
133
  uses: ruby/setup-ruby@v1
127
134
  with:
128
- ruby-version: '3.2'
135
+ ruby-version: 3.4
129
136
  rubygems: latest
130
137
  bundler-cache: false
131
138
  - name: Install gems
132
139
  run: |
133
- set -x
140
+ set -x
134
141
 
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
142
+ cd ../solargraph-rspec
143
+ echo "gem 'solargraph', path: '../solargraph'" >> Gemfile
144
+ bundle config path ${{ env.BUNDLE_PATH }}
145
+ bundle install --jobs 4 --retry 3
146
+ bundle exec appraisal install
147
+ # @todo some kind of appraisal/bundle conflict?
148
+ # https://github.com/castwide/solargraph/actions/runs/19038710934/job/54369767122?pr=1116
149
+ # /home/runner/work/solargraph/solargraph-rspec/vendor/bundle/ruby/3.1.0/gems/bundler-2.6.9/lib/bundler/runtime.rb:317:in
150
+ # `check_for_activated_spec!': You have already activated date
151
+ # 3.5.0, but your Gemfile requires date 3.4.1. Prepending
152
+ # `bundle exec` to your command may solve
153
+ # this. (Gem::LoadError)
154
+ bundle exec appraisal update date
155
+ # For some reason on ruby 3.1 it defaults to an old version: 1.3.2
156
+ # https://github.com/lekemula/solargraph-rspec/actions/runs/17814581205/job/50645370316?pr=22
157
+ # We update manually to the latest
158
+ bundle exec appraisal update rspec-rails
152
159
  - name: Configure .solargraph.yml
153
160
  run: |
154
161
  cd ../solargraph-rspec
155
162
  cp .solargraph.yml.example .solargraph.yml
156
- - name: Solargraph generate RSpec gems YARD and RBS pins
163
+ - name: Solargraph generate RSpec gems YARD pins
157
164
  run: |
158
165
  cd ../solargraph-rspec
159
- bundle exec appraisal rbs collection update
166
+ # solargraph-rspec's specs don't pass a workspace, so it
167
+ # doesn't know where to look for the RBS collection - let's
168
+ # not load one so that the solargraph gems command below works
169
+
160
170
  rspec_gems=$(bundle exec appraisal ruby -r './lib/solargraph-rspec' -e 'puts Solargraph::Rspec::Gems.gem_names.join(" ")' 2>/dev/null | tail -n1)
161
171
  bundle exec appraisal solargraph gems $rspec_gems
162
172
  - name: Run specs
@@ -181,6 +191,8 @@ jobs:
181
191
  # This job uses 3.2 due to a problem compiling sqlite3 in earlier versions
182
192
  ruby-version: '3.2'
183
193
  bundler-cache: false
194
+ # https://github.com/apiology/solargraph/actions/runs/19400815835/job/55508092473?pr=17
195
+ rubygems: latest
184
196
  bundler: latest
185
197
  env:
186
198
  MATRIX_RAILS_VERSION: "7.0"
@@ -192,7 +204,7 @@ jobs:
192
204
  cd ../solargraph-rails
193
205
  echo "gem 'solargraph', path: '${GITHUB_WORKSPACE:?}'" >> Gemfile
194
206
  bundle install
195
- bundle update rbs
207
+ bundle update --pre rbs
196
208
  RAILS_DIR="$(pwd)/spec/rails7"
197
209
  export RAILS_DIR
198
210
  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,22 @@ 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']
26
- # Ruby 3.0 doesn't work with RBS 3.9.4 or 4.0.0.dev.4
24
+ ruby-version: ['3.1', '3.2', '3.3', '3.4', '4.0', 'head']
25
+ rbs-version: ['3.10.0', '4.0.0', '4.0.1', '4.0.2']
27
26
  exclude:
28
- - 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
34
- - ruby-version: '4.0'
35
- rbs-version: '3.6.1'
36
- - ruby-version: '4.0'
37
- rbs-version: '4.0.0.dev.4'
27
+ - ruby-version: '3.1'
28
+ rbs-version: '4.0.0'
29
+ - ruby-version: '3.1'
30
+ rbs-version: '4.0.1'
31
+ - ruby-version: '3.1'
32
+ rbs-version: '4.0.2'
38
33
  steps:
39
34
  - uses: actions/checkout@v3
40
35
  - name: Set up Ruby
41
36
  uses: ruby/setup-ruby@v1
42
37
  with:
43
38
  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
39
+ bundler-cache: true
49
40
  - name: Set rbs version
50
41
  run: echo "gem 'rbs', '${{ matrix.rbs-version }}'" >> .Gemfile
51
42
  # /home/runner/.rubies/ruby-head/lib/ruby/gems/3.5.0+2/gems/rbs-3.9.4/lib/rbs.rb:11:
@@ -54,15 +45,11 @@ jobs:
54
45
  # starting from Ruby 3.6.0
55
46
  - name: Work around legacy rbs deprecation on ruby > 3.4
56
47
  run: echo "gem 'tsort'" >> .Gemfile
57
- - name: Install gems
48
+ - name: Update gems
58
49
  run: |
59
- bundle _2.5.23_ install
60
50
  bundle update rbs # use latest available for this Ruby version
61
- bundle list
62
- bundle exec solargraph pin 'Bundler::Dsl#source'
63
51
  - name: Update types
64
- run: |
65
- bundle exec rbs collection update
52
+ run: bundle exec rbs collection update
66
53
  - name: Run tests
67
54
  run: bundle exec rake spec
68
55
  undercover:
@@ -77,9 +64,9 @@ jobs:
77
64
  uses: ruby/setup-ruby@v1
78
65
  with:
79
66
  ruby-version: '3.4'
80
- bundler-cache: false
81
- - name: Install gems
82
- run: bundle install
67
+ bundler-cache: true
68
+ - name: Update types
69
+ run: bundle exec rbs collection update
83
70
  - name: Run tests
84
71
  run: bundle exec rake spec
85
72
  - 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
@@ -31,8 +31,9 @@ jobs:
31
31
  bundler-cache: false
32
32
  - name: Install gems
33
33
  run: |
34
+ # Add optional gem to be able to typecheck related code
35
+ echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
34
36
  bundle install
35
- bundle update rbs # use latest available for this Ruby version
36
37
  - name: Install gem types
37
38
  run: bundle exec rbs collection install
38
39
  - name: Typecheck self
data/.rubocop.yml CHANGED
@@ -19,7 +19,26 @@ AllCops:
19
19
  - "spec/fixtures/invalid_utf8.rb"
20
20
  - "vendor/**/*"
21
21
  - "vendor/**/.*"
22
- TargetRubyVersion: 3.0
22
+ TargetRubyVersion: 3.1
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'
23
42
 
24
43
  # We don't use the spec/solargraph directory
25
44
  RSpec/SpecFilePathFormat:
@@ -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
 
@@ -42,23 +69,28 @@ Metrics/ParameterLists:
42
69
  Style/ClassVars:
43
70
  Enabled: false
44
71
 
72
+ # Allow $stderr.puts for communication with users as 'warn' can be
73
+ # suppressed for unrelated reasons.
74
+ Style/StderrPuts:
75
+ Enabled: false
76
+
45
77
  #
46
78
  # Set a relaxed standard on harder-to-address item for ease of
47
79
  # contribution - if you are good at refactoring, we welcome PRs to
48
80
  # improve existing code!
49
81
  #
50
82
  Metrics/AbcSize:
51
- Max: 65
83
+ Max: 110
52
84
  Metrics/MethodLength:
53
- Max: 60
85
+ Max: 70
54
86
  Metrics/ClassLength:
55
87
  Max: 500
56
88
  Metrics/CyclomaticComplexity:
57
- Max: 23
89
+ Max: 40
58
90
  Metrics/PerceivedComplexity:
59
- Max: 29
91
+ Max: 40
60
92
  RSpec/ExampleLength:
61
- Max: 17
93
+ Max: 310
62
94
 
63
95
  plugins:
64
96
  - rubocop-rspec