views:

162

answers:

4

I'd like word completion to show all matching type names (not only those in imported namespaces). If nampespace of that type is not imported - it should be imported as I choose the type from list, and if that type was in the non-referenced assembly - that assembly should be added to project references (adding imports and references - after prompt, of course)
Trying to recollect exact type name and it's namespace is real pain sometimes. Is there any product with such completion? (Yes, I know about Resharper. No, it doesn't support this)

PS and it would be really great, if word completion could show all types having text anywhere in the name - not only in the beginning. For example, I type "writer" - and completion shows me all writers (TextWriter, StringWriter, StreamWriter - etc)

+3  A: 

You should take a look at ReSharper (Again) it does support the functionality with part of a type name or only writing the capital letters of a camel case type name e.g. SomeType can be found with ST.

The number of assemblies any tool will look in for possible types will always be limited. After all unless you tell the tool about the assemblies (tell in some way as in registering an assembly in the GAC, referencing it or any other means) the tool will simply not know of that assembly at will therfor not search it. On top of that you really do not want the tool to search through to many assemblies since you'd then risk being done writing the full name of any type before the tool will be done searching

Rune FS
I looked again and don't see part-name search in Resharper. When typing "Writer" it doesn't show any suggestions, although "System.IO" namespace is imported. And well, checking all GAC assemblies *might be* too slow. Looking in assemblies referenced by the current project definitely won't be slow, though.
skevar7
the part name is a shortcut ctrl-t or ctrl-n depending on the shortcut layout of choice
Rune FS
Ctrl+T is wildcard search, *not* part name search. Be more precise.Not exactly what I want but it's better than nothing, though.
skevar7
+1  A: 

What you are looking for is c# reshaper. Just type something in like MD and press Ctrl+Space it will bring up every standard include. Just press space to confirm(in this case MD5 will show up). It also learns what you use most.

Jonathan Shepherd
+3  A: 

Right or wrong, the goal of intellisense is to provide legal completions for the current edit positions. This is by no means 100% accurate but we do strive for listing only valid completions.

Showing type names which are not imported and/or not a type in the assembly the current project references flies in the face of this approach. It is instead suggesting code that is known to be illegal to the user.

True we could then go back and fix this up by adding an assembly reference. But some users may find this very annoying. They are typing up code and suddenly references are added and their imports are changed.

I'm not saying this is necessarily a bad feature, just that it goes against the current design philosophy and has the potential to upset a good portion of users.

JaredPar
I wish I could up-vote more than once!
John Kraft
I wrote add reference "after prompt" :-/
skevar7
+1  A: 

In addition to Resharper, CodeRush also has this feature. The free version probably does too.

Scott Weinstein