solargraph 0.57.0 → 0.58.1
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/.gitattributes +2 -0
- data/.github/workflows/linting.yml +4 -2
- data/.github/workflows/plugins.yml +61 -27
- data/.github/workflows/rspec.yml +19 -4
- data/.github/workflows/typecheck.yml +2 -2
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +90 -1438
- data/CHANGELOG.md +30 -0
- data/Rakefile +1 -1
- data/bin/solargraph +3 -0
- data/lib/solargraph/api_map/constants.rb +107 -46
- data/lib/solargraph/api_map/index.rb +32 -8
- data/lib/solargraph/api_map/source_to_yard.rb +5 -2
- data/lib/solargraph/api_map/store.rb +22 -12
- data/lib/solargraph/api_map.rb +27 -33
- data/lib/solargraph/complex_type/type_methods.rb +5 -0
- data/lib/solargraph/complex_type/unique_type.rb +12 -5
- data/lib/solargraph/complex_type.rb +19 -2
- data/lib/solargraph/convention/active_support_concern.rb +1 -1
- data/lib/solargraph/convention/data_definition/data_definition_node.rb +1 -1
- data/lib/solargraph/diagnostics/rubocop_helpers.rb +4 -2
- data/lib/solargraph/doc_map.rb +9 -6
- data/lib/solargraph/environ.rb +1 -1
- data/lib/solargraph/equality.rb +1 -0
- data/lib/solargraph/gem_pins.rb +4 -0
- data/lib/solargraph/language_server/host.rb +10 -4
- data/lib/solargraph/language_server/message/text_document/definition.rb +2 -2
- data/lib/solargraph/language_server/message/text_document/formatting.rb +4 -1
- data/lib/solargraph/language_server/message/text_document/type_definition.rb +1 -1
- data/lib/solargraph/language_server/progress.rb +1 -1
- data/lib/solargraph/language_server/request.rb +3 -1
- data/lib/solargraph/library.rb +3 -3
- data/lib/solargraph/location.rb +1 -0
- data/lib/solargraph/page.rb +0 -1
- data/lib/solargraph/parser/flow_sensitive_typing.rb +1 -1
- data/lib/solargraph/parser/parser_gem/class_methods.rb +2 -12
- data/lib/solargraph/parser/parser_gem/node_methods.rb +1 -14
- data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +1 -0
- data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +64 -8
- data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +12 -3
- data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +4 -5
- data/lib/solargraph/pin/base.rb +29 -8
- data/lib/solargraph/pin/base_variable.rb +5 -3
- data/lib/solargraph/pin/block.rb +3 -2
- data/lib/solargraph/pin/callable.rb +6 -2
- data/lib/solargraph/pin/closure.rb +3 -7
- data/lib/solargraph/pin/delegated_method.rb +0 -1
- data/lib/solargraph/pin/local_variable.rb +0 -4
- data/lib/solargraph/pin/method.rb +20 -4
- data/lib/solargraph/pin/parameter.rb +6 -2
- data/lib/solargraph/pin/proxy_type.rb +4 -1
- data/lib/solargraph/pin/reference.rb +2 -11
- data/lib/solargraph/pin/search.rb +3 -0
- data/lib/solargraph/pin_cache.rb +5 -5
- data/lib/solargraph/position.rb +1 -0
- data/lib/solargraph/range.rb +4 -0
- data/lib/solargraph/rbs_map/conversions.rb +22 -1
- data/lib/solargraph/rbs_map/core_fills.rb +18 -0
- data/lib/solargraph/rbs_map/core_map.rb +11 -7
- data/lib/solargraph/rbs_map.rb +2 -2
- data/lib/solargraph/shell.rb +82 -1
- data/lib/solargraph/source/chain/call.rb +7 -3
- data/lib/solargraph/source/chain/constant.rb +3 -66
- data/lib/solargraph/source/chain/if.rb +1 -1
- data/lib/solargraph/source/chain/link.rb +1 -1
- data/lib/solargraph/source/chain/or.rb +1 -1
- data/lib/solargraph/source/chain.rb +2 -0
- data/lib/solargraph/source/encoding_fixes.rb +23 -23
- data/lib/solargraph/source.rb +1 -1
- data/lib/solargraph/source_map/clip.rb +17 -25
- data/lib/solargraph/source_map/mapper.rb +0 -2
- data/lib/solargraph/source_map.rb +8 -3
- data/lib/solargraph/type_checker/rules.rb +23 -9
- data/lib/solargraph/type_checker.rb +133 -71
- data/lib/solargraph/version.rb +5 -5
- data/lib/solargraph/workspace/config.rb +21 -3
- data/lib/solargraph/workspace/require_paths.rb +0 -1
- data/lib/solargraph/workspace.rb +14 -19
- data/lib/solargraph/yard_map/mapper/to_method.rb +2 -1
- data/lib/solargraph/yard_map/mapper/to_namespace.rb +1 -0
- data/lib/solargraph/yard_map/to_method.rb +2 -1
- data/lib/solargraph/yardoc.rb +27 -4
- data/rbs/fills/bundler/0/bundler.rbs +4271 -0
- data/rbs/fills/open3/0/open3.rbs +172 -0
- data/rbs/fills/rubygems/0/basic_specification.rbs +326 -0
- data/rbs/fills/rubygems/0/errors.rbs +364 -0
- data/rbs/fills/rubygems/0/spec_fetcher.rbs +107 -0
- data/rbs/fills/rubygems/0/specification.rbs +1753 -0
- data/rbs_collection.yaml +4 -4
- data/sig/shims/ast/0/node.rbs +5 -0
- data/sig/shims/ast/2.4/.rbs_meta.yaml +9 -0
- data/sig/shims/ast/2.4/ast.rbs +73 -0
- data/sig/shims/parser/3.2.0.1/manifest.yaml +7 -0
- data/sig/shims/parser/3.2.0.1/parser.rbs +201 -0
- data/sig/shims/parser/3.2.0.1/polyfill.rbs +4 -0
- data/solargraph.gemspec +15 -4
- metadata +67 -12
- data/lib/solargraph/parser/node_methods.rb +0 -97
- /data/rbs/fills/{tuple.rbs → tuple/tuple.rbs} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31aee8c6c10b4c153a7cdd4da7c5d94748b702234df69302dc642d5956b87320
|
|
4
|
+
data.tar.gz: 9579e90add3bb40c8a0c348a2111f6b4626f6bf7a5fd11a4d5d35aa4fa8d98b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: feb5d83ea7f7143805119c52e77c6109f454a3b46485b2a574a2a53c2bd726b040310f6bc5a874044798f5ac40b8dd015b38d67204d2b9343f601a0e74385154
|
|
7
|
+
data.tar.gz: '09a728082ed231fd8dd93c8ba2c1480727e75c91ac92c11ef752e3a228729c357f9c7b9d4a9536ff0a1c92278a1c2904a86964206c7fc0293cd82226693c165d'
|
data/.gitattributes
ADDED
|
@@ -115,11 +115,13 @@ jobs:
|
|
|
115
115
|
- name: Run RuboCop against todo file
|
|
116
116
|
continue-on-error: true
|
|
117
117
|
run: |
|
|
118
|
-
bundle exec rubocop --auto-gen-config --
|
|
118
|
+
cmd="bundle exec rubocop --auto-gen-config --exclude-limit=5 --no-offense-counts --no-auto-gen-timestamp"
|
|
119
|
+
${cmd:?}
|
|
120
|
+
set +e
|
|
119
121
|
if [ -n "$(git status --porcelain)" ]
|
|
120
122
|
then
|
|
121
123
|
git status --porcelain
|
|
122
124
|
git diff -u .
|
|
123
|
-
>&2 echo "Please
|
|
125
|
+
>&2 echo "Please address any new issues, then run '${cmd:?}' and push up any improvements"
|
|
124
126
|
exit 1
|
|
125
127
|
fi
|
|
@@ -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: 3.4
|
|
27
27
|
bundler-cache: true
|
|
28
28
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
29
29
|
with:
|
|
@@ -54,7 +54,7 @@ jobs:
|
|
|
54
54
|
- name: Set up Ruby
|
|
55
55
|
uses: ruby/setup-ruby@v1
|
|
56
56
|
with:
|
|
57
|
-
ruby-version:
|
|
57
|
+
ruby-version: 3.4
|
|
58
58
|
bundler-cache: false
|
|
59
59
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
60
60
|
with:
|
|
@@ -83,7 +83,7 @@ jobs:
|
|
|
83
83
|
- name: Set up Ruby
|
|
84
84
|
uses: ruby/setup-ruby@v1
|
|
85
85
|
with:
|
|
86
|
-
ruby-version:
|
|
86
|
+
ruby-version: 3.4
|
|
87
87
|
bundler-cache: false
|
|
88
88
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
89
89
|
with:
|
|
@@ -105,30 +105,64 @@ jobs:
|
|
|
105
105
|
- name: Ensure specs still run
|
|
106
106
|
run: bundle exec rake spec
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
108
|
+
run_solargraph_rspec_specs:
|
|
109
|
+
# check out solargraph-rspec as well as this project, and point the former to use the latter as a local gem
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
env:
|
|
112
|
+
SOLARGRAPH_CACHE: ${{ github.workspace }}/../solargraph-rspec/vendor/solargraph/cache
|
|
113
|
+
BUNDLE_PATH: ${{ github.workspace }}/../solargraph-rspec/vendor/bundle
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/checkout@v3
|
|
116
|
+
- name: clone https://github.com/lekemula/solargraph-rspec/
|
|
117
|
+
run: |
|
|
118
|
+
cd ..
|
|
119
|
+
# git clone https://github.com/lekemula/solargraph-rspec.git
|
|
120
|
+
|
|
121
|
+
# pending https://github.com/lekemula/solargraph-rspec/pull/30
|
|
122
|
+
git clone https://github.com/apiology/solargraph-rspec.git
|
|
123
|
+
cd solargraph-rspec
|
|
124
|
+
git checkout reset_closures
|
|
125
|
+
- name: Set up Ruby
|
|
126
|
+
uses: ruby/setup-ruby@v1
|
|
127
|
+
with:
|
|
128
|
+
ruby-version: '3.1'
|
|
129
|
+
rubygems: latest
|
|
130
|
+
bundler-cache: false
|
|
131
|
+
- name: Install gems
|
|
132
|
+
run: |
|
|
133
|
+
set -x
|
|
134
|
+
|
|
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
|
|
152
|
+
- name: Configure .solargraph.yml
|
|
153
|
+
run: |
|
|
154
|
+
cd ../solargraph-rspec
|
|
155
|
+
cp .solargraph.yml.example .solargraph.yml
|
|
156
|
+
- name: Solargraph generate RSpec gems YARD and RBS pins
|
|
157
|
+
run: |
|
|
158
|
+
cd ../solargraph-rspec
|
|
159
|
+
bundle exec appraisal rbs collection update
|
|
160
|
+
rspec_gems=$(bundle exec appraisal ruby -r './lib/solargraph-rspec' -e 'puts Solargraph::Rspec::Gems.gem_names.join(" ")' 2>/dev/null | tail -n1)
|
|
161
|
+
bundle exec appraisal solargraph gems $rspec_gems
|
|
162
|
+
- name: Run specs
|
|
163
|
+
run: |
|
|
164
|
+
cd ../solargraph-rspec
|
|
165
|
+
bundle exec appraisal rspec --format progress
|
|
132
166
|
|
|
133
167
|
run_solargraph_rails_specs:
|
|
134
168
|
# check out solargraph-rails as well as this project, and point the former to use the latter as a local gem
|
data/.github/workflows/rspec.yml
CHANGED
|
@@ -21,20 +21,30 @@ 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', '
|
|
25
|
-
rbs-version: ['3.6.1', '3.9.
|
|
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
26
|
# Ruby 3.0 doesn't work with RBS 3.9.4 or 4.0.0.dev.4
|
|
27
27
|
exclude:
|
|
28
28
|
- ruby-version: '3.0'
|
|
29
|
-
rbs-version: '3.9.
|
|
29
|
+
rbs-version: '3.9.5'
|
|
30
30
|
- ruby-version: '3.0'
|
|
31
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'
|
|
32
38
|
steps:
|
|
33
39
|
- uses: actions/checkout@v3
|
|
34
40
|
- name: Set up Ruby
|
|
35
41
|
uses: ruby/setup-ruby@v1
|
|
36
42
|
with:
|
|
37
43
|
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
|
|
38
48
|
bundler-cache: false
|
|
39
49
|
- name: Set rbs version
|
|
40
50
|
run: echo "gem 'rbs', '${{ matrix.rbs-version }}'" >> .Gemfile
|
|
@@ -46,8 +56,13 @@ jobs:
|
|
|
46
56
|
run: echo "gem 'tsort'" >> .Gemfile
|
|
47
57
|
- name: Install gems
|
|
48
58
|
run: |
|
|
49
|
-
bundle install
|
|
59
|
+
bundle _2.5.23_ install
|
|
50
60
|
bundle update rbs # use latest available for this Ruby version
|
|
61
|
+
bundle list
|
|
62
|
+
bundle exec solargraph pin 'Bundler::Dsl#source'
|
|
63
|
+
- name: Update types
|
|
64
|
+
run: |
|
|
65
|
+
bundle exec rbs collection update
|
|
51
66
|
- name: Run tests
|
|
52
67
|
run: bundle exec rake spec
|
|
53
68
|
undercover:
|
|
@@ -18,7 +18,7 @@ permissions:
|
|
|
18
18
|
|
|
19
19
|
jobs:
|
|
20
20
|
solargraph_typed:
|
|
21
|
-
name: Solargraph /
|
|
21
|
+
name: Solargraph / strong
|
|
22
22
|
|
|
23
23
|
runs-on: ubuntu-latest
|
|
24
24
|
|
|
@@ -36,4 +36,4 @@ jobs:
|
|
|
36
36
|
- name: Install gem types
|
|
37
37
|
run: bundle exec rbs collection install
|
|
38
38
|
- name: Typecheck self
|
|
39
|
-
run: SOLARGRAPH_ASSERTS=on bundle exec solargraph typecheck --level
|
|
39
|
+
run: SOLARGRAPH_ASSERTS=on bundle exec solargraph typecheck --level strong
|
data/.rubocop.yml
CHANGED
|
@@ -21,6 +21,7 @@ AllCops:
|
|
|
21
21
|
- "vendor/**/.*"
|
|
22
22
|
TargetRubyVersion: 3.0
|
|
23
23
|
|
|
24
|
+
# We don't use the spec/solargraph directory
|
|
24
25
|
RSpec/SpecFilePathFormat:
|
|
25
26
|
Enabled: false
|
|
26
27
|
|
|
@@ -37,7 +38,6 @@ Metrics/ParameterLists:
|
|
|
37
38
|
Max: 7
|
|
38
39
|
CountKeywordArgs: false
|
|
39
40
|
|
|
40
|
-
|
|
41
41
|
# we tend to use @@ and the risk doesn't seem high
|
|
42
42
|
Style/ClassVars:
|
|
43
43
|
Enabled: false
|