Skip to content

Commit 9668794

Browse files
committed
Merge branch 'release/091'
0.9.1 Tue Jan 6 19:32:44 PST 2026 * Method parameters * Better class method handling
2 parents 02b6c63 + b26541e commit 9668794

18 files changed

Lines changed: 425 additions & 100 deletions

.github/badges/coverage.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "coverage",
4+
"message": "88%",
5+
"color": "green"
6+
}

.github/copilot-instructions.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# GitHub Copilot Instructions for ruby_language_server
2+
3+
## Running Commands
4+
5+
This project uses Docker for a consistent development environment. **Always use `bin/run_in_shell` instead of running Ruby, Bundler, or RSpec commands directly on the host.**
6+
7+
### Examples
8+
9+
**Don't do this:**
10+
```bash
11+
bundle exec rspec spec/lib/ruby_language_server/project_manager_spec.rb
12+
ruby -v
13+
bundle install
14+
```
15+
16+
**Do this instead:**
17+
```bash
18+
./bin/run_in_shell bundle exec rspec spec/lib/ruby_language_server/project_manager_spec.rb
19+
./bin/run_in_shell ruby -v
20+
./bin/run_in_shell bundle install
21+
```
22+
23+
### How it works
24+
25+
- `bin/run_in_shell` is a wrapper script that runs commands inside a Docker container
26+
- It ensures all Ruby, Bundler, and gem commands run in the correct environment
27+
- The container has all dependencies pre-installed and properly configured
28+
29+
### Common Commands
30+
31+
- Run tests: `./bin/run_in_shell bundle exec rake test`
32+
- Run specific test: `./bin/run_in_shell bundle exec ruby -Itest spec/path/to/file_spec.rb`
33+
- Open console: `./bin/run_in_shell bin/console`
34+
- Shell access: `./bin/run_in_shell sh`
35+
- Bundle install: `./bin/run_in_shell bundle install`
36+
37+
### Testing Framework
38+
39+
This project uses **Minitest**, not RSpec. Test files are located in the `spec/` directory but use Minitest syntax (`assert_equal`, `assert`, etc.).
40+
41+
### Make targets
42+
43+
You can also use make targets which automatically use `run_in_shell`:
44+
- `make test` - Run all tests
45+
- `make console` - Open interactive console
46+
- `make shell` - Open shell in container

.github/workflows/test.yml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,73 @@ on:
1616
jobs:
1717
test:
1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
1921
steps:
2022
- uses: actions/checkout@v2
21-
- name: Run tests
22-
run: make test
23+
- name: Run tests with coverage
24+
run: make coverage
25+
- name: Run rubocop
26+
run: make rubocop
27+
- name: Extract and update coverage badge
28+
run: |
29+
# Extract coverage percentage from SimpleCov's .last_run.json
30+
if [ ! -f coverage/.last_run.json ]; then
31+
echo "Error: coverage/.last_run.json not found"
32+
exit 1
33+
fi
34+
35+
# Use sed for better portability - account for optional spaces after colon
36+
# SimpleCov format: { "result": { "line": 87.63 } }
37+
COVERAGE=$(sed -n 's/.*"line": *\([0-9.]*\).*/\1/p' coverage/.last_run.json | head -1)
38+
if [ -z "$COVERAGE" ]; then
39+
echo "Error: Could not extract coverage percentage"
40+
echo "Contents of coverage/.last_run.json:"
41+
cat coverage/.last_run.json
42+
exit 1
43+
fi
44+
45+
COVERAGE_INT=$(printf "%.0f" "$COVERAGE")
46+
echo "Coverage: $COVERAGE_INT%"
47+
48+
# Determine badge color based on coverage
49+
if [ "$COVERAGE_INT" -ge 90 ]; then
50+
COLOR="brightgreen"
51+
elif [ "$COVERAGE_INT" -ge 80 ]; then
52+
COLOR="green"
53+
elif [ "$COVERAGE_INT" -ge 70 ]; then
54+
COLOR="yellowgreen"
55+
elif [ "$COVERAGE_INT" -ge 60 ]; then
56+
COLOR="yellow"
57+
else
58+
COLOR="red"
59+
fi
60+
61+
# Create badge JSON for shields.io endpoint
62+
mkdir -p .github/badges
63+
cat > .github/badges/coverage.json << EOF
64+
{
65+
"schemaVersion": 1,
66+
"label": "coverage",
67+
"message": "${COVERAGE_INT}%",
68+
"color": "$COLOR"
69+
}
70+
EOF
71+
72+
# Configure git
73+
git config user.name "github-actions[bot]"
74+
git config user.email "github-actions[bot]@users.noreply.github.com"
75+
76+
# Commit and push if changed
77+
git add .github/badges/coverage.json
78+
if git diff --staged --quiet; then
79+
echo "No changes to coverage badge"
80+
else
81+
git commit -m "Update coverage badge: ${COVERAGE_INT}%"
82+
# Pull any changes before pushing
83+
git pull --rebase origin ${{ github.ref_name }} || true
84+
git push || {
85+
echo "Warning: Failed to push badge update"
86+
exit 0
87+
}
88+
fi

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Metrics/ClassLength:
8282
Exclude:
8383
- 'lib/ruby_language_server/scope_parser.rb'
8484

