-
Notifications
You must be signed in to change notification settings - Fork 785
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
Add AddMissingEqualsToTypeDefinition code fixer #10470
Conversation
This is ready for review |
vsintegration/src/FSharp.Editor/CodeFix/AddMissingEqualsToTypeDefinition.fs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking for '=' in the error text seems a bit too hit or miss.
Okay, this one is fine as-is but a better approach is to make the error code unique rather than filter based on a heuristic |
vsintegration/src/FSharp.Editor/CodeFix/AddMissingEqualsToTypeDefinition.fs
Outdated
Show resolved
Hide resolved
Okay @KevinRansom I changed this to only trigger on the specific parse error that we raise for type declarations. I'll likely look into a separate error message for class declarations in a different PR, and then add that to this fixer only when that specific error message is available. This will avoid the heuristic of checking the contents of the message and avoid the case that @baronfel found. |
@cartermp should those code fixes also come with few tests to at least highlight the happy case? This will avoid regressions of the happy case, and if later on we find false positive or bugs, having tests for positive case provides aproximate exemple on how to write such test. I feel this would apply to all the code fixes PR that came recently. |
* Add AddMissingEqualsToTypeDefinition code fixer * Restrict to FS3360
* Add AddMissingEqualsToTypeDefinition code fixer * Restrict to FS3360
* Add AddMissingEqualsToTypeDefinition code fixer * Restrict to FS3360
Another common error that gets people: #1121
Also works for DU and type abbreviation declarations.
meow