Skip to content

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

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/fix-9141961-29048891-345a863f-6a16-4be3-bd21-c018b115b157
Draft

Fix methods tagged as Member instead of Method in tooltips#19507
Copilot wants to merge 5 commits 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:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md No current pull request URL (#19507) found, please consider adding it

Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/b27c5791-48eb-4cc0-98ea-a88977b5f4c5

Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
@abonie
Copy link
Copy Markdown
Member

abonie commented Mar 31, 2026

@copilot Try again

Copilot AI and others added 2 commits March 31, 2026 10:41
In NicePrint.fs, use tagMethod for SynMemberKind.Member when argInfos
is non-empty (indicating a method), tagMember otherwise.
In TypedTreeOps.fs, check ValReprInfo arg groups to distinguish methods
from property-like members in fullDisplayTextOfValRefAsLayout.
Add regression tests and release notes.

Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/bc1d07d8-2d87-4e39-9610-ca7f79ae7d79

Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
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
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.

3 participants