85+
# Configuration parameters: CountComments.
86+
Metrics/ModuleLength:
87+
Max: 200
88+
8589
Metrics/CyclomaticComplexity:
8690
Max: 26
8791

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
#### 0.9.1 Tue Jan 6 19:32:44 PST 2026
4+
5+
* Method parameters
6+
* Better class method handling
7+
38
#### 0.9.0 Wed Dec 31 08:35:27 PST 2025
49

510
* Add socket support for IPC communication (alpha)

Gemfile.lock

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
ruby_language_server (0.9.0)
4+
ruby_language_server (0.9.1)
55
activerecord (~> 8.1)
66
amatch
77
bundler
@@ -212,88 +212,88 @@ DEPENDENCIES
212212
simplecov
213213

214214
CHECKSUMS
215-
activemodel (8.1.1)
216-
activerecord (8.1.1)
217-
activesupport (8.1.1)
218-
amatch (0.6.0)
219-
ansi (1.5.0)
220-
ast (2.4.3)
221-
base64 (0.3.0)
222-
bigdecimal (4.0.1)
223-
builder (3.3.0)
224-
coderay (1.1.3)
225-
concurrent-ruby (1.3.6)
226-
connection_pool (3.0.2)
227-
date (3.5.1)
228-
debug (1.11.1)
229-
docile (1.4.1)
230-
drb (2.2.3)
231-
erb (6.0.1)
232-
etc (1.4.6)
233-
ffi (1.17.3-aarch64-linux-musl)
234-
formatador (1.2.3)
235-
fuzzy_match (2.1.0)
236-
guard (2.19.1)
237-
guard-compat (1.2.1)
238-
guard-minitest (2.4.6)
239-
guard-rubocop (1.5.0)
240-
i18n (1.14.8)
241-
io-console (0.8.2)
242-
irb (1.16.0)
243-
json (2.18.0)
244-
language_server-protocol (3.17.0.5)
245-
lint_roller (1.1.0)
246-
listen (3.9.0)
247-
logger (1.7.0)
248-
lumberjack (1.4.2)
249-
method_source (1.1.0)
250-
minitest (6.0.1)
251-
minitest-reporters (1.7.1)
252-
mize (0.6.1)
253-
nenv (0.3.0)
254-
notiffany (0.1.3)
255-
ostruct (0.6.3)
256-
parallel (1.27.0)
257-
parser (3.3.10.0)
258-
pp (0.6.3)
259-
prettyprint (0.2.0)
260-
prism (1.7.0)
261-
pry (0.16.0)
262-
psych (5.3.1)
263-
racc (1.8.1)
264-
rainbow (3.1.1)
265-
rake (13.3.1)
266-
rb-fsevent (0.11.2)
267-
rb-inotify (0.11.1)
268-
rb-readline (0.5.5)
269-
rdoc (7.0.3)
270-
readline (0.0.4)
271-
regexp_parser (2.11.3)
272-
reline (0.6.3)
273-
rubocop (1.82.1)
274-
rubocop-ast (1.49.0)
275-
rubocop-minitest (0.38.2)
276-
rubocop-performance (1.26.1)
277-
rubocop-rake (0.7.1)
278-
rubocop-rspec (3.8.0)
279-
ruby-progressbar (1.13.0)
280-
ruby_language_server (0.4.2)
281-
securerandom (0.4.1)
282-
shellany (0.0.1)
283-
simplecov (0.22.0)
284-
simplecov-html (0.13.2)
285-
simplecov_json_formatter (0.1.4)
286-
sqlite3 (2.9.0-aarch64-linux-musl)
287-
stringio (3.2.0)
288-
sync (0.5.0)
289-
thor (1.4.0)
290-
timeout (0.6.0)
291-
tins (1.51.0)
292-
tsort (0.2.0)
293-
tzinfo (2.0.6)
294-
unicode-display_width (3.2.0)
295-
unicode-emoji (4.2.0)
296-
uri (1.1.1)
215+
activemodel (8.1.1) sha256=8b7e2496b9e333ced06248c16a43217b950192c98e0fe3aa117eee21501c6fbd
216+
activerecord (8.1.1) sha256=e32c3a03e364fd803498eb4150c21bedc995aa83bc27122a94d480ab1dcb3d17
217+
activesupport (8.1.1) sha256=5e92534e8d0c8b8b5e6b16789c69dbea65c1d7b752269f71a39422e9546cea67
218+
amatch (0.6.0) sha256=247996bdce87754a42ed38ce8b22a4b8162e1699a8d353bc36bc96b544bd509d
219+
ansi (1.5.0) sha256=5408253274e33d9d27d4a98c46d2998266fd51cba58a7eb9d08f50e57ed23592
220+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
221+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
222+
bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
223+
builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
224+
coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
225+
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
226+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
227+
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
228+
debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
229+
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
230+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
231+
erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5
232+
etc (1.4.6) sha256=0f7e9e7842ea5e3c3bd9bc81746ebb8c65ea29e4c42a93520a0d638129c7de01
233+
ffi (1.17.3-aarch64-linux-musl) sha256=020b33b76775b1abacc3b7d86b287cef3251f66d747092deec592c7f5df764b2
234+
formatador (1.2.3) sha256=19fa898133c2c26cdbb5d09f6998c1e137ad9427a046663e55adfe18b950d894
235+
fuzzy_match (2.1.0) sha256=e97e25d0eaee48a5f77ed970d007c7b6ff3c6a6858303fead2d1986859204dfc
236+
guard (2.19.1) sha256=b8bc52694be3d8b26730280de7dcec7fe92ea1cff3414246fe96af3f23580f3d
237+
guard-compat (1.2.1) sha256=3ad21ab0070107f92edfd82610b5cdc2fb8e368851e72362ada9703443d646fe
238+
guard-minitest (2.4.6) sha256=d89e83d029447c13b191599085d24b6e2fe61e402d275e46491cd3e82f561572
239+
guard-rubocop (1.5.0) sha256=3041d796dcb5ee31e352de74732250826f5f235b4ff48df9dbf424a6dc736251
240+
i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5
241+
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
242+
irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806
243+
json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
244+
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
245+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
246+
listen (3.9.0) sha256=db9e4424e0e5834480385197c139cb6b0ae0ef28cc13310cfd1ca78377d59c67
247+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
248+
lumberjack (1.4.2) sha256=40de5ae46321380c835031bcc1370f13bba304d29f2b5f5bb152061a5a191b95
249+
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
250+
minitest (6.0.1) sha256=7854c74f48e2e975969062833adc4013f249a4b212f5e7b9d5c040bf838d54bb
251+
minitest-reporters (1.7.1) sha256=5060413a0c95b8c32fe73e0606f3631c173a884d7900e50013e15094eb50562c
252+
mize (0.6.1) sha256=4031558979ff5426fda24c75a149b4e4c0faf4cacf2fae8938f83866ab94b780
253+
nenv (0.3.0) sha256=d9de6d8fb7072228463bf61843159419c969edb34b3cef51832b516ae7972765
254+
notiffany (0.1.3) sha256=d37669605b7f8dcb04e004e6373e2a780b98c776f8eb503ac9578557d7808738
255+
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
256+
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
257+
parser (3.3.10.0) sha256=ce3587fa5cc55a88c4ba5b2b37621b3329aadf5728f9eafa36bbd121462aabd6
258+
pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
259+
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
260+
prism (1.7.0) sha256=10062f734bf7985c8424c44fac382ac04a58124ea3d220ec3ba9fe4f2da65103
261+
pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
262+
psych (5.3.1) sha256=eb7a57cef10c9d70173ff74e739d843ac3b2c019a003de48447b2963d81b1974
263+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
264+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
265+
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
266+
rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe
267+
rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e
268+
rb-readline (0.5.5) sha256=9e9bd7e198bdef0822c46902f6c592b882c1f9777894a4c3dcf5b320824a8793
269+
rdoc (7.0.3) sha256=dfe3d0981d19b7bba71d9dbaeb57c9f4e3a7a4103162148a559c4fc687ea81f9
270+
readline (0.0.4) sha256=6138eef17be2b98298b672c3ea63bf9cb5158d401324f26e1e84f235879c1d6a
271+
regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4
272+
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
273+
rubocop (1.82.1) sha256=09f1a6a654a960eda767aebea33e47603080f8e9c9a3f019bf9b94c9cab5e273
274+
rubocop-ast (1.49.0) sha256=49c3676d3123a0923d333e20c6c2dbaaae2d2287b475273fddee0c61da9f71fd
275+
rubocop-minitest (0.38.2) sha256=5a9dfb5a538973d0601aa51e59637d3998bb8df81233edf1ff421504c6280068
276+
rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834
277+
rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
278+
rubocop-rspec (3.8.0) sha256=28440dccb3f223a9938ca1f946bd3438275b8c6c156dab909e2cb8bc424cab33
279+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
280+
ruby_language_server (0.9.1)
281+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
282+
shellany (0.0.1) sha256=0e127a9132698766d7e752e82cdac8250b6adbd09e6c0a7fbbb6f61964fedee7
283+
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
284+
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
285+
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
286+
sqlite3 (2.9.0-aarch64-linux-musl) sha256=56a35cb2d70779afc2ac191baf2c2148242285ecfed72f9b021218c5c4917913
287+
stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
288+
sync (0.5.0) sha256=668356cc07c59ac7ed9ecf34fec3929831f179c07adb1f3e1c3b7a1609a638fd
289+
thor (1.4.0) sha256=8763e822ccb0f1d7bee88cde131b19a65606657b847cc7b7b4b82e772bcd8a3d
290+
timeout (0.6.0) sha256=6d722ad619f96ee383a0c557ec6eb8c4ecb08af3af62098a0be5057bf00de1af
291+
tins (1.51.0) sha256=9f83c534bfca23973c5e641308828d71d5ffa79fc32c0ef90996efa699d0696f
292+
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
293+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
294+
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
295+
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
296+
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
297297

