I’m using VB.NET with Visual Studio 2010. Is there any function or tool to auto complete any .Net type name to fully qualified one?
I mean a tool/function that actually changing the source code from short hand to fully qualified name like following:
From String to System.String
From Process.Start to this System.Diagnostics.Process.Start
UPDATE:
Thanks for ReSharper suggestion. But
I’m not prepared to buy it or award
bounty for a commercial product
suggestion. Sorry about that. I should
make my question clear about that
requirement. I already tried ReSharper
before asking this question.
Here is a macro that works fine for C# code.
When I tested it on a VB .Net project it didn’t work for types in assembly references. Seems like the project code model for VB.Net excludes external types.
I include the code here anyway. Maybe someone else knows how to do it for VB
First we need a function that finds the current context
We also need a function that create all candidate names based on using/import statements
And then a function that loops all available items to find one of the candidates
Two small helper functions
And then we can write the main function which you can alter depending on how you want to use it.