Skip to content

Conversation

@Martin521
Copy link
Contributor

@Martin521 Martin521 commented Mar 7, 2025

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
Copy link
Contributor

github-actions bot commented Mar 7, 2025

❗ 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/9.0.300.md

@Martin521 Martin521 closed this Mar 7, 2025
@Martin521 Martin521 reopened this Mar 7, 2025
@Martin521 Martin521 closed this Mar 7, 2025
@Martin521 Martin521 reopened this Mar 7, 2025
@majocha
Copy link
Contributor

majocha commented Mar 7, 2025

Old IncrementalBuilder just appended parse errors here:

let newErrors = 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:

let ComputeParseAndCheckProject (projectSnapshot: ProjectSnapshot) =

and it looks like it ignores parse errors (?)

@Martin521
Copy link
Contributor Author

Martin521 commented Mar 7, 2025

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.

@Martin521 Martin521 changed the title just a test Fix for missing parse diagnostics in TransparentCompiler.ComputeParseAndCheckProject Mar 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 owner March 10, 2025 07:00
@Martin521 Martin521 changed the title Fix for missing parse diagnostics in TransparentCompiler.ComputeParseAndCheckProject Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject Mar 10, 2025
Copy link
Contributor

@psfinaki psfinaki left a comment

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:main Mar 10, 2025
33 checks passed
@Martin521 Martin521 mentioned this pull request Apr 9, 2025
4 tasks
Sign up for free to 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