298298
BUNDLED WITH
299299
4.0.3

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: image guard continuous_development console test shell run_in_shell server gem gem_release publish_cross_platform_image
1+
.PHONY: image guard continuous_development console test coverage rubocop shell run_in_shell server gem gem_release publish_cross_platform_image
22
PROJECT_NAME=ruby_language_server
33
LOCAL_LINK=-v $(PWD):/tmp/src -w /tmp/src
44

@@ -26,11 +26,15 @@ continuous_development: image
2626
console: image
2727
./bin/run_in_shell bin/console
2828

29+
# Note that we don't use run_in_shell because those are interactive and CI won't like that.
2930
test: image
3031
docker run --rm $(LOCAL_LINK) $(PROJECT_NAME) sh -c "bundle exec rake test && bundle exec rubocop"
3132

3233
coverage: image
33-
./bin/run_in_shell "COVERAGE=true bundle exec rake test"
34+
docker run --rm $(LOCAL_LINK) $(PROJECT_NAME) sh -c "COVERAGE=true bundle exec rake test"
35+
36+
rubocop: image
37+
docker run --rm $(LOCAL_LINK) $(PROJECT_NAME) sh -c "bundle exec rubocop"
3438

3539
shell: image
3640
./bin/run_in_shell sh

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
![Build Status](https://github.com/kwerle/ruby_language_server/actions/workflows/test.yml/badge.svg)
2+
![Coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/kwerle/ruby_language_server/copilot/add-test-coverage-badge/.github/badges/coverage.json)
23
# Overview
34

45
https://github.com/kwerle/ruby_language_server

lib/db/schema.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def write(*args)
1919
t.string :path
2020
t.string :class_type, null: false
2121
t.text :parameters # JSON string of method parameters
22+
t.boolean :class_method, default: false # true for class methods (def self.method)
2223
end
2324

2425
add_index :scopes, :name

0 commit comments

Comments
 (0)