solargraph-rails 1.2.3 → 1.3
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/.github/workflows/linter.yml +2 -2
- data/.github/workflows/rails_new.yml +101 -0
- data/.github/workflows/test.yml +13 -11
- data/.github/workflows/typecheck.yml +1 -1
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +29 -30
- data/CHANGELOG.md +19 -0
- data/DEVELOPMENT.md +2 -2
- data/Gemfile +7 -4
- data/lib/solargraph/rails/annotations/action_controller.rb +65 -63
- data/lib/solargraph/rails/annotations/active_record.rb +135 -0
- data/lib/solargraph/rails/importmap.rb +29 -0
- data/lib/solargraph/rails/puma.rb +29 -0
- data/lib/solargraph/rails/version.rb +1 -1
- data/lib/solargraph-rails.rb +21 -2
- data/solargraph-rails.gemspec +5 -9
- metadata +9 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b24e92621f34f70e86ce1e93841489deac1c977cc12f80bcb5d097fd0ba2e7c
|
|
4
|
+
data.tar.gz: 8d0299494e027dd55fa9270e4aa7212c00b768c5952cf223f2b998bdb224de20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b63b981c50f993725af679aa99ed89572656005c5114e408c90d33b37fbdcc450be4ddd0e07cd2876babf41f0b4efc84e0b866a121ca94a5e79b1592e8383552
|
|
7
|
+
data.tar.gz: 0a1ed573aa727c4aa0a96488c23e27ce34f813840ec44f0c58d6d214c6d49df0d53e9158a648bb2101fe0fff901097979e045906f0b60baaf329b123bbb75f7b
|
|
@@ -31,7 +31,7 @@ jobs:
|
|
|
31
31
|
rails-minor: "0"
|
|
32
32
|
run_coverage: true
|
|
33
33
|
solargraph-version:
|
|
34
|
-
- "
|
|
34
|
+
- "branch-castwide-master"
|
|
35
35
|
fail-fast: false
|
|
36
36
|
steps:
|
|
37
37
|
- uses: actions/checkout@v2
|
|
@@ -42,7 +42,7 @@ jobs:
|
|
|
42
42
|
- uses: ruby/setup-ruby@v1
|
|
43
43
|
with:
|
|
44
44
|
ruby-version: 3.4
|
|
45
|
-
bundler:
|
|
45
|
+
bundler: Gemfile.lock
|
|
46
46
|
bundler-cache: true
|
|
47
47
|
cache-version: ${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}-2025-06-06
|
|
48
48
|
env:
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# To debug locally:
|
|
2
|
+
# npm install -g act
|
|
3
|
+
# act pull_request
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
name: New Rails project
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
workflow_dispatch: {}
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [main]
|
|
12
|
+
push:
|
|
13
|
+
branches:
|
|
14
|
+
- 'main'
|
|
15
|
+
tags:
|
|
16
|
+
- 'v*'
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
typecheck_strong:
|
|
20
|
+
name: strong typecheck
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
strategy:
|
|
23
|
+
matrix:
|
|
24
|
+
versions:
|
|
25
|
+
# ruby 3.2 is minimum Ruby supported by Rails 8.0
|
|
26
|
+
- ruby: "3.2"
|
|
27
|
+
rails-major: "8"
|
|
28
|
+
rails-minor: "0"
|
|
29
|
+
- ruby: "3.2"
|
|
30
|
+
rails-major: "7"
|
|
31
|
+
rails-minor: "0"
|
|
32
|
+
- ruby: "3.2"
|
|
33
|
+
rails-major: "7"
|
|
34
|
+
rails-minor: "1"
|
|
35
|
+
fail-fast: false
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v2
|
|
38
|
+
- uses: ruby/setup-ruby@v1
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: ${{ matrix.versions.ruby }}
|
|
41
|
+
bundler: Gemfile.lock
|
|
42
|
+
bundler-cache: true
|
|
43
|
+
cache-version: ${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}-2025-09-09
|
|
44
|
+
env:
|
|
45
|
+
MATRIX_RAILS_MAJOR_VERSION: ${{ matrix.versions.rails-major }}
|
|
46
|
+
MATRIX_RAILS_VERSION: ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}
|
|
47
|
+
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
48
|
+
with:
|
|
49
|
+
packages: yq
|
|
50
|
+
version: 1.0
|
|
51
|
+
- name: Restore cache of gem annotations
|
|
52
|
+
id: dot-cache-restore
|
|
53
|
+
uses: actions/cache/restore@v4
|
|
54
|
+
with:
|
|
55
|
+
key: |
|
|
56
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}--${{ matrix.versions.rails-minor }}-${{ hashFiles('spec/**/Gemfile.lock') }}-${{ hashFiles('Gemfile.lock') }}
|
|
57
|
+
restore-keys: |
|
|
58
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}-${{ matrix.versions.rails-minor }}-${{ hashFiles('spec/**/Gemfile.lock') }}-
|
|
59
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}-${{ matrix.versions.rails-minor }}-
|
|
60
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}-
|
|
61
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-
|
|
62
|
+
path: |
|
|
63
|
+
/home/runner/.cache/solargraph
|
|
64
|
+
|
|
65
|
+
- name: Typecheck default 'rails new' code
|
|
66
|
+
run: |
|
|
67
|
+
set -ex
|
|
68
|
+
bundle update solargraph
|
|
69
|
+
gem install rails -v '~> ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}.0'
|
|
70
|
+
gem uninstall -I concurrent-ruby
|
|
71
|
+
# https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror
|
|
72
|
+
gem install concurrent-ruby -v 1.3.4
|
|
73
|
+
pwd
|
|
74
|
+
cd ..
|
|
75
|
+
rails new test-project
|
|
76
|
+
cd test-project
|
|
77
|
+
echo 'gem "solargraph-rails", path: "../solargraph-rails"' >> Gemfile
|
|
78
|
+
echo 'gem "solargraph", github: "castwide/solargraph", branch: "master"' >> Gemfile
|
|
79
|
+
# https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror
|
|
80
|
+
echo "gem 'concurrent-ruby', '1.3.4'" >> Gemfile
|
|
81
|
+
bundle install
|
|
82
|
+
bundle info solargraph
|
|
83
|
+
bundle info solargraph-rails
|
|
84
|
+
bin/rails --version
|
|
85
|
+
bundle exec rbs collection init
|
|
86
|
+
bundle exec rbs collection install
|
|
87
|
+
bundle exec solargraph config
|
|
88
|
+
yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml
|
|
89
|
+
bundle exec solargraph typecheck --level strong
|
|
90
|
+
env:
|
|
91
|
+
MATRIX_RAILS_MAJOR_VERSION: ${{ matrix.versions.rails-major }}
|
|
92
|
+
MATRIX_RAILS_VERSION: ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}
|
|
93
|
+
- name: Cache gem annotations
|
|
94
|
+
id: dot-cache-save
|
|
95
|
+
if: always() && steps.dot-cache-restore.outputs.cache-hit != 'true'
|
|
96
|
+
uses: actions/cache/save@v4
|
|
97
|
+
with:
|
|
98
|
+
key: |
|
|
99
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}--${{ matrix.versions.rails-minor }}-${{ hashFiles('spec/**/Gemfile.lock') }}-${{ hashFiles('Gemfile.lock') }}
|
|
100
|
+
path: |
|
|
101
|
+
/home/runner/.cache/solargraph
|
data/.github/workflows/test.yml
CHANGED
|
@@ -46,13 +46,15 @@ jobs:
|
|
|
46
46
|
- "0.56.0"
|
|
47
47
|
- "0.56.1"
|
|
48
48
|
- "0.56.2"
|
|
49
|
-
- "0.
|
|
49
|
+
- "0.57.0"
|
|
50
|
+
# - "0.58.0"
|
|
51
|
+
- "branch-castwide-master"
|
|
50
52
|
include:
|
|
51
53
|
- versions:
|
|
52
54
|
ruby: "3.2"
|
|
53
55
|
rails-major: "8"
|
|
54
56
|
rails-minor: "0"
|
|
55
|
-
solargraph-version: "
|
|
57
|
+
solargraph-version: "branch-castwide-master"
|
|
56
58
|
run_coverage: true
|
|
57
59
|
fail-fast: false
|
|
58
60
|
steps:
|
|
@@ -61,15 +63,14 @@ jobs:
|
|
|
61
63
|
- uses: ruby/setup-ruby@v1
|
|
62
64
|
with:
|
|
63
65
|
ruby-version: ${{ matrix.versions.ruby }}
|
|
64
|
-
bundler:
|
|
66
|
+
bundler: Gemfile.lock
|
|
65
67
|
bundler-cache: true
|
|
66
|
-
cache-version: ${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}-2025-
|
|
68
|
+
cache-version: ${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}-2025-09-09
|
|
67
69
|
env:
|
|
68
70
|
# Used in Gemfile/gemspec
|
|
69
71
|
MATRIX_SOLARGRAPH_VERSION: ${{ matrix.solargraph-version }}
|
|
70
72
|
MATRIX_RAILS_MAJOR_VERSION: ${{ matrix.versions.rails-major }}
|
|
71
73
|
MATRIX_RAILS_VERSION: ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}
|
|
72
|
-
|
|
73
74
|
- name: Update solargraph from branch if needed
|
|
74
75
|
run: |
|
|
75
76
|
bundle update solargraph
|
|
@@ -111,12 +112,12 @@ jobs:
|
|
|
111
112
|
uses: actions/cache/restore@v4
|
|
112
113
|
with:
|
|
113
114
|
key: |
|
|
114
|
-
2025-
|
|
115
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}--${{ matrix.versions.rails-minor }}-${{ hashFiles('spec/**/Gemfile.lock') }}-${{ hashFiles('Gemfile.lock') }}
|
|
115
116
|
restore-keys: |
|
|
116
|
-
2025-
|
|
117
|
-
2025-
|
|
118
|
-
2025-
|
|
119
|
-
2025-
|
|
117
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}-${{ matrix.versions.rails-minor }}-${{ hashFiles('spec/**/Gemfile.lock') }}-
|
|
118
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}-${{ matrix.versions.rails-minor }}-
|
|
119
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}-
|
|
120
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-
|
|
120
121
|
path: |
|
|
121
122
|
/home/runner/.cache/solargraph
|
|
122
123
|
|
|
@@ -160,6 +161,7 @@ jobs:
|
|
|
160
161
|
MATRIX_SOLARGRAPH_VERSION: ${{ matrix.solargraph-version }}
|
|
161
162
|
MATRIX_RAILS_VERSION: ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}
|
|
162
163
|
MATRIX_RAILS_MAJOR_VERSION: ${{ matrix.versions.rails-major }}
|
|
164
|
+
PRINT_STATS: true
|
|
163
165
|
|
|
164
166
|
- name: Upload coverage artifacts
|
|
165
167
|
uses: actions/upload-artifact@v4
|
|
@@ -180,6 +182,6 @@ jobs:
|
|
|
180
182
|
uses: actions/cache/save@v4
|
|
181
183
|
with:
|
|
182
184
|
key: |
|
|
183
|
-
2025-
|
|
185
|
+
2025-09-09-${{ runner.os }}-dot-cache-${{ matrix.solargraph-version }}-${{ matrix.versions.rails-major }}--${{ matrix.versions.rails-minor }}-${{ hashFiles('spec/**/Gemfile.lock') }}-${{ hashFiles('Gemfile.lock') }}
|
|
184
186
|
path: |
|
|
185
187
|
/home/runner/.cache/solargraph
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2025-07
|
|
3
|
+
# on 2025-09-07 17:36:18 UTC using RuboCop version 1.80.2.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
# Offense count: 5
|
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation
|
|
12
|
-
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
|
|
11
|
+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
|
|
13
12
|
Bundler/OrderedGems:
|
|
14
13
|
Exclude:
|
|
15
14
|
- 'Gemfile'
|
|
@@ -18,32 +17,27 @@ Bundler/OrderedGems:
|
|
|
18
17
|
|
|
19
18
|
# Offense count: 2
|
|
20
19
|
# This cop supports safe autocorrection (--autocorrect).
|
|
21
|
-
# Configuration parameters: Include.
|
|
22
|
-
# Include: **/*.gemspec
|
|
23
20
|
Gemspec/AddRuntimeDependency:
|
|
24
21
|
Exclude:
|
|
25
22
|
- 'solargraph-rails.gemspec'
|
|
26
23
|
|
|
27
24
|
# Offense count: 6
|
|
28
|
-
# Configuration parameters: EnforcedStyle, AllowedGems
|
|
25
|
+
# Configuration parameters: EnforcedStyle, AllowedGems.
|
|
29
26
|
# SupportedStyles: Gemfile, gems.rb, gemspec
|
|
30
|
-
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
|
31
27
|
Gemspec/DevelopmentDependencies:
|
|
32
28
|
Exclude:
|
|
33
29
|
- 'solargraph-rails.gemspec'
|
|
34
30
|
|
|
35
31
|
# Offense count: 2
|
|
36
32
|
# This cop supports safe autocorrection (--autocorrect).
|
|
37
|
-
# Configuration parameters: Severity
|
|
38
|
-
# Include: **/*.gemspec
|
|
33
|
+
# Configuration parameters: Severity.
|
|
39
34
|
Gemspec/RequireMFA:
|
|
40
35
|
Exclude:
|
|
41
36
|
- 'ci/auto_yard/auto_yard.gemspec'
|
|
42
37
|
- 'solargraph-rails.gemspec'
|
|
43
38
|
|
|
44
39
|
# Offense count: 2
|
|
45
|
-
# Configuration parameters: Severity
|
|
46
|
-
# Include: **/*.gemspec
|
|
40
|
+
# Configuration parameters: Severity.
|
|
47
41
|
Gemspec/RequiredRubyVersion:
|
|
48
42
|
Exclude:
|
|
49
43
|
- 'ci/auto_yard/auto_yard.gemspec'
|
|
@@ -245,7 +239,7 @@ Lint/SharedMutableDefault:
|
|
|
245
239
|
|
|
246
240
|
# Offense count: 2
|
|
247
241
|
# This cop supports safe autocorrection (--autocorrect).
|
|
248
|
-
# Configuration parameters:
|
|
242
|
+
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
|
249
243
|
Lint/UnusedBlockArgument:
|
|
250
244
|
Exclude:
|
|
251
245
|
- 'lib/solargraph/rails/model.rb'
|
|
@@ -253,7 +247,7 @@ Lint/UnusedBlockArgument:
|
|
|
253
247
|
|
|
254
248
|
# Offense count: 3
|
|
255
249
|
# This cop supports safe autocorrection (--autocorrect).
|
|
256
|
-
# Configuration parameters:
|
|
250
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
|
|
257
251
|
# NotImplementedExceptions: NotImplementedError
|
|
258
252
|
Lint/UnusedMethodArgument:
|
|
259
253
|
Exclude:
|
|
@@ -262,7 +256,6 @@ Lint/UnusedMethodArgument:
|
|
|
262
256
|
|
|
263
257
|
# Offense count: 3
|
|
264
258
|
# This cop supports safe autocorrection (--autocorrect).
|
|
265
|
-
# Configuration parameters: AutoCorrect.
|
|
266
259
|
Lint/UselessAssignment:
|
|
267
260
|
Exclude:
|
|
268
261
|
- 'lib/solargraph/rails/delegate.rb'
|
|
@@ -272,7 +265,7 @@ Lint/UselessAssignment:
|
|
|
272
265
|
# Offense count: 22
|
|
273
266
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
274
267
|
Metrics/AbcSize:
|
|
275
|
-
Max:
|
|
268
|
+
Max: 120
|
|
276
269
|
|
|
277
270
|
# Offense count: 2
|
|
278
271
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
|
@@ -285,33 +278,34 @@ Metrics/BlockLength:
|
|
|
285
278
|
Metrics/ClassLength:
|
|
286
279
|
Max: 252
|
|
287
280
|
|
|
288
|
-
# Offense count:
|
|
281
|
+
# Offense count: 12
|
|
289
282
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
290
283
|
Metrics/CyclomaticComplexity:
|
|
291
|
-
Max:
|
|
284
|
+
Max: 42
|
|
292
285
|
|
|
293
286
|
# Offense count: 23
|
|
294
287
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
295
288
|
Metrics/MethodLength:
|
|
296
289
|
Max: 75
|
|
297
290
|
|
|
298
|
-
# Offense count:
|
|
291
|
+
# Offense count: 2
|
|
299
292
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
|
300
293
|
Metrics/ParameterLists:
|
|
301
294
|
Max: 9
|
|
302
295
|
|
|
303
|
-
# Offense count:
|
|
296
|
+
# Offense count: 11
|
|
304
297
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
305
298
|
Metrics/PerceivedComplexity:
|
|
306
|
-
Max:
|
|
299
|
+
Max: 47
|
|
307
300
|
|
|
308
|
-
# Offense count:
|
|
301
|
+
# Offense count: 14
|
|
309
302
|
# This cop supports safe autocorrection (--autocorrect).
|
|
310
303
|
# Configuration parameters: EnforcedStyle, BlockForwardingName.
|
|
311
304
|
# SupportedStyles: anonymous, explicit
|
|
312
305
|
Naming/BlockForwarding:
|
|
313
306
|
Exclude:
|
|
314
307
|
- 'lib/solargraph-rails.rb'
|
|
308
|
+
- 'lib/solargraph/rails/annotations/active_job.rb'
|
|
315
309
|
- 'lib/solargraph/rails/walker.rb'
|
|
316
310
|
- 'spec/helpers.rb'
|
|
317
311
|
|
|
@@ -449,8 +443,7 @@ RSpec/PendingWithoutReason:
|
|
|
449
443
|
- 'spec/solargraph-rails/rails_spec.rb'
|
|
450
444
|
|
|
451
445
|
# Offense count: 7
|
|
452
|
-
# Configuration parameters:
|
|
453
|
-
# Include: **/*_spec.rb
|
|
446
|
+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
|
|
454
447
|
RSpec/SpecFilePathFormat:
|
|
455
448
|
Exclude:
|
|
456
449
|
- '**/spec/routing/**/*'
|
|
@@ -462,7 +455,7 @@ RSpec/SpecFilePathFormat:
|
|
|
462
455
|
- 'spec/solargraph-rails/schema_spec.rb'
|
|
463
456
|
- 'spec/solargraph-rails/storage_spec.rb'
|
|
464
457
|
|
|
465
|
-
# Offense count:
|
|
458
|
+
# Offense count: 6
|
|
466
459
|
# This cop supports safe autocorrection (--autocorrect).
|
|
467
460
|
# Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
|
|
468
461
|
# RedundantRestArgumentNames: args, arguments
|
|
@@ -471,6 +464,7 @@ RSpec/SpecFilePathFormat:
|
|
|
471
464
|
Style/ArgumentsForwarding:
|
|
472
465
|
Exclude:
|
|
473
466
|
- 'lib/solargraph/rails/walker.rb'
|
|
467
|
+
- 'spec/rails8/bin/setup'
|
|
474
468
|
|
|
475
469
|
# Offense count: 13
|
|
476
470
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
@@ -501,7 +495,7 @@ Style/ConditionalAssignment:
|
|
|
501
495
|
Exclude:
|
|
502
496
|
- 'spec/helpers.rb'
|
|
503
497
|
|
|
504
|
-
# Offense count:
|
|
498
|
+
# Offense count: 42
|
|
505
499
|
# Configuration parameters: AllowedConstants.
|
|
506
500
|
Style/Documentation:
|
|
507
501
|
Enabled: false
|
|
@@ -521,7 +515,7 @@ Style/FetchEnvVar:
|
|
|
521
515
|
- 'solargraph-rails.gemspec'
|
|
522
516
|
- 'spec/rails8/bin/bundle'
|
|
523
517
|
|
|
524
|
-
# Offense count:
|
|
518
|
+
# Offense count: 89
|
|
525
519
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
526
520
|
# Configuration parameters: EnforcedStyle.
|
|
527
521
|
# SupportedStyles: always, always_true, never
|
|
@@ -618,6 +612,12 @@ Style/RedundantParentheses:
|
|
|
618
612
|
- 'Gemfile'
|
|
619
613
|
- 'solargraph-rails.gemspec'
|
|
620
614
|
|
|
615
|
+
# Offense count: 2
|
|
616
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
617
|
+
Style/RedundantRegexpEscape:
|
|
618
|
+
Exclude:
|
|
619
|
+
- 'lib/solargraph/rails/annotate.rb'
|
|
620
|
+
|
|
621
621
|
# Offense count: 1
|
|
622
622
|
# This cop supports safe autocorrection (--autocorrect).
|
|
623
623
|
# Configuration parameters: AllowMultipleReturnValues.
|
|
@@ -694,7 +694,7 @@ Style/StringConcatenation:
|
|
|
694
694
|
- 'lib/solargraph-rails.rb'
|
|
695
695
|
- 'spec/helpers.rb'
|
|
696
696
|
|
|
697
|
-
# Offense count:
|
|
697
|
+
# Offense count: 323
|
|
698
698
|
# This cop supports safe autocorrection (--autocorrect).
|
|
699
699
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
|
700
700
|
# SupportedStyles: single_quotes, double_quotes
|
|
@@ -709,14 +709,13 @@ Style/SymbolArray:
|
|
|
709
709
|
EnforcedStyle: percent
|
|
710
710
|
MinSize: 13
|
|
711
711
|
|
|
712
|
-
# Offense count:
|
|
712
|
+
# Offense count: 1
|
|
713
713
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
714
714
|
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
|
|
715
715
|
# AllowedMethods: define_method
|
|
716
716
|
Style/SymbolProc:
|
|
717
717
|
Exclude:
|
|
718
718
|
- 'spec/helpers.rb'
|
|
719
|
-
- 'spec/rails8/db/migrate/20250619165029_create_models.rb'
|
|
720
719
|
|
|
721
720
|
# Offense count: 3
|
|
722
721
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -776,7 +775,7 @@ YARD/TagTypeSyntax:
|
|
|
776
775
|
- 'lib/solargraph/rails/annotations/time.rb'
|
|
777
776
|
- 'lib/solargraph/rails/model.rb'
|
|
778
777
|
|
|
779
|
-
# Offense count:
|
|
778
|
+
# Offense count: 16
|
|
780
779
|
# This cop supports safe autocorrection (--autocorrect).
|
|
781
780
|
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
782
781
|
# URISchemes: http, https
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Changes
|
|
4
4
|
|
|
5
|
+
### v1.3
|
|
6
|
+
|
|
7
|
+
Features/fixes:
|
|
8
|
+
- Add support for Puma DSL
|
|
9
|
+
- Add support for importmap.rb DSL
|
|
10
|
+
- Type annotations for schema.rb
|
|
11
|
+
- Remove Solargraph upper limit in gemspec
|
|
12
|
+
|
|
13
|
+
Internal improvements:
|
|
14
|
+
- Create a 'rails new' GitHub Actions workflow
|
|
15
|
+
|
|
16
|
+
### v1.2.4
|
|
17
|
+
|
|
18
|
+
Features / fixes:
|
|
19
|
+
- Enable support for Solargraph 0.74.x with annotation fixes
|
|
20
|
+
|
|
21
|
+
Internal improvements:
|
|
22
|
+
- CI improvements for easier Solargraph pre-release regression testing
|
|
23
|
+
|
|
5
24
|
### v1.2.3
|
|
6
25
|
|
|
7
26
|
Internal improvements:
|
data/DEVELOPMENT.md
CHANGED
|
@@ -73,11 +73,11 @@ Move .yml files into place, then make sure to review the script and uncomment re
|
|
|
73
73
|
## Preparing a release (maintainers)
|
|
74
74
|
|
|
75
75
|
1. Look up [most recent release](https://rubygems.org/gems/solargraph-rails)
|
|
76
|
-
2. Open up [commit list](https://github.com/iftheshoefritz/solargraph-rails/compare/v1.2.
|
|
76
|
+
2. Open up [commit list](https://github.com/iftheshoefritz/solargraph-rails/compare/v1.2.4...main)
|
|
77
77
|
3. Update [CHANGELOG.md](./CHANGELOG.md)
|
|
78
78
|
4. Flip to 'files changed view' and refine updates
|
|
79
79
|
5. Bump [version](./lib/solargraph/rails/version.rb) appropriately
|
|
80
|
-
6. Create branch, commit
|
|
80
|
+
6. Create branch, commit and merge changes - "Prepare for vX.Y.Z release", branch: `prepare_vX.Y.Z_release`
|
|
81
81
|
7. `git config branch.main.remote`
|
|
82
82
|
8. Ensure your local main branch is directly from iftheshoefritz
|
|
83
83
|
9. `direnv block`
|
data/Gemfile
CHANGED
|
@@ -15,7 +15,7 @@ solargraph_version = (ENV['CI'] && ENV['MATRIX_SOLARGRAPH_VERSION'])
|
|
|
15
15
|
# ensure that YARD docs get cached by ruby/setup-ruby in GitHub
|
|
16
16
|
# Actions if using an older version of solargraph that needs user to
|
|
17
17
|
# run `yard gems` manually
|
|
18
|
-
if solargraph_version
|
|
18
|
+
if solargraph_version && !solargraph_version.start_with?('branch-')
|
|
19
19
|
solargraph_minor_version = solargraph_version.split('.')[1].to_i
|
|
20
20
|
solargraph_major_version = solargraph_version.split('.')[0].to_i
|
|
21
21
|
if solargraph_version && solargraph_major_version == 0 && solargraph_minor_version < 53
|
|
@@ -57,11 +57,14 @@ when '0.57.alpha'
|
|
|
57
57
|
gem "solargraph",
|
|
58
58
|
github: 'apiology/solargraph',
|
|
59
59
|
branch: '2025-07-02'
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
when /branch-castwide-(.*)/
|
|
61
|
+
gem "solargraph",
|
|
62
|
+
github: 'castwide/solargraph',
|
|
63
|
+
branch: Regexp.last_match(1)
|
|
64
|
+
when /branch-(.*)/
|
|
62
65
|
gem "solargraph",
|
|
63
66
|
github: 'apiology/solargraph',
|
|
64
|
-
branch:
|
|
67
|
+
branch: Regexp.last_match(1)
|
|
65
68
|
end
|
|
66
69
|
|
|
67
70
|
# Local gemfile for development tools, etc.
|
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
module ActionController
|
|
2
|
+
class Base < Metal
|
|
3
|
+
#
|
|
4
|
+
# NOTE: keep this list synced with new items from MODULES in action_controller/base.rb
|
|
5
|
+
#
|
|
6
|
+
# @todo pull this as literal array dynamically from
|
|
7
|
+
# ActionController::Base::MODULES and walk through it (and other
|
|
8
|
+
# cases of same pattern) to help future-proof things
|
|
9
|
+
#
|
|
10
|
+
include AbstractController::Rendering
|
|
11
|
+
extend AbstractController::Rendering::ClassMethods
|
|
12
|
+
include AbstractController::Translation
|
|
13
|
+
include AbstractController::AssetPaths
|
|
14
|
+
include Helpers
|
|
15
|
+
include UrlFor
|
|
16
|
+
include Redirecting
|
|
17
|
+
include ActionView::Layouts
|
|
18
|
+
include Rendering
|
|
19
|
+
include Renderers::All
|
|
20
|
+
include ConditionalGet
|
|
21
|
+
include EtagWithTemplateDigest
|
|
22
|
+
include EtagWithFlash
|
|
23
|
+
include Caching
|
|
24
|
+
include MimeResponds
|
|
25
|
+
include ImplicitRender
|
|
26
|
+
include StrongParameters
|
|
27
|
+
include ParameterEncoding
|
|
28
|
+
include Cookies
|
|
29
|
+
include Flash
|
|
30
|
+
include FormBuilder
|
|
31
|
+
include RequestForgeryProtection
|
|
32
|
+
extend RequestForgeryProtection::ClassMethods
|
|
33
|
+
include ContentSecurityPolicy
|
|
34
|
+
include PermissionsPolicy
|
|
35
|
+
extend PermissionsPolicy::ClassMethods
|
|
36
|
+
include Streaming
|
|
37
|
+
include DataStreaming
|
|
38
|
+
include HttpAuthentication::Basic::ControllerMethods
|
|
39
|
+
extend HttpAuthentication::Basic::ControllerMethods::ClassMethods
|
|
40
|
+
include HttpAuthentication::Digest::ControllerMethods
|
|
41
|
+
include HttpAuthentication::Token::ControllerMethods
|
|
42
|
+
include DefaultHeaders
|
|
43
|
+
include Logging
|
|
44
|
+
extend Logging::ClassMethods
|
|
45
|
+
include AbstractController::Callbacks
|
|
46
|
+
extend AbstractController::Callbacks::ClassMethods
|
|
47
|
+
include Rescue
|
|
48
|
+
include Instrumentation
|
|
49
|
+
include ParamsWrapper
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
#
|
|
52
|
+
# I don't see the thinsg below in action_controller/base.rb, at least in Rails
|
|
53
|
+
# 7.0. Maybe they need to be moved to be under a different class?
|
|
54
|
+
#
|
|
55
|
+
extend ActiveSupport::Callbacks::ClassMethods
|
|
56
|
+
extend ActiveSupport::Rescuable::ClassMethods
|
|
57
|
+
include ActiveSupport::Rescuable
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
# @return [ActionDispatch::Response]
|
|
60
|
+
def response; end
|
|
61
|
+
# @return [ActionDispatch::Request]
|
|
62
|
+
def request; end
|
|
63
|
+
# @return [ActionDispatch::Request::Session]
|
|
64
|
+
def session; end
|
|
65
|
+
# @return [ActionDispatch::Flash::FlashHash]
|
|
66
|
+
def flash; end
|
|
67
|
+
end
|
|
66
68
|
end
|
|
67
69
|
|
|
68
70
|
class ActionController::Metal
|
|
@@ -16,6 +16,129 @@ class ActiveRecord::ConnectionAdapters::SchemaStatements
|
|
|
16
16
|
def change_table(table_name, **options); end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
class ActiveRecord::ConnectionAdapters::ColumnMethods
|
|
20
|
+
# included do
|
|
21
|
+
# define_column_methods :bigint, :binary, :boolean, :date, :datetime, :decimal,
|
|
22
|
+
# :float, :integer, :json, :string, :text, :time, :timestamp, :virtual
|
|
23
|
+
# alias :blob :binary
|
|
24
|
+
# alias :numeric :decimal
|
|
25
|
+
# end
|
|
26
|
+
|
|
27
|
+
# def define_column_methods(*column_types) # :nodoc:
|
|
28
|
+
# column_types.each do |column_type|
|
|
29
|
+
# module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
|
30
|
+
# def #{column_type}(*names, **options)
|
|
31
|
+
# raise ArgumentError, "Missing column name(s) for #{column_type}" if names.empty?
|
|
32
|
+
# names.each { |name| column(name, :#{column_type}, **options) }
|
|
33
|
+
# end
|
|
34
|
+
# RUBY
|
|
35
|
+
# end
|
|
36
|
+
|
|
37
|
+
# decimal
|
|
38
|
+
#
|
|
39
|
+
# @param names [Array<Symbol, String>]
|
|
40
|
+
# @param precision [Integer, nil]
|
|
41
|
+
# @param scale [Integer, nil]
|
|
42
|
+
# @param options [Hash{Symbol => undefined}]
|
|
43
|
+
# @return [void]
|
|
44
|
+
def decimal(*names, precision: nil, scale: nil, **options); end
|
|
45
|
+
# bigint
|
|
46
|
+
#
|
|
47
|
+
# @param names [Array<Symbol, String>]
|
|
48
|
+
# @param options [Hash{Symbol => undefined}]
|
|
49
|
+
# @return [void]
|
|
50
|
+
def bigint(*names, **options); end
|
|
51
|
+
# virtual
|
|
52
|
+
#
|
|
53
|
+
# @param names [Array<Symbol, String>]
|
|
54
|
+
# @param type [Symbol, String]
|
|
55
|
+
# @param as [String]
|
|
56
|
+
# @param options [Hash{Symbol => undefined}]
|
|
57
|
+
# @return [void]
|
|
58
|
+
def virtual(*names, type, as:, **options); end
|
|
59
|
+
# json
|
|
60
|
+
#
|
|
61
|
+
# @param names [Array<Symbol, String>]
|
|
62
|
+
# @param options [Hash{Symbol => undefined}]
|
|
63
|
+
# @return [void]
|
|
64
|
+
def json(*names, **options); end
|
|
65
|
+
# jsonb
|
|
66
|
+
#
|
|
67
|
+
# @param names [Array<Symbol, String>]
|
|
68
|
+
# @param options [Hash{Symbol => undefined}]
|
|
69
|
+
# @return [void]
|
|
70
|
+
def jsonb(*names, **options); end
|
|
71
|
+
# boolean
|
|
72
|
+
#
|
|
73
|
+
# @param names [Array<Symbol, String>]
|
|
74
|
+
# @param options [Hash{Symbol => undefined}]
|
|
75
|
+
# @param names [Array<Symbol, String>]
|
|
76
|
+
# @return [void]
|
|
77
|
+
def boolean(*names, **options); end
|
|
78
|
+
# string
|
|
79
|
+
#
|
|
80
|
+
# @param names [Array<Symbol, String>]
|
|
81
|
+
# @param limit [Integer, nil]
|
|
82
|
+
# @param options [Hash{Symbol => undefined}]
|
|
83
|
+
# @return [void]
|
|
84
|
+
def string(*names, limit: nil, **options); end
|
|
85
|
+
# text
|
|
86
|
+
#
|
|
87
|
+
# @param names [Array<Symbol, String>]
|
|
88
|
+
# @param limit [Integer, nil]
|
|
89
|
+
# @param options [Hash{Symbol => undefined}]
|
|
90
|
+
# @return [void]
|
|
91
|
+
def text(*names, limit: nil, **options); end
|
|
92
|
+
# integer
|
|
93
|
+
#
|
|
94
|
+
# @param names [Array<Symbol, String>]
|
|
95
|
+
# @param limit [Integer, nil]
|
|
96
|
+
# @param options [Hash{Symbol => undefined}]
|
|
97
|
+
# @return [void]
|
|
98
|
+
def integer(*names, limit: nil, **options); end
|
|
99
|
+
# float
|
|
100
|
+
#
|
|
101
|
+
# @param names [Array<Symbol, String>]
|
|
102
|
+
# @param limit [Integer, nil]
|
|
103
|
+
# @param options [Hash{Symbol => undefined}]
|
|
104
|
+
# @return [void]
|
|
105
|
+
def float(*names, limit: nil, **options); end
|
|
106
|
+
# binary
|
|
107
|
+
#
|
|
108
|
+
# @param names [Array<Symbol, String>]
|
|
109
|
+
# @param limit [Integer, nil]
|
|
110
|
+
# @param options [Hash{Symbol => undefined}]
|
|
111
|
+
# @return [void]
|
|
112
|
+
def binary(*names, limit: nil, **options); end
|
|
113
|
+
# date
|
|
114
|
+
#
|
|
115
|
+
# @param names [Array<Symbol, String>]
|
|
116
|
+
# @param options [Hash{Symbol => undefined}]
|
|
117
|
+
# @return [void]
|
|
118
|
+
def date(*names, **options); end
|
|
119
|
+
# datetime
|
|
120
|
+
#
|
|
121
|
+
# @param names [Array<Symbol, String>]
|
|
122
|
+
# @param precision [Integer, nil]
|
|
123
|
+
# @param options [Hash{Symbol => undefined}]
|
|
124
|
+
# @return [void]
|
|
125
|
+
def datetime(*names, precision: nil, **options); end
|
|
126
|
+
# time
|
|
127
|
+
#
|
|
128
|
+
# @param names [Array<Symbol, String>]
|
|
129
|
+
# @param precision [Integer, nil]
|
|
130
|
+
# @param options [Hash{Symbol => undefined}]
|
|
131
|
+
# @return [void]
|
|
132
|
+
def time(*names, precision: nil, **options); end
|
|
133
|
+
# timestamp
|
|
134
|
+
#
|
|
135
|
+
# @param names [Array<Symbol, String>]
|
|
136
|
+
# @param precision [Integer, nil]
|
|
137
|
+
# @param options [Hash{Symbol => undefined}]
|
|
138
|
+
# @return [void]
|
|
139
|
+
def timestamp(*names, precision: nil, **options); end
|
|
140
|
+
end
|
|
141
|
+
|
|
19
142
|
module ActiveRecord::Core
|
|
20
143
|
# @param methods [Symbol]
|
|
21
144
|
# @return [ActiveSupport::HashWithIndifferentAccess<Symbol>]
|
|
@@ -35,6 +158,18 @@ class ActiveRecord::Relation
|
|
|
35
158
|
include ActiveRecord::RelationMethods
|
|
36
159
|
end
|
|
37
160
|
|
|
161
|
+
module ActiveRecord
|
|
162
|
+
class Schema
|
|
163
|
+
# @param version [Numeric]
|
|
164
|
+
#
|
|
165
|
+
# @return [Class<ActiveRecord::Schema>]
|
|
166
|
+
def self.[](version); end
|
|
167
|
+
|
|
168
|
+
# @yieldreceiver [ActiveRecord::ConnectionAdapters::SchemaStatements]
|
|
169
|
+
def self.define(info = {}, &block); end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
38
173
|
class ActiveRecord::Base
|
|
39
174
|
extend Enumerable
|
|
40
175
|
extend ActiveRecord::QueryMethods
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Solargraph
|
|
4
|
+
module Rails
|
|
5
|
+
class Importmap
|
|
6
|
+
EMPTY_ENVIRON = Environ.new
|
|
7
|
+
|
|
8
|
+
# @return [Solargraph::Rails::Importmap]
|
|
9
|
+
def self.instance
|
|
10
|
+
@instance ||= new
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @param environ [Solargraph::Environ]
|
|
14
|
+
# @param basename [String]
|
|
15
|
+
#
|
|
16
|
+
# @return [void]
|
|
17
|
+
def add_dsl(environ, basename)
|
|
18
|
+
return unless basename == 'importmap.rb'
|
|
19
|
+
|
|
20
|
+
environ.requires.push('importmap-rails')
|
|
21
|
+
environ.domains.push('Importmap::Map')
|
|
22
|
+
|
|
23
|
+
Solargraph.logger.debug(
|
|
24
|
+
"[Rails][Importmap] added DSL to environ: #{environ.inspect}"
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Solargraph
|
|
4
|
+
module Rails
|
|
5
|
+
class Puma
|
|
6
|
+
EMPTY_ENVIRON = Environ.new
|
|
7
|
+
|
|
8
|
+
# @return [Solargraph::Rails::Puma]
|
|
9
|
+
def self.instance
|
|
10
|
+
@instance ||= new
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @param environ [Solargraph::Environ]
|
|
14
|
+
# @param basename [String]
|
|
15
|
+
#
|
|
16
|
+
# @return [void]
|
|
17
|
+
def add_dsl(environ, basename)
|
|
18
|
+
return unless basename == 'puma.rb'
|
|
19
|
+
|
|
20
|
+
environ.requires.push('puma')
|
|
21
|
+
environ.domains.push('Puma::DSL')
|
|
22
|
+
|
|
23
|
+
Solargraph.logger.debug(
|
|
24
|
+
"[Rails][Puma] added DSL to environ: #{environ.inspect}"
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/solargraph-rails.rb
CHANGED
|
@@ -13,6 +13,8 @@ require_relative 'solargraph/rails/walker'
|
|
|
13
13
|
require_relative 'solargraph/rails/rails_api'
|
|
14
14
|
require_relative 'solargraph/rails/delegate'
|
|
15
15
|
require_relative 'solargraph/rails/storage'
|
|
16
|
+
require_relative 'solargraph/rails/puma'
|
|
17
|
+
require_relative 'solargraph/rails/importmap'
|
|
16
18
|
require_relative 'solargraph/rails/debug'
|
|
17
19
|
require_relative 'solargraph/rails/version'
|
|
18
20
|
|
|
@@ -23,6 +25,9 @@ module Solargraph
|
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
class Convention < Solargraph::Convention::Base
|
|
28
|
+
# @param yard_map [Solargraph::DocMap]
|
|
29
|
+
#
|
|
30
|
+
# @return [Solargraph::Environ]
|
|
26
31
|
def global(yard_map)
|
|
27
32
|
Solargraph::Environ.new(
|
|
28
33
|
pins: Solargraph::Rails::RailsApi.instance.global(yard_map)
|
|
@@ -34,6 +39,9 @@ module Solargraph
|
|
|
34
39
|
EMPTY_ENVIRON
|
|
35
40
|
end
|
|
36
41
|
|
|
42
|
+
# @param source_map [Solargraph::SourceMap]
|
|
43
|
+
#
|
|
44
|
+
# @return [Solargraph::Environ]
|
|
37
45
|
def local(source_map)
|
|
38
46
|
pins = []
|
|
39
47
|
ds =
|
|
@@ -42,7 +50,13 @@ module Solargraph
|
|
|
42
50
|
end
|
|
43
51
|
ns = ds.first
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
basename = File.basename(source_map.filename)
|
|
54
|
+
|
|
55
|
+
environ = Solargraph::Environ.new
|
|
56
|
+
Puma.instance.add_dsl(environ, basename)
|
|
57
|
+
Importmap.instance.add_dsl(environ, basename)
|
|
58
|
+
|
|
59
|
+
return environ unless ns
|
|
46
60
|
|
|
47
61
|
pins += run_feature { Schema.instance.process(source_map, ns) }
|
|
48
62
|
pins += run_feature { Annotate.instance.process(source_map, ns) }
|
|
@@ -53,11 +67,16 @@ module Solargraph
|
|
|
53
67
|
pins += run_feature { Delegate.instance.process(source_map, ns) } if Delegate.supported?
|
|
54
68
|
pins += run_feature { RailsApi.instance.local(source_map, ns) }
|
|
55
69
|
|
|
56
|
-
Solargraph::Environ.new(pins: pins)
|
|
70
|
+
environ = Solargraph::Environ.new(pins: pins)
|
|
71
|
+
Puma.instance.add_dsl(environ, basename)
|
|
72
|
+
environ
|
|
57
73
|
end
|
|
58
74
|
|
|
59
75
|
private
|
|
60
76
|
|
|
77
|
+
# @yieldreturn [Array<Solargraph::Pin::Base>]
|
|
78
|
+
#
|
|
79
|
+
# @return [Array<Solargraph::Pin::Base>]
|
|
61
80
|
def run_feature(&block)
|
|
62
81
|
yield
|
|
63
82
|
rescue => error
|
data/solargraph-rails.gemspec
CHANGED
|
@@ -5,15 +5,11 @@ require 'solargraph/rails/version'
|
|
|
5
5
|
|
|
6
6
|
solargraph_force_ci_version = (ENV['CI'] && ENV['MATRIX_SOLARGRAPH_VERSION'])
|
|
7
7
|
solargraph_version =
|
|
8
|
-
if solargraph_force_ci_version
|
|
9
|
-
|
|
8
|
+
if solargraph_force_ci_version && !solargraph_force_ci_version.start_with?('branch-')
|
|
9
|
+
solargraph_force_ci_version
|
|
10
10
|
else
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'>= 0.48.0',
|
|
14
|
-
# above this hasn't been tested
|
|
15
|
-
'< 0.57'
|
|
16
|
-
]
|
|
11
|
+
# below this isn't tested in CI
|
|
12
|
+
'>= 0.48.0'
|
|
17
13
|
end
|
|
18
14
|
|
|
19
15
|
Gem::Specification.new do |spec|
|
|
@@ -37,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
37
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
38
34
|
spec.require_paths = ['lib']
|
|
39
35
|
|
|
40
|
-
spec.add_development_dependency 'bundler', '
|
|
36
|
+
spec.add_development_dependency 'bundler', '>= 2.2.33'
|
|
41
37
|
spec.add_development_dependency 'rake', '~> 12.3.3'
|
|
42
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
43
39
|
spec.add_development_dependency 'rubocop', '~> 1.76'
|
metadata
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solargraph-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: '1.3'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fritz Meissner
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-01-01 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bundler
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 2.2.33
|
|
19
19
|
type: :development
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
|
-
- - "
|
|
23
|
+
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 2.2.33
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: rake
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,9 +100,6 @@ dependencies:
|
|
|
100
100
|
- - ">="
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
102
|
version: 0.48.0
|
|
103
|
-
- - "<"
|
|
104
|
-
- !ruby/object:Gem::Version
|
|
105
|
-
version: '0.57'
|
|
106
103
|
type: :runtime
|
|
107
104
|
prerelease: false
|
|
108
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -110,9 +107,6 @@ dependencies:
|
|
|
110
107
|
- - ">="
|
|
111
108
|
- !ruby/object:Gem::Version
|
|
112
109
|
version: 0.48.0
|
|
113
|
-
- - "<"
|
|
114
|
-
- !ruby/object:Gem::Version
|
|
115
|
-
version: '0.57'
|
|
116
110
|
- !ruby/object:Gem::Dependency
|
|
117
111
|
name: activesupport
|
|
118
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -137,6 +131,7 @@ extra_rdoc_files: []
|
|
|
137
131
|
files:
|
|
138
132
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
139
133
|
- ".github/workflows/linter.yml"
|
|
134
|
+
- ".github/workflows/rails_new.yml"
|
|
140
135
|
- ".github/workflows/test.yml"
|
|
141
136
|
- ".github/workflows/typecheck.yml"
|
|
142
137
|
- ".gitignore"
|
|
@@ -184,7 +179,9 @@ files:
|
|
|
184
179
|
- lib/solargraph/rails/debug.rb
|
|
185
180
|
- lib/solargraph/rails/delegate.rb
|
|
186
181
|
- lib/solargraph/rails/devise.rb
|
|
182
|
+
- lib/solargraph/rails/importmap.rb
|
|
187
183
|
- lib/solargraph/rails/model.rb
|
|
184
|
+
- lib/solargraph/rails/puma.rb
|
|
188
185
|
- lib/solargraph/rails/rails_api.rb
|
|
189
186
|
- lib/solargraph/rails/schema.rb
|
|
190
187
|
- lib/solargraph/rails/storage.rb
|