[Repo Assist] fix: report all curried parameters in function application signature help#1469
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
Conversation
…help (#744) GetMethods only returns the first curried parameter group, so for `let f a b = ()` the Parameters array had one entry while ActiveParameter was 1, causing editors to highlight nothing for the second argument. Add FunctionApplicationParameters to SignatureHelpInfo built from mfv.CurriedParameterGroups, and use it in the LSP handler instead of MethodGroupItem.Parameters when present. Update the existing issue #744 test to also assert Parameters.Length = 2. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Feb 24, 2026
Open
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #744
Problem
When typing
f 1for a curried functionlet f a b = (),textDocument/signatureHelpreturned:{ "signatures": [{ "label": "val f : a:'a -> b:'b -> unit", "parameters": [{ "label": "a" }] }], "activeParameter": 1 }ActiveParameteris1butparametershas only one entry. Editors fall back to highlighting nothing (or the last known parameter) because index1is out of bounds for a single-element array.Root cause
GetMethods(the FCS API used ingetSignatureHelpForFunctionApplication) only exposes the first curried parameter group. Forlet f a b = ()it returns oneMethodGroupItemwhoseParametersarray contains onlya. The code already computedargumentIndexcorrectly, it just didn't have enough parameter entries to back it up.Fix
Add
FunctionApplicationParameters: (string * string)[] optiontoSignatureHelpInfo— one(name, typeDisplay)pair per curried group, derived directly frommfv.CurriedParameterGroups(already in scope) usingsymbolUse.DisplayContextfor type formatting.In
AdaptiveFSharpLspServer.TextDocumentSignatureHelp, useFunctionApplicationParameterswhen present (function application calls) instead ofMethodGroupItem.Parameters.The method-call path (
getSignatureHelpForMethod) is unchanged — it sets the new field toNone.Test status
Signatures[0].Parameters.Length = 2(previously the test only checkedActiveParameter).dotnet test -f net8.0 ./test/FsAutoComplete.Tests.Lsp/FsAutoComplete.Tests.Lsp.fsproj --filter "signature"); 2 skipped by design (ptestCaseAsyncfor issue 745).dotnet build— succeeded, 0 warnings, 0 errors.Trade-offs
FunctionApplicationParametersadds a small allocation per function-application signature-help request, but only when triggered. Impact is negligible.let f (a, b) c = ()) produce a single entry per group, formatted as"(a, b)"/"(T1 * T2)"— consistent with how the signature label already presents tuples.