Skip to content

Fix #16360: stop duplicating editor diagnostics (revert Roslyn workaround)#19812

Open
T-Gro wants to merge 5 commits into
mainfrom
fix/issue-16360
Open

Fix #16360: stop duplicating editor diagnostics (revert Roslyn workaround)#19812
T-Gro wants to merge 5 commits into
mainfrom
fix/issue-16360

Conversation

@T-Gro
Copy link
Copy Markdown
Member

@T-Gro T-Gro commented May 26, 2026

Fixes #16360.

Diagnostic messages produced by the F# editor analyzer were appearing twice in Visual Studio (once per analyzer pass), and the long-standing workaround for that (#15982) was suppressing duplicates in the analyzer itself.

With the underlying Roslyn duplication no longer occurring, the workaround is unnecessary. Removing it:

  • restores a single diagnostic per source location (tooltips, error list, squigglies),
  • lets the test helpers go back to asserting 1 diagnostic instead of 2,
  • removes the _HACK_PLEASE_REFER_TO_COMMENT_INSIDE test helpers, which are now identical to their normal counterparts.

A failing test was added first to lock in the expected single-diagnostic behavior, then the workaround was reverted, then the duplicated helpers were collapsed.

Copilot and others added 3 commits May 26, 2026 12:08
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member Author

@T-Gro T-Gro left a comment

Choose a reason for hiding this comment

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

LGTM – clean revert of the workaround now that Roslyn handles the diagnostics correctly. The ExceptWith logic is the right way to deduplicate, and the new tests cover the key scenarios well.

Two minor suggestions (non-blocking):

  1. Rename the HACK methods: Now that the workaround is gone, the TODO comments explaining the HACK names were removed, but the method names still carry the _HACK_PLEASE_REFER_TO_COMMENT_INSIDE suffix. Consider renaming them back to their original names (e.g. VerifyDiagnosticBetweenMarkers, VerifyErrorBetweenMarkers, VerifyErrorAtMarker) since the hack is no longer needed.

  2. Warning not duplicated across passes test: The source let x = 42 at module level doesn't produce any warnings (it's a public binding), so allWarnings is always empty and the assertion trivially passes. Consider using source that actually emits a warning (e.g. open System without using anything from it, or a private unused binding) to make the test meaningful.

@T-Gro T-Gro added the AI-reviewed PR reviewed by AI review council label May 26, 2026
@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

❗ 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
vsintegration/src docs/release-notes/.VisualStudio/18.vNext.md No current pull request URL (#19812) found, please consider adding it

Copilot AI changed the title Revert Roslyn diagnostics workaround (fix #16360) Fix failing "repository_lockdown" CI job by updating actions/github-script to v7 May 27, 2026
Copilot finished work on behalf of T-Gro May 27, 2026 13:41
The workaround referenced in #15982
is no longer in place, so the *_HACK_PLEASE_REFER_TO_COMMENT_INSIDE
methods are now identical to their non-suffixed counterparts.
Drop the duplicate definitions and route the call sites to the existing
VerifyErrorBetweenMarkers / VerifyErrorAtMarker helpers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@T-Gro T-Gro force-pushed the fix/issue-16360 branch from c6d8886 to bf5a09b Compare May 28, 2026 09:56
@T-Gro T-Gro changed the title Fix failing "repository_lockdown" CI job by updating actions/github-script to v7 Fix #16360: stop duplicating editor diagnostics (revert Roslyn workaround) May 28, 2026
@T-Gro T-Gro requested a review from abonie May 28, 2026 12:34
@T-Gro T-Gro enabled auto-merge (squash) May 28, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-reviewed PR reviewed by AI review council AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

[FSharp.Editor] Tooltips are broken in project file but not in script file, and message shown twice.

1 participant