Repository navigation
feat: support per-signature activeParameter, and render the current signatures after a retrigger - #1734
Merged
angelozerr merged 1 commit intoOct 20, 2026
Conversation
…ignatures after a retrigger Signature help takes a signature's own activeParameter, which LSP uses in place of the signature help's when it is provided (since 3.16), and renders each overload as the latest reply describes it. - ClientCapabilitiesFactory advertises signatureHelp.signatureInformation.activeParameterSupport. - LSPParameterInfoHandler.updateUI highlights the signature's activeParameter when it has one, and the signature help's otherwise. - The popup keeps the SignatureInformation objects of the reply that opened it, while updateParameterInfo stores each later reply in the LSPSignatureHelperPsiElement. updateUI now renders an overload from that latest reply, the signature there with the same label; without exactly one, it renders the shown signature as before. Parameters, their labels and the signature's activeParameter therefore follow a retrigger. Tests (LSPParameterInfoHandlerTest): the capability is advertised; a signature's activeParameter is highlighted; after a retrigger the shown overload renders the latest reply's parameters and active parameter; without an overload of the same label the shown signature is rendered. On main the first three fail (expected:<true> but was:<null>; " first" highlighted instead of " second"; the old " first, second" rendered). ./gradlew check: 607 tests, 0 failures, the 3 existing skips.
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 14 minutes. View limit details
Comment |
Contributor
|
LGTM, thanks @lagergren ! |
This was referenced Oct 28, 2026
angelozerr
pushed a commit
that referenced
this pull request
Nov 4, 2026
* docs: describe the 0.30.0 LSP and DAP changes that the docs miss Several changes merged for 0.30.0 changed behavior that the docs describe, or added behavior that they don't. LSPSupport.md still said that pull diagnostics don't support related documents, which #1723 changed. LSP: - LSPSupport.md, Pull Diagnostics: previousResultId, and the relatedDocuments of either kind of report (#1723, #1735), in place of "It doesn't support the related documents." - LSPSupport.md, Inline Completion: the trigger kind and the selected completion item (#1715). - LSPSupport.md, Signature Help: the retrigger, the active parameter of each signature, and signatures without parameters (#1712, #1734). - LSPSupport.md, Formatting: a file without an open editor (#1707). - LSPSupport.md, new Did Change Watched Files section: the directories outside the project that watchers name, and the watchers of a stopped server (#1742). The support list links to it. - UserGuide.md, Formatting: the Do not format patterns (#1817). - UserDefinedLanguageServer.md, Configuration tab: null properties (#1710, #1847) and invalid JSON (#1828). - DeveloperGuide.md, Workspace Configuration: null members of createSettings() (#1710, #1847). DAP, dap/UserGuide.md: - Exception breakpoint: the hint built from exceptionInfo (#1761). The screenshot of the stop at the exception moves back after the example it shows; the Smart Step Into section had come between them. - Large variables: a page with fewer children than asked for is the last one (#1851). Validation: each statement was checked against the code at d1a281d: DocumentContentSynchronizer.refreshPullDiagnostic, LSPInlineCompletionProvider.createParams, LSPParameterInfoHandler, ClientCapabilitiesFactory, AbstractLSPFormattingService.canFormat, LSPFormattingSupport, FileSystemWatchRoots, LanguageServerPanel .validateJsonFields, JsonSettingsTypeAdapterFactory, DAPClient.getExceptionHint and DAPVariableChildren. The other changes merged for 0.30.0 are already documented, by their own PRs, #1784 and #1810, or change nothing that the docs describe. Limits: docs only, no new screenshots, no build run. * docs: say that the JSON fields of a language server are read leniently CodeRabbit noted that "must be valid JSON" is stricter than what LSP4IJ accepts. The dialog's check (LanguageServerPanel.jsonError, JsonParser.parseString) and the readers at run time (SettingsHelper.parseJson, JsonParser.parseReader for the initialization options, experimental and installer, Gson.fromJson for the client configuration and workspace folders) all read leniently. The paragraph now says which JSON is accepted and which isn't. Validation: probed Gson 2.15.0's JsonParser.parseString and Gson.fromJson. Both accept // and /* */ and # comments, unquoted names and single-quoted strings, and both reject a trailing comma, a missing brace and an unescaped backslash, such as in C:\Users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Signature help now takes a signature's own
activeParameter, and shows each overload as the latest reply describes it. This is the follow-up #1712 left out, since LSP4IJ did not advertiseactiveParameterSupport.Problem
SignatureInformation.activeParameterwas ignored. The popup highlighted the signature help'sactiveParameter, or the first parameter, in every overload, also when the overload said which of its parameters is active. LSP4IJ did not advertisesignatureInformation.activeParameterSupport, so a server could not rely on it either.SignatureInformationobjects of the reply that opened it.updateParameterInfostores each later reply in theLSPSignatureHelperPsiElement, butupdateUIrendered the original objects, so an overload's parameters, their labels and its active parameter stayed as the first reply described them.Why
SignatureInformation,
activeParameter: "The index of the active parameter. If provided, this is used in place ofSignatureHelp.activeParameter." The client capabilityactiveParameterSupport: "The client supports theactiveParameterproperty onSignatureInformationliteral."Change
ClientCapabilitiesFactoryadvertisessignatureHelp.signatureInformation.activeParameterSupport.LSPParameterInfoHandler.updateUIhighlights the signature'sactiveParameterwhen it has one, and the signature help's otherwise.updateUIrenders an overload from the latest reply stored in the parameter owner: the signature there with the same label. Without exactly one, it renders the shown signature as before.Validation
LSPParameterInfoHandlerTest, four new tests:mainexpected:<true> but was:<null>firsthighlightedsecondfirst, secondfirst: Int, second: String, withsecond: Stringhighlighted./gradlew check: 607 tests, 0 failures, the 3 existing skips.Not included
null, no active parameter, cannot be told from an absentactiveParameterwith LSP4J'sInteger; it falls back to the signature help's, as an absent one does.