skevar7
skevar7

Reputation: 1005

Visual Studio - smarter word completion wanted

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)

Upvotes: 0

Views: 448

Answers (4)

Scott Weinstein
Scott Weinstein

Reputation: 19117

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

Upvotes: 1

JaredPar
JaredPar

Reputation: 754665

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.

Upvotes: 3

Athiwat Chunlakhan
Athiwat Chunlakhan

Reputation: 7799

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.

Upvotes: 1

Rune FS
Rune FS

Reputation: 21742

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

Upvotes: 3

Related Questions