Project
ReSharper
Priority
Normal
Type
Feature
Fix versions
Mirabile Futurum
State
Open
Assignee
Sergey Shkredov
Subsystem
Code Completion
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Magnus mårtensson
    3 years ago (08 Sep 2008 16:50)
  • Updated by   Magnus mårtensson
    2 years ago (06 Feb 2010 17:05)
  • Jira: RSRP-79876
    (history, comments)
 
RSRP-79876 Intellisense should suggest undeclared items
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
For a long time I've wanted a feature in ReSharper: If I declare something unknown it turns red. What I want to do is leave the red there and move elsewhere in the code. Perhaps I declared a new variable, property or method but opted not to auto insert the declaration right then and there. I move manually to a different position in my code file to be able to in detail choose where to put my new member. If I start typing at this location that I chose I would love to have intellisence for the thing which is not declared. I attached a sample file of what I mean. Where it says No Suggestions I would like intellisence suggested for my variable aField.
Comments (6)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Ilya Ryzhenkov
  Ilya Ryzhenkov
14 Oct 2009 17:42
2 years ago
Do I understand correctly that you want create field at the point you start typing its name? Or do you mean you want to use it?
Magnus mårtensson
  Magnus mårtensson
14 Oct 2009 23:06
2 years ago
I want to put my cursor at a place where I want the 'aField' I have not declared and then as I begin to type I want to CREATE the field at that point.

As I start to type a-F and so on it would be cool if intellisence suggested the undeclared aField as an auto-complete where it says No suggestions. I find that quite often I don't want Resharper to put my declaration at the place where it winds up. Often I let Resharper introduce the variable/field or what have you and then I cut-paste it to a new location. That is two actions instead of one. If I could put my cursor where I want my new declaration and get autocomplete for it i would be very happy! THAT is the feature I am looking for.

Please get back to me if you need further clarifications!
Ilya Ryzhenkov
  Ilya Ryzhenkov
15 Oct 2009 00:50
2 years ago
So, after you have code like this ( | denotes caret)
class Foo
{
  aField|

  void Bar()
  {
    aField = 1;
  }
}

What do you want to do next?
Magnus mårtensson
  Magnus mårtensson
15 Oct 2009 01:06
2 years ago
Intresting question. If it can be possible I would like Resharper to be able to tab into template mode like when you type "prop<tab>". This scenario clearly intends to create a field or a property. I have not thought through if there would be different actions for field or property. Could that be solved with how you write the unknown declaration? "aField" expands to a new field, "AField" would be a public property since it is capitalized.

Another situation would be if I had written the code:

 
class Foo
{
  AMethod|

  void Bar()
  {
    AMethod(1);
  }
}


Then we would clearly have the intention to create a method named AMethod. Parameters can be inferred in the same way as "Extract Method".
Ilya Ryzhenkov
  Ilya Ryzhenkov
15 Oct 2009 01:19
2 years ago
Thanks for the input, we will think about such feature for one of the next versions of ReSharper.
Magnus mårtensson
  Magnus mårtensson
06 Feb 2010 17:05
2 years ago
Thank you for this. I have bloged about it in my blog (a post that will be published on Wednesday 10 (http://blog.noop.se/archive/2010/02/10/resharper-5.0-beta-for-visual-studio-2010.aspx).

I hope you continue to enhance this feature to apply to all scopes, within a class and even within a solution (global scope).

Cheers,

M.