473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Removing Unused Using Directives.

After going through about 56 classes today that people on my team have
developed over the last year. I found myself removing on average 7-10
using directives that were not needed in each class sigh.... I decided
that I needed to write an add-in to do this. My question is , how do I
make the decision if an included namespace is being used? Is there a
simple way to do this that anyone has figured out?

Thanks,
PD

Nov 13 '07 #1
5 1731
Is there a simple way to do this that anyone has figured out?
Yes; wait a few weeks, or download VS2008 beta 2 (pro); it includes a
mechanism to do this automatically on a per-file basis - probably
quicker to do this (perhaps finding/assigning the hotkey) on each
class than it is to write the add in. I suspect that power-tools like
resharper will also do this out-of-the-box.

Marc

Nov 13 '07 #2
Yep, Resharper does this. Ctrl-Alt-O.

On Nov 12, 10:57 pm, Marc Gravell <marc.grav...@gmail.comwrote:
Is there a simple way to do this that anyone has figured out?

Yes; wait a few weeks, or download VS2008 beta 2 (pro); it includes a
mechanism to do this automatically on a per-file basis - probably
quicker to do this (perhaps finding/assigning the hotkey) on each
class than it is to write the add in. I suspect that power-tools like
resharper will also do this out-of-the-box.

Marc

Nov 13 '07 #3
VS2008 beta 2 (pro)
Actually, I just checked, and this option is present even in the
express edition, with the mapping "Edit.RemoveUnusedUsings" if you
want to bind a key-press to it. I know I will ;-p

Marc
Nov 13 '07 #4
On Nov 13, 2:44 am, "Marc Gravell" <marc.grav...@gmail.comwrote:
VS2008 beta 2 (pro)

Actually, I just checked, and this option is present even in the
express edition, with the mapping "Edit.RemoveUnusedUsings" if you
want to bind a key-press to it. I know I will ;-p

Marc
Thanks or all the input folks. Marc you are speaking about VS2008
Express I am assuming?

Thanks,
PD

Nov 13 '07 #5
Yes - I'm looking at Visual C# 2008 Express Edition, Version
9.0.20706.1 Beta2

It would be reasonable therefore to hope that it is in the RTM of the
express edition. We'll find out very soon.

Marc
Nov 13 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: beliavsky | last post by:
Many of my C++ programs have the line using namespace std; but the "Accelerated C++" book of Koenig and Moo has many examples where the library names are included one at a time, for example ...
35
by: Geronimo W. Christ Esq | last post by:
Are there any scripts or tools out there that could look recursively through a group of C/C++ source files, and allow unreferenced function calls or values to be easily identified ? LXR is handy...
11
by: Michael B Allen | last post by:
Is there a standard method for supressing warnings regarding unused parameters? I have a function that might be called hundreds of thousands of times that looks like this: const void *...
12
by: Magix | last post by:
Hi, Everytime I received a fix-length of string, let say 15 (the unused portion will filled with Spaces before receive), I want to remove the Spaces from END until I encounter a non-space char....
13
by: rincewind | last post by:
I remember reading an article (was it Herb Sutter's?) that recommended avoiding using directives. While I quite understand this recommendation for headers, what's wrong in using directive in .cpp...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.