Record the parameter and type parameter counts of a navigable item - #20531
Open
xperiandri wants to merge 2 commits into
Open
xperiandri wants to merge 2 commits into
xperiandri wants to merge 2 commits into
Conversation
Navigate To orders matches that are otherwise equal by these counts for C# and VB. NavigableItem now carries them: every curried and tupled argument of the method a declaration compiles to, without the instance and without a solitary unit argument, and its explicitly declared type parameters. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 13, 2026
Contributor
|
🔍 Tooling Safety Check — Affects-Design-Time
|
T-Gro
reviewed
Sep 14, 2026
T-Gro
left a comment
Member
There was a problem hiding this comment.
🤖 🕵️ AI review — verify independently.
| | SynType.LongIdent(SynLongIdent([ id ], _, _)) -> id.idText = "unit" | ||
| | SynType.Paren(innerType, _) | ||
| | SynType.WithGlobalConstraints(innerType, _, _) -> isUnitType innerType | ||
| | _ -> false |
Member
There was a problem hiding this comment.
🤖 🕵️ Named unit parameter counted as 1 in the signature but 0 in the implementation — different Navigate To sort keys for the same zero-argument method.
// NamedUnit.fsi
module NamedUnit
val Search : u: unit -> int
// NamedUnit.fs
module NamedUnit
let Search () = 1
T-Gro
self-requested a review
September 14, 2026 14:32
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.
Description
Navigate To orders matches of the same kind by a secondary sort. For C# and VB that key holds each declaration's parameter and type parameter counts, taken from Roslyn's declaration index, after the folder distance to the file being edited. dotnet/roslyn#85280 computes the same key for F# results, and needs F# to supply the two counts.
NavigateTo.GetNavigableItemsis where F# builds its declaration list from the parse tree, soNavigableItemnow carries:ParameterCount: every curried and tupled argument of the method the declaration compiles to. An instance member's self argument is not counted, and neither is a solitary unit argument:let f () = …andval f: unit -> intcount 0,let f () x = …counts 2. Bindings take it from the arity the parser inferred. For signatures, the parser leaves a solitary unit argument in the arity, so it is recognised from the type.TypeParameterCount: the explicitly declared type parameters of a type, binding or signature.This changes the public surface:
NavigableItemis a record, so code that constructs one must supply the two fields.Checklist
NavigateToTestscovers values, curried, tupled and unit functions, generic functions, types, instance and static members and properties, in implementation and signature files.🤖 Generated with Claude Code