Add AddMissingEqualsToTypeDefinition code fixer#10470
Conversation
|
This is ready for review |
vsintegration/src/FSharp.Editor/CodeFix/AddMissingEqualsToTypeDefinition.fs
Outdated
Show resolved
Hide resolved
KevinRansom
left a comment
There was a problem hiding this comment.
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