Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Auto Add using for C# and C++/CLI projects
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rhummer
Tomato Guru

USA
527 Posts

Posted - Jun 04 2007 :  10:53:03 AM  Show Profile  Reply with Quote
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.

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jun 04 2007 :  1:58:47 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jan 27 2009 :  10:33:23 PM  Show Profile  Reply with Quote
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.


Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000