GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — LSP-based code assistance by gselzer · Pull Request #80 · scijava/script-editor Conversation
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 reactionsMake 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]> 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]> * 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]> Co-Authored-By: Claude Opus 5.5 <[email protected]> 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]> 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]> 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]> 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]> Cleaned up some javadoc and deduped a few lines 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]> 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]> 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]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> 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]> 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]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> 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]> 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]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> 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]> 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
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |