GROOVY-12003: Add /img command to groovysh for inline image and chart…#2521
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2521 +/- ##
==================================================
+ Coverage 67.8394% 68.0714% +0.2321%
- Complexity 32547 32646 +99
==================================================
Files 1497 1497
Lines 124870 124982 +112
Branches 22478 22508 +30
==================================================
+ Hits 84711 85077 +366
+ Misses 32798 32426 -372
- Partials 7361 7479 +118
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new /img command to groovysh, enabling inline image display via JLine terminal graphics (Sixel/Kitty/iTerm2) with a summary-line fallback and an optional Swing --gui display path. It also wires the command into groovysh documentation and editor/highlighter support, and adds smoke tests for the fallback/error paths.
Changes:
- Add
/imgcommand implementation (input parsing, image loading/coercion, terminal display, Swing fallback) and tab-completion/help text. - Document
/imgusage and supported input types in the groovysh user guide. - Update nano syntax/highlighter resources and add JUnit smoke tests for
/img.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyCommands.groovy | Implements /img command, registers it conditionally, adds completer and help text. |
| subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/Main.groovy | Adds /img to file-argument highlighting wiring. |
| subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc | Adds /img documentation, examples, and screenshots. |
| subprojects/groovy-groovysh/src/main/resources/nanorc/args.nanorc | Adds img to the recognized command list for highlighting. |
| subprojects/groovy-groovysh/src/main/resources/nanorc/groovy.nanorc | Adds val to Groovy type/keyword highlighting. |
| subprojects/groovy-groovysh/src/test/groovy/org/apache/groovy/groovysh/commands/ImgTest.groovy | Adds smoke tests for /img fallback output and error handling. |
🚨 TestLens detected 90 failed tests 🚨Here is what you can do:
Test Summary
🏷️ Commit: 48b9e0f Test Failures (first 5 of 90)BugsStaticCompileTest > testServletError() (:test in Build and test / lts (17, macos-latest))GenericsSTCTest > testAssertJ() (:test in Build and test / lts (17, macos-latest))GenericsSTCTest > testGenericsAtMethodLevelWithGenericsInTypeOfGenericType() (:test in Build and test / lts (17, macos-latest))GenericsSTCTest > testMockito() (:test in Build and test / lts (17, macos-latest))GenericsSTCTest > testReturnTypeInferenceWithMethodGenerics18() (:test in Build and test / lts (17, macos-latest))Muted TestsSelect tests to mute in this pull request:
Reuse successful test results:
Click the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app. |
… display