Skip to content

Scripting terminal: idContext.ops completion and signature hints - #96

Merged
rubensworks merged 4 commits into
master-1.21-ltsfrom
terminal-ux-clean/11-completion
Oct 20, 2026
Merged

rubensworks merged 4 commits into
master-1.21-ltsfrom
terminal-ux-clean/11-completion

Conversation

@rubensworks

@rubensworks rubensworks commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Stacked on #95. There are four standalone commits:

  1. Completion of idContext.ops. Typing after idContext.ops. shows the matching global operators, with their signatures in the player's language, for example numberMax (Number, Number): Number.
    • Matching ignores case.
    • Up and Down select an item, Tab or Enter inserts name(, and Escape closes the list. Escape closes the list before it would leave the enlarged editor or close the screen.
    • The list only appears while typing. Moving the cursor or clicking elsewhere hides it.
    • The popup can grow past the editor's right edge, so signatures aren't cut off.
    • Accepting replaces the text directly instead of selecting it, so it doesn't change the member the card binds to.
  2. Signature hint. While the cursor is inside the arguments of an idContext.ops.x( call, including nested calls, x(Types): Output is shown above the line, like parameter info in IntelliJ and VS Code.
  3. Insert completions by clicking them. Clicking an entry inserts it, and scrolling on the list moves the selection, as in Integrated Dynamics' expression field (Expression cards in the Logic Programmer, editable as text IntegratedDynamics#1766).
  4. Color value types in completions and signatures. As in Expression cards in the Logic Programmer, editable as text IntegratedDynamics#1766, the input and output types are shown in the colors of their value types, as in tooltips: Integer gold, Boolean blue, List red, and so on. Object types such as Item and Block are gray by design in Integrated Dynamics.
    • The popup and hint now use a dark background, which those colors are made for, and the selected entry gets a neutral gray background instead of blue.
    • Signatures are built as components, so they also follow language changes.

Not included: completion of methods on values (item.). Scripts carry no static type information, so the receiver type is unknown, and listing every method of every value type would be mostly wrong suggestions.

The logic is in JavaScriptCompletions, with unit tests, and is exposed through ILanguageHandler.getCompletions and getSignatureHint (both default to null). Signatures are built once from Operators.REGISTRY.

Validation:

  • In-game: the popup for idContext.ops.itemst and numberm; Tab, and clicking an entry, both insert it; scrolling on the list moves the selection; the hint shows numberMax(Number, Number): Number with colored types.
  • build and runGameTestServer (25/25) pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39205496703

Coverage decreased (-0.8%) to 44.72%

Details

  • Coverage decreased (-0.8%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 599 coverage regressions across 4 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

599 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
org/cyclops/integratedscripting/client/gui/component/input/WidgetTextArea.java 362 0.0%
org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java 215 0.0%
org/cyclops/integratedscripting/core/language/LanguageHandlerJavaScript.java 19 78.69%
org/cyclops/integratedscripting/api/language/ILanguageHandler.java 3 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 4044
Covered Lines: 1937
Line Coverage: 47.9%
Relevant Branches: 1884
Covered Branches: 714
Branch Coverage: 37.9%
Branches in Coverage %: Yes
Coverage Strength: 23.82 hits per line

💛 - Coveralls

Typing after idContext.ops. now shows the matching global operators with
their signatures. Up and Down select one, Tab or Enter inserts it, and
Escape closes the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
While the cursor is inside the arguments of an idContext.ops call, its
argument and output types are shown above the line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
@rubensworks
rubensworks force-pushed the terminal-ux-clean/10-last-value branch from a7b646b to ad76d8b Compare October 19, 2026 05:37
@rubensworks
rubensworks force-pushed the terminal-ux-clean/11-completion branch from b7bd33a to 77d5d2b Compare October 19, 2026 05:37
Base automatically changed from terminal-ux-clean/10-last-value to master-1.21-lts October 20, 2026 17:03
Completions could only be chosen with the keyboard. Clicking one now
inserts it, and scrolling on the list moves through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Types in the completion list and signature hint were plain text. They are
now shown in the colors of their value types, as in tooltips, on a dark
background those colors are made for, with a neutral selection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
@rubensworks
rubensworks merged commit 26d4be9 into master-1.21-lts Oct 20, 2026
22 checks passed
@rubensworks
rubensworks deleted the terminal-ux-clean/11-completion branch October 20, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants