Skip to content

Fix warn scopes trivia for fantomas - #18637

Merged
T-Gro merged 6 commits into
dotnet:mainfrom
Martin521:fix-warn-scopes-for-fantomas
Jun 3, 2025
Merged

Fix warn scopes trivia for fantomas#18637
T-Gro merged 6 commits into
dotnet:mainfrom
Martin521:fix-warn-scopes-for-fantomas

Conversation

@Martin521

@Martin521Martin521 commented May 29, 2025

Copy link
Copy Markdown
Contributor

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

@github-actions

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

@Martin521Martin521 changed the title Fix warn scopes for fantomasFix warn scopes trivia for fantomasMay 29, 2025
@github-project-automationgithub-project-automationBot moved this from New to In Progress in F# Compiler and ToolingMay 30, 2025
@T-Gro
T-Gro enabled auto-merge (squash) May 30, 2025 09:17
@Martin521

Copy link
Copy Markdown
ContributorAuthor

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

@T-Gro

T-Gro commented Jun 2, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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

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.

warn directive trivia are not compatible with fantomas

2 participants

@Martin521@T-Gro