GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — LSP-based code assistance by gselzer · Pull Request #80 · scijava/script-editor

Conversation

@gselzer

@gselzer gselzer commented Oct 21, 2026

Copy link
Copy Markdown
Member

This PR enables the script editor to provide real-time autocompletion, hover information, diagnostics, and more. It utilizes the Language Server Protocol, using scijava-code-lsp.

See scijava/scijava#294 for discussion

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gselzer and others added 26 commits October 7, 2026 14:40
@gselzer @claude
Rework editor completion onto the neutral CodeCompleter SPI
39891ea
Make the script editor a thin adapter over scijava-common's toolkit-agnostic
completion SPI, so languages contribute completion with no Swing/RSTA code:

- SciJavaCompletionProvider: the single bridge translating neutral
  Completions to RSTA completions (BasicCompletion, or FunctionCompletion
  for callables so parameter assistance engages), and neutral
  ParameterChoices to RSTA's ParameterChoicesProvider.
- CodeCompleterLanguageSupport: lightweight completion tier installed for
  any language providing a CodeCompleterPlugin.
- SciJavaAutoCompletion + SciJavaCompletion/SciJavaFunctionCompletion +
  AdditionalEdits: apply language-neutral auto-imports (Completion.TextEdit)
  on acceptance, across both basic and function completions.
- EditorPane: resolve completion via explicit tiers (heavy RSTA plugin ->
  neutral CodeCompleter -> RSTA legacy -> Java fallback), tracking the
  installed support; existing LanguageSupportPlugins keep working.
- PromptPane: REPL Tab-completion via CodeCompletionService, so every
  language gets baseline interpreter completion.
- ClassUtil: reduced to a thin facade over scijava-common's ClassIndex.

pom.xml carries a temporary scijava-common.version override until a release
pins the new SPI.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@ctrueden @claude @gselzer
Add built-in Python (Jython) syntax highlighter
fefd8a5
Syntax highlighting requires an RSyntaxTextArea TokenMaker, which is
inherently editor-side. Provide it here so the toolkit-agnostic Jython
scripting plugin (scripting-jython) need not depend on the editor or RSTA;
this replaces the highlighter formerly in script-editor-jython.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@ctrueden @gselzer
Update copyright headers for 2026
7856a23
@ctrueden @gselzer
WIP
092b7f2
@gselzer
Show callable parameters in autocomplete
14bf70b
@gselzer
WIP: AI-generated overloaded params
68ad53e
@gselzer @claude
Show signature help, lazy docs and live updates
fb96908
* Render the parameter tooltip's overload list from the completer's
  signature help: its order, styled by fit (conversions greyed,
  mismatches struck out), ignoring help about nested calls. Remove
  Overloads, whose language-specific parsing and rules moved to the
  completers.
* Ask for completion descriptions only when RSTA shows them, and show
  them for function completions too (RSTA's FunctionCompletion dropped
  them).
* Update the completion popup in place when a result announces a better
  one, if the text and caret are unchanged.
* Let completers prepare when a script's completion support installs.
* Pass the edited script's file path in completion requests.
* Color dimmed overloads from the Look & Feel's disabled text color.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Tell completers when a script's editor closes
19b5db1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Show hover docs, problems and signatures as typed
fe3ed2a
For languages whose completer offers them: what is known about the code under the mouse as tooltip (HoverToolTipSupplier); problems as squiggles (DiagnosticsParser, an RSTA parser asking in the background); and, once a call's parenthesis is typed, its signatures in a popup following the caret through the call (SignaturePopup). Hover and problems can be turned off in the Options menu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Talk to language servers
b842236
The editor is now an LSP client of a LanguageServerService's merged server per language: DocumentSync keeps the server's copy of the script up to date (opened on install, changed with each edit, closed on uninstall, reopened when saved under another name). SciJavaCompletionProvider turns LSP completions into RSTA's: snippets with label details become function completions (parameter assistance with types), overloads listed with their signature-help fits, documentation resolved when shown, slower completions (UpdatingCompletionList) replacing the first. Parameter choices are what the server completes at the parameter. Hover, problems (as published) and the signature popup use the server too. Until code-api goes, CodeCompleters can still be used directly, via code-lsp's adapter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Move off scijava-code-api, now removed
bba9c03
Completions' additional edits are AdditionalEdits.Edit; the REPL prompt
completes via the LanguageServerService (or a BindingsLanguageServer for
languages without servers); the tests use fake language servers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Ask language servers through script sessions
262c6c7
DocumentSync is replaced by code-lsp's ScriptSession: one per text area
(completion, signature help, hover and problems), and one per REPL
prompt, kept while its interpreter is the REPL's and closed with the
interpreter pane.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer
Minor cleanup
7b4ab38
Cleaned up some javadoc and deduped a few lines
@gselzer @claude
Follow code-lsp's packages by purpose
2ea0c9e
BindingsLanguageServer is now internal to code-lsp, so the prompt's
javadoc no longer links to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Use ClassIndex directly, not the deprecated ClassUtil
7b99213
ClassUtil only forwards to code-lsp's ClassIndex; it stays, for code
outside the script editor still calling it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Ask for completions asynchronously
5d708bb
code-lsp no longer answers with completions now and better ones later,
nor rates signatures. The editor waits a moment for completions, and
shows slower ones as they arrive; signatures show in the server's order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow AbstractLanguageServer, as code-lsp renamed it
6ccfefa
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow scijava-code-lsp's ScriptSession constructor and NO_STATE
56dfdf3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow scijava-code-lsp: sessions are made with the service
0530536
Sessions tell their servers off the caller's thread, so a test waits for
the server to hear of the script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Make test sessions with a fake LanguageServerService
7e6a4af
ScriptSession is made with a service only: FakeServers gives each test
session a fake server of its own, which sees scripts as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow scijava-code-lsp's sessions and environments
fd5c884
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow scijava-code-lsp: documents declare extra variables
ba4b450
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Use scijava-common 2.101.0, not a snapshot
c5b11ad
The snapshot was in-development deprecations only, which nothing here
needs; 2.101.0 is what scijava-code-lsp is built against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow scijava-code-lsp: sessions make their documents
5aa6930
LanguageServerService no longer has document(): ScriptSession processes
scripts itself. So FakeServers need not (and cannot) offer it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow the rename to AbstractInProcessLanguageServer
d34347c
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Find the call around the caret with Positions
af6e480
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer gselzer mentioned this pull request Nov 11, 2026
Add scijava-code-lsp et al scijava/scijava#294
Draft
gselzer and others added 2 commits November 11, 2026 15:16
@gselzer @claude
Follow CompletionItems, and read name-first parameters
ef6358c
Function completions no longer carry a return type (LSP has no field for
one): the detail, e.g. the full signature, is their short description.
Parameter lists may be written name first, e.g. (a: float, b: int = 0),
as ty writes them, as well as type first, e.g. (double a, double b).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gselzer @claude
Follow CompletionItems.methodSnippet's rename to method
a51d3ce
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@gselzer @ctrueden
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.