Skip to content

Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject - #18366

Merged
psfinaki merged 6 commits into
dotnet:mainfrom
Martin521:trc-issue
Mar 10, 2025
Merged

Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject#18366
psfinaki merged 6 commits into
dotnet:mainfrom
Martin521:trc-issue

Conversation

@Martin521

@Martin521Martin521 commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes#18371.

TransparentCompiler.ParseAndCheckProject does not return any parse errors (while the BackgroundCompiler counterpart does).

This PR fixes this and adds a test.

@github-actions

github-actionsBot commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

❗ Release notes required


✅ Found changes and release notes in following paths:

Change pathRelease notes pathDescription
src/Compilerdocs/release-notes/.FSharp.Compiler.Service/9.0.300.md

@majocha

Copy link
Copy Markdown
Contributor

Old IncrementalBuilder just appended parse errors here:

letnewErrors= Array.append parseErrors (capturingDiagnosticsLogger.Diagnostics |> List.toArray)

I'm not sure how parse errors are handled by Transparent Compiler. They do surface correctly in the IDE, but the code path of this test goes through ComputeParseAndCheckProject:

letComputeParseAndCheckProject(projectSnapshot:ProjectSnapshot)=

and it looks like it ignores parse errors (?)

@Martin521

Martin521 commented Mar 7, 2025

Copy link
Copy Markdown
ContributorAuthor

and it looks like it ignores parse errors (?)

Yes. The parse error is still correctly returned here

return FSharpParsedFile(fileName, inputHash, sourceText, input, diagnosticsLogger.GetDiagnostics())

but doesn't make it to the project results.

@Martin521Martin521 changed the title just a testFix for missing parse diagnostics in TransparentCompiler.ComputeParseAndCheckProjectMar 10, 2025
@Martin521
Martin521 marked this pull request as ready for review March 10, 2025 07:00
@Martin521
Martin521 requested a review from a team as a code ownerMarch 10, 2025 07:00
@Martin521Martin521 changed the title Fix for missing parse diagnostics in TransparentCompiler.ComputeParseAndCheckProjectFix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProjectMar 10, 2025

@psfinakipsfinaki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you Martin!

@psfinaki
psfinaki merged commit b99cd60 into dotnet:mainMar 10, 2025
@Martin521Martin521 mentioned this pull request Apr 9, 2025
4 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

FSharpChecker.ParseAndCheckProject doesn't report parse errors in TransparentCompiler mode

4 participants

@Martin521@majocha@vzarytovskii@psfinaki