Skip to content

Revert Roslyn diagnostics workaround (fix #16360)#19812

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

Revert Roslyn diagnostics workaround (fix #16360)#19812
T-Gro wants to merge 4 commits into
mainfrom
fix/issue-16360

Conversation

@T-Gro
Copy link
Copy Markdown
Member

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

Fixes #16360

Summary

Reverts the workaround introduced in #15982 that was causing F# diagnostics to appear doubled in VS tooltips. The original workaround was added because Roslyn wasn't surfacing diagnostics properly (#15972), but that issue has since been resolved on the Roslyn side.

Changes

  • DocumentDiagnosticAnalyzer.fs: Restore the original logic that reports parse diagnostics only in the syntax pass and excludes them from the semantic pass (via �rrors.ExceptWith(parseResults.Diagnostics)). This prevents the same diagnostic from showing up twice.
  • DocumentDiagnosticAnalyzerTests.fs: Add helper getSyntaxAndSemantic and six new tests verifying that diagnostics are not duplicated across syntax/semantic passes. Update existing test assertions from expecting 2 duplicated errors to expecting 1.
  • Release notes: Added entry for the fix.

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

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