Skip to content

Fix warn scopes trivia for fantomas #18637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 3, 2025

Conversation

Martin521
Copy link
Contributor

@Martin521 Martin521 commented May 29, 2025

Description

Fixes #18636

When adding "scoped nowarn" #18049, I misinterpreted how trivia are meant to be used. While working on the necessary Fantomas adaptation, I found now I should follow the way trivia for conditional directives (#if) are handled. This means that the whole line (including indentation and possibly comment) has to be reported as trivia. Currently, the comment is reported separately. Having two trivia in a row, however, cannot easily be handled in Fantomas. And consistency with conditional directives makes sense anyway.
This also simplifies some of the "scoped nowarn" code.

Checklist

  • Test cases added
  • Performance benchmarks added in case of performance changes
  • Release notes entry updated

Copy link
Contributor

github-actions bot commented May 29, 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/10.0.100.md

@Martin521 Martin521 changed the title Fix warn scopes for fantomas Fix warn scopes trivia for fantomas May 29, 2025
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling May 30, 2025
@T-Gro T-Gro enabled auto-merge (squash) May 30, 2025 09:17
@Martin521
Copy link
Contributor Author

Strange, ILVerify succeeds locally, fails in CI.
I will try again after the next merge.

@T-Gro
Copy link
Member

T-Gro commented Jun 2, 2025

Strange, ILVerify succeeds locally, fails in CI. I will try again after the next merge

Also in Release?

auto-merge was automatically disabled June 2, 2025 16:33

Head branch was pushed to by a user without write access

@Martin521
Copy link
Contributor Author

I am sure I double-checked last week. Anyway, it seems to be ok now.

@T-Gro T-Gro merged commit a3e5190 into dotnet:main Jun 3, 2025
39 checks passed
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.

warn directive trivia are not compatible with fantomas
2 participants