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