Skip to content

Fix methods tagged as Member instead of Method in tooltips#19507

Open
Copilot wants to merge 1 commit intomainfrom
copilot/fix-9141961-29048891-345a863f-6a16-4be3-bd21-c018b115b157
Open

Fix methods tagged as Member instead of Method in tooltips#19507
Copilot wants to merge 1 commit intomainfrom
copilot/fix-9141961-29048891-345a863f-6a16-4be3-bd21-c018b115b157

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Fix for methods being tagged as Member instead of Method in tooltips, a regression from #9563.

Root Cause

In NicePrint.fs and TypedTreeOps.fs, the SynMemberKind.Member case unconditionally used tagMember for all members, without distinguishing between actual methods (with parameters) and property-like members (without parameters).

Changes Made

  • src/Compiler/Checking/NicePrint.fs: In the SynMemberKind.Member tooltip layout, check if argInfos is non-empty to use tagMethod for methods vs tagMember for property-like members.
  • src/Compiler/TypedTree/TypedTreeOps.fs: In fullDisplayTextOfValRefAsLayout, check ValReprInfo.ArgInfos length to distinguish methods from property-like members (instance methods have >1 arg groups, static methods have >0).
  • 5 regression tests added in TooltipTests.fs: instance method, method with parameters, static method, property-like member, and auto property — verifying correct TextTag classification.
  • Release notes added.

Testing

  • All 38 tooltip tests pass (including 5 new ones)

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

@T-Gro
Copy link
Copy Markdown
Member

T-Gro commented Mar 27, 2026

@copilot : Try again

@T-Gro
Copy link
Copy Markdown
Member

T-Gro commented Mar 27, 2026

@copilot : Try again.

@T-Gro
Copy link
Copy Markdown
Member

T-Gro commented Mar 30, 2026

@copilot : Try again.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@abonie
Copy link
Copy Markdown
Member

abonie commented Mar 31, 2026

@copilot Try again

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot Try again

Fixed in 7bd4f64. Changes:

  • NicePrint.fs: In the SynMemberKind.Member tooltip layout, check isNil argInfos to use tagMethod for methods (non-empty args) vs tagMember for property-like members
  • TypedTreeOps.fs: In fullDisplayTextOfValRefAsLayout, check ValReprInfo.ArgInfos length to distinguish methods from members
  • 5 regression tests: instance method, method with params, static method, property-like member, auto property — all passing (38/38 tooltip tests pass)

Copilot AI changed the title [WIP] Copilot Request Fix methods tagged as Member instead of Method in tooltips Mar 31, 2026
Copilot AI requested a review from abonie March 31, 2026 10:50
@T-Gro T-Gro marked this pull request as ready for review April 10, 2026 07:27
@T-Gro T-Gro requested a review from a team as a code owner April 10, 2026 07:27
@T-Gro T-Gro force-pushed the copilot/fix-9141961-29048891-345a863f-6a16-4be3-bd21-c018b115b157 branch from 16d59f5 to 73884dd Compare April 10, 2026 10:05
In NicePrint.fs, the SynMemberKind.Member case unconditionally used tagMember
for all members. Now checks isNil argInfos to use tagMethod for methods vs
tagMember for property-like members.

In TypedTreeOps.fs fullDisplayTextOfValRefAsLayout, checks ValReprInfo.ArgInfos
length to distinguish methods from property-like members (instance >1 arg group,
static >0).

Added 5 regression tests: instance method, method with params, static method,
property-like member, and auto property.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@T-Gro T-Gro force-pushed the copilot/fix-9141961-29048891-345a863f-6a16-4be3-bd21-c018b115b157 branch from 73884dd to 9697305 Compare April 10, 2026 10:13
Copy link
Copy Markdown
Member

@auduchinok auduchinok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, this is nice! Thank you 🙂

if short then tauL
else
let nameL = layoutMemberName denv vref niceMethodTypars argInfos tagMember vref.DisplayNameCoreMangled true
let tag = if isNil argInfos then tagMember else tagMethod
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also check properties with parameters and indexers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

4 participants