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 missing instance member parameter code fix #11567

Merged
merged 3 commits into from
May 15, 2021

Conversation

cartermp
Copy link
Contributor

Adds this 'lil boi

image

@smoothdeveloper
Copy link
Contributor

Curious, can VS code fixer like this have a menu that would prompt for giving the name in case _ only gets us half way there?

Not a big deal, but could be a valid addition to this code fixer.

Also, maybe one hardcoded option for this if this is a F# coding guideline / increase the "code I like" factor, when self reference is desired. VS code fixer is good place to suggest it.

I personally use x more than this, so I'd like an option to put my own name in the list as well.

@heronbpv
Copy link

Adding to @smoothdeveloper suggestion, is it possible to infer from context, as in, if other members in the type are using this/x/self/etc, suggest it, and "_" otherwise?

@cartermp
Copy link
Contributor Author

That could be an interesting follow up, but it's not something I'm interested in taking on here.

@KevinRansom
Copy link
Member

@cartermp : it's interesting that the error message uses the suggestion

  • x.Member(args) =

and the codefixer adds: _.Member(args) =

I can see arguments either way, but without contextual analysis, the error message should probably match the fixer and propose _.Foo() in this case.

What do you think?

@cartermp
Copy link
Contributor Author

I will just switch to x for now. It's also used quite a bit as examples online.

@cartermp cartermp merged commit 3cf3076 into dotnet:main May 15, 2021
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
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.

5 participants