Skip to content
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

Merged
merged 5 commits into from
Nov 18, 2020

Conversation

cartermp
Copy link
Contributor

@cartermp cartermp commented Nov 16, 2020

Another common error that gets people: #1121

image

Also works for DU and type abbreviation declarations.

image

meow

@cartermp
Copy link
Contributor Author

This is ready for review

Copy link
Member

@KevinRansom KevinRansom left a 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.

@cartermp
Copy link
Contributor Author

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

@cartermp cartermp added this to the 16.9 milestone Nov 17, 2020
@cartermp
Copy link
Contributor Author

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 cartermp merged commit 107d4cf into dotnet:main Nov 18, 2020
@smoothdeveloper
Copy link
Contributor

@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.

nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
* Add AddMissingEqualsToTypeDefinition code fixer

* Restrict to FS3360
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
* Add AddMissingEqualsToTypeDefinition code fixer

* Restrict to FS3360
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
* Add AddMissingEqualsToTypeDefinition code fixer

* Restrict to FS3360
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants