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

Code fix is not suggested at the proper places #16

Open
tugberkugurlu opened this issue Nov 19, 2014 · 2 comments
Open

Code fix is not suggested at the proper places #16

tugberkugurlu opened this issue Nov 19, 2014 · 2 comments
Labels

Comments

@tugberkugurlu
Copy link
Contributor

Visual Basic implementation doesn't suggest the code fix when the cursor is at the proper places. Taken from #15 (comment):

It seems that the problem is the node target. It only sees the node as ParameterSyntax when you select the whole parameter:

screenshot 2014-11-19 14 23 40

I would assume to get the refactoring suggestion when my cursor is around the parameter name as below but the node seems to be the ModifierIdentiferSyntax:

screenshot 2014-11-19 14 23 29

@sharwell
Copy link
Member

As a clarification, this feature currently only works when the entire parameter is selected, but it should work as long as the caret is located anywhere within the parameter's span.

@AdamSpeight2008
Copy link
Contributor

In the branch I'm working on (OrderPreserving) I've modified it so it suggests on Identifier of the Parameter. Just a couple of lines of code.

  ' Only offer a refactoring if the selected node is a type statement node.
    Dim _Identifier_ = TryCast( node, ModifiedIdentifierSyntax )
    If _Identifier_ Is Nothing Then Return 
    Dim _parmeter_ = TryCast(_Identifier_.Parent, ParameterSyntax)
    If _parmeter_ Is Nothing Then Return

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

No branches or pull requests

3 participants