Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Auto Add using for C# and C++/CLI projects

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
rhummer Posted - Jun 04 2007 : 10:53:03 AM
I think this would be a nice addition to VA X.

Say I am editing a C# or a C++/CLI file and I start using a class that I haven't included with the using, and I really can't remeber which name space it may be buried in. It would be useful if VA X could figure out that I have not included the namespace that class lives in.

so for example:

using System;
using System.Text;
using System.Collections.Generic;

namespace Foo
{
     public class Bar
     {
          void FooBar(String filename)
          {
               XmlTextReader reader = new XmlTextReader(filename)
          }
     }
}


I start using the XmlTextReader class, When VA X reparses the file, it would know it is a unknown symbol, and compare it with the list of using's at the top of the file and figure out that I do not have System.Xml.

so then we get:

using System;
using System.Text;
using System.Collections.Generic;
using System.Xml;

namespace Foo
{
     public class Bar
     {
          void FooBar(String filename)
          {
               XmlTextReader reader = new XmlTextReader(filename)
          }
     }
}


This is also useful if I know a class lives in the System.Xml namespace but can't remember if it lives in a namespace deeper in the root of System.Xml, for example.
2   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jan 27 2009 : 10:33:23 PM
VA and Visual Studio each do this already for managed code.

case=226 for native C/C++ is implemented in build 1715
Hover over an unrecognized symbol and choose "Add include xxxx" from the refactoring context menu.

feline Posted - Jun 04 2007 : 1:58:47 PM
This is on the list of things to consider:

case=226

Certainly in C#, VS2005 you can ask the IDE to add the using statement for you, if you can trigger the correct "context" menu on the class name.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000