Skip to content

Commit 9a4ca37

Browse files
Copilotkwerle
andauthored
Update activerecord gem to 8.1 (#111)
* Initial plan * Update activerecord gem from 8.0 to 8.1 Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com> * WIP * Downgrade to ruby 3.3 & cops --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com> Co-authored-by: Kurt Werle <kurt@CircleW.org>
1 parent 03aec1a commit 9a4ca37

7 files changed

Lines changed: 147 additions & 60 deletions

File tree

.rubocop.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ plugins:
1414
- rubocop-rake
1515

1616
AllCops:
17-
TargetRubyVersion: 3.1 # 4.0 not yet afailable Tue Dec 30 15:07:23 PST 2025
17+
TargetRubyVersion: 3.3 # 4.0 not yet afailable Tue Dec 30 15:07:23 PST 2025
1818
NewCops: enable
1919
Exclude:
2020
- 'spec/fixture_files/**/*'
2121

22+
Naming/PredicatePrefix:
23+
Enabled: false
24+
25+
Naming/PredicateMethod:
26+
Enabled: false
27+
2228
Gemspec/DependencyVersion:
2329
Enabled: false
2430

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# For development:
44
# docker run -it -v $PWD:/project -v $PWD:/tmp/src -w /tmp/src ruby_language_server sh -c 'bundle && guard'
5-
FROM ruby:4.0-alpine
5+
FROM ruby:3.3-alpine
66
LABEL maintainer="kurt@CircleW.org"
77

88
RUN gem update bundler
@@ -28,8 +28,7 @@ RUN rm -rf /usr/local/src
2828
ENV RUBY_LANGUAGE_SERVER_PROJECT_ROOT=/project/
2929
# ENV LOG_LEVEL DEBUG
3030

31-
COPY Gemfile* ./
32-
COPY ruby_language_server.gemspec .
31+
COPY Gemfile* ruby_language_server.gemspec ./
3332
COPY lib/ruby_language_server/version.rb lib/ruby_language_server/version.rb
3433

3534
RUN bundle install -j 8

Gemfile.lock

Lines changed: 129 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: .
33
specs:
44
ruby_language_server (0.4.2)
5-
activerecord (~> 8.0)
5+
activerecord (~> 8.1)
66
amatch
77
bundler
88
etc
@@ -15,48 +15,46 @@ PATH
1515
GEM
1616
remote: https://rubygems.org/
1717
specs:
18-
activemodel (8.0.2)
19-
activesupport (= 8.0.2)
20-
activerecord (8.0.2)
21-
activemodel (= 8.0.2)
22-
activesupport (= 8.0.2)
18+
activemodel (8.1.1)
19+
activesupport (= 8.1.1)
20+
activerecord (8.1.1)
21+
activemodel (= 8.1.1)
22+
activesupport (= 8.1.1)
2323
timeout (>= 0.4.0)
24-
activesupport (8.0.2)
24+
activesupport (8.1.1)
2525
base64
26-
benchmark (>= 0.3)
2726
bigdecimal
2827
concurrent-ruby (~> 1.0, >= 1.3.1)
2928
connection_pool (>= 2.2.5)
3029
drb
3130
i18n (>= 1.6, < 2)
31+
json
3232
logger (>= 1.4.2)
3333
minitest (>= 5.1)
3434
securerandom (>= 0.3)
3535
tzinfo (~> 2.0, >= 2.0.5)
3636
uri (>= 0.13.1)
37-
amatch (0.4.2)
37+
amatch (0.6.0)
3838
mize
39-
tins (~> 1.0)
39+
tins (~> 1)
4040
ansi (1.5.0)
4141
ast (2.4.3)
42-
base64 (0.2.0)
43-
benchmark (0.4.0)
44-
bigdecimal (3.1.9)
42+
base64 (0.3.0)
43+
bigdecimal (4.0.1)
4544
builder (3.3.0)
4645
coderay (1.1.3)
47-
concurrent-ruby (1.3.5)
48-
connection_pool (2.5.3)
46+
concurrent-ruby (1.3.6)
47+
connection_pool (3.0.2)
4948
date (3.5.1)
5049
debug (1.11.1)
5150
irb (~> 1.10)
5251
reline (>= 0.3.8)
53-
drb (2.2.1)
52+
drb (2.2.3)
5453
erb (6.0.1)
55-
etc (1.4.5)
56-
ffi (1.17.2)
57-
ffi (1.17.2-aarch64-linux-musl)
58-
ffi (1.17.2-x86_64-linux-gnu)
59-
formatador (1.1.0)
54+
etc (1.4.6)
55+
ffi (1.17.3-aarch64-linux-musl)
56+
formatador (1.2.3)
57+
reline
6058
fuzzy_match (2.1.0)
6159
guard (2.19.1)
6260
formatador (>= 0.2.4)
@@ -76,23 +74,22 @@ GEM
7674
guard-rubocop (1.5.0)
7775
guard (~> 2.0)
7876
rubocop (< 2.0)
79-
i18n (1.14.7)
77+
i18n (1.14.8)
8078
concurrent-ruby (~> 1.0)
8179
io-console (0.8.2)
8280
irb (1.16.0)
8381
pp (>= 0.6.0)
8482
rdoc (>= 4.0.0)
8583
reline (>= 0.4.2)
86-
json (2.11.3)
87-
language_server-protocol (3.17.0.4)
84+
json (2.18.0)
85+
language_server-protocol (3.17.0.5)
8886
lint_roller (1.1.0)
8987
listen (3.9.0)
9088
rb-fsevent (~> 0.10, >= 0.10.3)
9189
rb-inotify (~> 0.9, >= 0.9.10)
9290
logger (1.7.0)
93-
lumberjack (1.2.10)
91+
lumberjack (1.4.2)
9492
method_source (1.1.0)
95-
mini_portile2 (2.8.9)
9693
minitest (6.0.1)
9794
prism (~> 1.5)
9895
minitest-reporters (1.7.1)
@@ -105,24 +102,25 @@ GEM
105102
notiffany (0.1.3)
106103
nenv (~> 0.1)
107104
shellany (~> 0.0)
108-
ostruct (0.6.1)
105+
ostruct (0.6.3)
109106
parallel (1.27.0)
110-
parser (3.3.8.0)
107+
parser (3.3.10.0)
111108
ast (~> 2.4.1)
112109
racc
113110
pp (0.6.3)
114111
prettyprint
115112
prettyprint (0.2.0)
116113
prism (1.7.0)
117-
pry (0.15.2)
114+
pry (0.16.0)
118115
coderay (~> 1.1)
119116
method_source (~> 1.0)
117+
reline (>= 0.6.0)
120118
psych (5.3.1)
121119
date
122120
stringio
123121
racc (1.8.1)
124122
rainbow (3.1.1)
125-
rake (13.2.1)
123+
rake (13.3.1)
126124
rb-fsevent (0.11.2)
127125
rb-inotify (0.11.1)
128126
ffi (~> 1.0)
@@ -131,62 +129,62 @@ GEM
131129
erb
132130
psych (>= 4.0.0)
133131
tsort
134-
regexp_parser (2.10.0)
132+
readline (0.0.4)
133+
reline
134+
regexp_parser (2.11.3)
135135
reline (0.6.3)
136136
io-console (~> 0.5)
137-
rubocop (1.75.5)
137+
rubocop (1.82.1)
138138
json (~> 2.3)
139139
language_server-protocol (~> 3.17.0.2)
140140
lint_roller (~> 1.1.0)
141141
parallel (~> 1.10)
142142
parser (>= 3.3.0.2)
143143
rainbow (>= 2.2.2, < 4.0)
144144
regexp_parser (>= 2.9.3, < 3.0)
145-
rubocop-ast (>= 1.44.0, < 2.0)
145+
rubocop-ast (>= 1.48.0, < 2.0)
146146
ruby-progressbar (~> 1.7)
147147
unicode-display_width (>= 2.4.0, < 4.0)
148-
rubocop-ast (1.44.1)
148+
rubocop-ast (1.49.0)
149149
parser (>= 3.3.7.2)
150-
prism (~> 1.4)
151-
rubocop-minitest (0.38.0)
150+
prism (~> 1.7)
151+
rubocop-minitest (0.38.2)
152152
lint_roller (~> 1.1)
153153
rubocop (>= 1.75.0, < 2.0)
154154
rubocop-ast (>= 1.38.0, < 2.0)
155-
rubocop-performance (1.25.0)
155+
rubocop-performance (1.26.1)
156156
lint_roller (~> 1.1)
157157
rubocop (>= 1.75.0, < 2.0)
158-
rubocop-ast (>= 1.38.0, < 2.0)
158+
rubocop-ast (>= 1.47.1, < 2.0)
159159
rubocop-rake (0.7.1)
160160
lint_roller (~> 1.1)
161161
rubocop (>= 1.72.1)
162-
rubocop-rspec (3.6.0)
162+
rubocop-rspec (3.8.0)
163163
lint_roller (~> 1.1)
164-
rubocop (~> 1.72, >= 1.72.1)
164+
rubocop (~> 1.81)
165165
ruby-progressbar (1.13.0)
166166
securerandom (0.4.1)
167167
shellany (0.0.1)
168-
sqlite3 (2.6.0)
169-
mini_portile2 (~> 2.8.0)
170-
sqlite3 (2.6.0-aarch64-linux-musl)
171-
sqlite3 (2.6.0-x86_64-linux-gnu)
168+
sqlite3 (2.9.0-aarch64-linux-musl)
172169
stringio (3.2.0)
173170
sync (0.5.0)
174171
thor (1.4.0)
175-
timeout (0.4.3)
176-
tins (1.38.0)
172+
timeout (0.6.0)
173+
tins (1.51.0)
177174
bigdecimal
175+
mize (~> 0.6)
176+
readline
178177
sync
179178
tsort (0.2.0)
180179
tzinfo (2.0.6)
181180
concurrent-ruby (~> 1.0)
182-
unicode-display_width (3.1.4)
183-
unicode-emoji (~> 4.0, >= 4.0.4)
181+
unicode-display_width (3.2.0)
182+
unicode-emoji (~> 4.1)
184183
unicode-emoji (4.2.0)
185-
uri (1.0.3)
184+
uri (1.1.1)
186185

187186
PLATFORMS
188187
aarch64-linux-musl
189-
x86_64-linux
190188

191189
DEPENDENCIES
192190
debug
@@ -205,5 +203,85 @@ DEPENDENCIES
205203
rubocop-rspec
206204
ruby_language_server!
207205

206+
CHECKSUMS
207+
activemodel (8.1.1)
208+
activerecord (8.1.1)
209+
activesupport (8.1.1)
210+
amatch (0.6.0)
211+
ansi (1.5.0)
212+
ast (2.4.3)
213+
base64 (0.3.0)
214+
bigdecimal (4.0.1)
215+
builder (3.3.0)
216+
coderay (1.1.3)
217+
concurrent-ruby (1.3.6)
218+
connection_pool (3.0.2)
219+
date (3.5.1)
220+
debug (1.11.1)
221+
drb (2.2.3)
222+
erb (6.0.1)
223+
etc (1.4.6)
224+
ffi (1.17.3-aarch64-linux-musl)
225+
formatador (1.2.3)
226+
fuzzy_match (2.1.0)
227+
guard (2.19.1)
228+
guard-compat (1.2.1)
229+
guard-minitest (2.4.6)
230+
guard-rubocop (1.5.0)
231+
i18n (1.14.8)
232+
io-console (0.8.2)
233+
irb (1.16.0)
234+
json (2.18.0)
235+
language_server-protocol (3.17.0.5)
236+
lint_roller (1.1.0)
237+
listen (3.9.0)
238+
logger (1.7.0)
239+
lumberjack (1.4.2)
240+
method_source (1.1.0)
241+
minitest (6.0.1)
242+
minitest-reporters (1.7.1)
243+
mize (0.6.1)
244+
nenv (0.3.0)
245+
notiffany (0.1.3)
246+
ostruct (0.6.3)
247+
parallel (1.27.0)
248+
parser (3.3.10.0)
249+
pp (0.6.3)
250+
prettyprint (0.2.0)
251+
prism (1.7.0)
252+
pry (0.16.0)
253+
psych (5.3.1)
254+
racc (1.8.1)
255+
rainbow (3.1.1)
256+
rake (13.3.1)
257+
rb-fsevent (0.11.2)
258+
rb-inotify (0.11.1)
259+
rb-readline (0.5.5)
260+
rdoc (7.0.3)
261+
readline (0.0.4)
262+
regexp_parser (2.11.3)
263+
reline (0.6.3)
264+
rubocop (1.82.1)
265+
rubocop-ast (1.49.0)
266+
rubocop-minitest (0.38.2)
267+
rubocop-performance (1.26.1)
268+
rubocop-rake (0.7.1)
269+
rubocop-rspec (3.8.0)
270+
ruby-progressbar (1.13.0)
271+
ruby_language_server (0.4.2)
272+
securerandom (0.4.1)
273+
shellany (0.0.1)
274+
sqlite3 (2.9.0-aarch64-linux-musl)
275+
stringio (3.2.0)
276+
sync (0.5.0)
277+
thor (1.4.0)
278+
timeout (0.6.0)
279+
tins (1.51.0)
280+
tsort (0.2.0)
281+
tzinfo (2.0.6)
282+
unicode-display_width (3.2.0)
283+
unicode-emoji (4.2.0)
284+
uri (1.1.1)
285+
208286
BUNDLED WITH
209-
2.6.8
287+
4.0.3

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ LOCAL_LINK=-v $(PWD):/tmp/src -w /tmp/src
44
image:
55
docker build -t $(PROJECT_NAME) .
66

7+
force_rebuild_image:
8+
docker build --no-cache -t $(PROJECT_NAME) .
9+
710
guard: image
811
echo > active_record.log
912
docker run -it --rm $(LOCAL_LINK) -e LOG_LEVEL=DEBUG $(PROJECT_NAME) bundle exec guard

lib/ruby_language_server/scope_data/scope.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Scope < Base
2424
# attr_accessor :name # method
2525
# attr_accessor :superclass_name # superclass name
2626

27-
def self.build(parent = nil, type = TYPE_ROOT, name = '', top_line = 1, column = 1, bottom_line = nil)
27+
def self.build(parent = nil, type = TYPE_ROOT, name = '', top_line = 1, column = 1, bottom_line = nil) # rubocop:disable Metrics/ParameterLists
2828
full_name = [parent&.full_name, name].compact.join(JoinHash[type])
2929
create!(
3030
parent:,
@@ -62,7 +62,7 @@ def set_superclass_name(partial)
6262
if partial.start_with?('::')
6363
self.superclass_name = partial.gsub(/^::/, '')
6464
else
65-
self.superclass_name = [parent ? parent.full_name : nil, partial].compact.join(JoinHash[class_type])
65+
self.superclass_name = [parent&.full_name, partial].compact.join(JoinHash[class_type])
6666
end
6767
save!
6868
end

lib/ruby_language_server/scope_parser.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class PrismProcessor < Prism::Visitor
1515
include ScopeParserCommands::RspecCommands
1616
include ScopeParserCommands::RailsCommands
1717
include ScopeParserCommands::RubyCommands
18+
1819
attr_reader :current_scope, :lines
1920

2021
def initialize(lines = 1, shallow = false)
@@ -441,7 +442,7 @@ def type_is_class_or_module(type)
441442
[RubyLanguageServer::ScopeData::Base::TYPE_CLASS, RubyLanguageServer::ScopeData::Base::TYPE_MODULE].include?(type)
442443
end
443444

444-
def push_scope(type, name, top_line, column, end_line, close_siblings = true)
445+
def push_scope(type, name, top_line, column, end_line, close_siblings = true) # rubocop:disable Metrics/ParameterLists
445446
close_sibling_scopes if close_siblings
446447
new_scope = ScopeData::Scope.build(@current_scope, type, name, top_line, column, end_line)
447448
@current_scope = new_scope

0 commit comments

Comments
 (0)