-
Notifications
You must be signed in to change notification settings - Fork 808
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
Scoped nowarn #18049
base: main
Are you sure you want to change the base?
Scoped nowarn #18049
Conversation
❗ Release notes required
|
Hi @Martin521 - thanks for the contribution. It's a substantial effort and we appreciate it. The PR is on our radar - just keep in mind that it's big and specific, and it will take time to find capacity for it. If anyone from the community gets to thoroughly review it, that would be valuable as well. Thanks for your diligence and patience :) |
Ok, I have added various compiler service and AST tests that should safeguard the editor behavior. |
This is great news @Martin521! I will set aside some time during April to review this fully. |
Hi @Martin521 , I am reviewing + testing this branch incl. editor scenarios today. However, when I removed the top level old-style "nowarn", nothing happened - no warnigs! I then had to make some other tweaks, such as adding a pair of "nowarn"+"warnon" somewhere in the file, for the actions to really happen. Once I broke this initial staleness, it all worked fine from there. So there is this special scenario where the removal of a single old-style "nowarn" does not do anything. Video attached: NoWarn.mp4 |
More focused video on the same problem, it might give you some hints on what triggers a change perhaps? NoWarn2.mp4 |
Thanks for testing! I actually came across a similar "startup" issue when testing with Ionide a few days ago. I have an idea what the cause might be and will find out. It will take a few days though since I am travelling. |
It seems that due to my initial focus on the compile (fsc) use case I didn't cover all editor use cases properly. It won't be so difficult to fix this, but it will take some time. Therefore, I will make this PR draft again. Sorry for prematurely asking for review. |
No need to apologize :). |
Description
Implements Scoped Nowarn according to draft RFC FS-1146.
This PR has taken a while. I had to deal with much more complexity than I imagined when I naively volunteered to tackle the feature request. Anyway, here we are.
I have split the PR into 7 commits that can be reviewed in sequence.
All of them compile, 1 and 4 - 7 also pass all tests locally.
Add the feature flag, baseline tests, and the core
WarnScopes
module. Seesrc/Compiler/SyntaxTree/WarnScopes.fsi
and the RFC for the functionality of the module.Add the necessary changes to lexing and parsing. Note that the warn directives can no longer be collected during parsing (since they can now appear not only in top-level modules, but anywhere). So we collect them during lexing, similar to the processing of #if/#else/#endif directives.
Remove legacy #nowarn processing (but hold off AST changes)
Integrate the WarnScopes functionality and test it
Add warn directive trivia (but hold off AST changes)
Enable warn directive trivia (which means AST changes)
Remove defunct types and parameters related to former #nowarn processing (more AST changes)
There is also a separate commit for the IlVerify baseline updates (change in line numbers only)
Checklist