Coding Helpers – Smart Parentheses and Smart Brackets

April 18th, 2011 Comments off

Let’s talk about two similar features – the Smart Parentheses (also known as Smart Parens) and Smart Brackets. These two features allow you to easily type parens and brackets without having to close them with the corresponding closing paren or bracket, because they will be inserted automatically.

In this article the ‘paren’ means the opening or closing parenthesis ‘(‘ or ‘)’, and the bracket means the ‘[‘ (opening) and ‘]’ (closing) characters.

Read more…

Refactorings – Introduce Alias

April 18th, 2011 Comments off

The Introduce Alias refactoring creates an identifier that serves as an alias for a namespace or type within the active source file. The alias directive can provide much neater and organized code. When several namespaces contain a matching class name, alias can also help to avoid a name conflict (ambiguous reference) without using the fully qualified type names, which improves overall code readability.

Read more…

Refactorings – Sort Namespace References

April 18th, 2011 Comments off

The Sort Namespace References refactoring is a stand-alone part of the Optimize Namespace References refactoring. In contrast to that refactoring, the Sort Namespace References refactoring doesn’t remove any references, and as the name says, it just sorts the ‘using’s (C#) or ‘Imports’ (VB) statements in the active source file.

The following sorting methods are available:

  • Alphabetically
  • By Length

Read more…

Refactorings – Optimize Namespace References

April 15th, 2011 Comments off

The Optimize Namespace References refactoring removes namespace references (usings (in C#) or Imports (in VB)) that are not needed in the active source file, either because they were added automatically and not used, or because the code that did require them has been removed or relocated. Also, it can automatically sort used references after refactoring is performed: alphabetically, by length or not sort. An additional sorting option is to move all System references at the top of the list (file). The refactoring improves code readability.

Read more…

Organizing source code and sorting class members using CodeRush

April 14th, 2011 2 comments

Reorganization of the code is a great practice to improve code readability. If you prefer to sort your type members like this:

class {
private fields
constructors
public properties
public methods
private methods
}

or any other order, you can use the Member Organizer CodeRush plug-in for this purpose.

Read more…

DXCore Services – Language

April 11th, 2011 Comments off

The Language DXCore service is one of the most important services that provides access to the programming language fundamentals, including access to language extensions. Language extensions are DXcore plug-in extensions, which implement specific programming language support for Visual Studio, including parsers and code generators.

Read more…

How to parse source code using the DXCore integrated code parsers

April 11th, 2011 3 comments

There are times when you need to parse specific source files or blocks of code. Obviously, the DXCore Framework has many built-in parsers for various programming languages. They can be used inside the Visual Studio environment, or outside an IDE in any other application type, such as a Console App, for example. Later, this kind of app (a Console App) can be used in the project building process for code validation, code clean-up, automatic refactoring and any other task.

Read more…

DXCore Services – Source (SourceModel)

April 7th, 2011 Comments off

Provides access to the source model services. This DXCore service contains lots of useful APIs for working with the source code of the entire solution hierarchy.

Read more…