Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1024901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:50:48+00:00 2026-05-16T11:50:48+00:00

There is an interesting coding standard in my shop that says that we don’t

  • 0

There is an interesting coding standard in my shop that says that we don’t shortcut type names with a using statement, they have to be fully qualified (so any time you reference a type, you use MyRootNamespace.ANamespace.MaybeAnotherNamespace.MyClassName, instead of just “MyClassName“).

Love it or hate it, that’s just how we roll, and I can’t do anything about that.

Of course, you are swimming upstream with Visual Studio, because all the editing tools that generate code for you (member completion, event completion, etc) use the short type names wherever possible.

What I would like to do is to build some sort of extension or macro for Visual Studio that will correct a partial declaration, and replace it with the fully-qualified typename.

I started out trying to build a macro that would run for the symbol that your cursor is on (though I’d like to be able to scan a whole file, or maybe just intercept the code as you type).

I found that I can get members of a class with FileCodeModel2.GetElementFromPoint(), but this method will only work on class members — it won’t pick up a variable declaration inside of a method, for example.

Is there some other way I can get at that stuff? I’m currently using Macros, but would the new VS Extension model be more appropriate? I’m using Visual Studio 2010 Ultimate edition, and I only need to target c# code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:50:49+00:00Added an answer on May 16, 2026 at 11:50 am

    The object model allows you to do many things that are available within the IDE. But as such a feature is not available in the IDE you are out of luck here, I’m afraid.

    The only thing you can do automatically with the using directives is sort them and remove the ones that are not used.

    Update

    As it seems it is somewhat possible to retrieve a fully qualified type name from a macro. However, it seems problematic with special cases such as generics.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is this interesting game, that has numbers in a grid, where each number
Is there a better way than using globals to get interesting values from a
There is a website called Gild.com that has different coding puzzles/challenges for users to
there's this interesting problem i can not solve myself. I will be very glad,
There was an interesting problem in C++, but it was more about architecture. There
I'm working with an off-the-shelf application at my company and there is an interesting
Some days ago I looked at boost sources and found interesting typedef . There
There seem to be very different opinions about using transactions for reading from a
Is there an exact equivalent to strncpy in the C++ Standard Library? I mean
Is there a programming language that is testable by design or at least exhibit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.