Archive

Posts Tagged ‘Language Elements’

Navigating in the CodeRush abstract source code tree

September 28th, 2012 Comments off

When CodeRush/DXCore has parsed the source code, an abstract source code tree is built. You can see the structure of the code tree using the Expression Lab diagnostic tool window. When you understand the source tree, you can use several small tools to quickly navigate inside children and siblings of the tree.

Here are available actions that allow you to quickly jump to different logical blocks inside the source tree. All actions move the editor caret to the desired tree node:

Action

Short description

Shortcut

NavPreviousSibling Move to previous sibling Ctrl + Up Arrow
NavNextSibling Move to next sibling Ctrl + Down Arrow
NavParent Move to parent Ctrl + Alt + Up Arrow
NavFirstChild Move to first child Ctrl + Alt + Down Arrow
NavLastChild Move to last child {Underfined}

Note that some of the shortcuts are disabled by default (e.g., NavPreviousSibling and NavNextSibling).

Having these tools in your arsenal may boost your navigation performance inside the code editor a lot. For instance, you can press Ctrl+Up and Ctrl+Down to jump between previous and next members of a class.

—–
Products: CodeRush Pro
Versions: 12.1 and up
VS IDEs: 2008 and up
Updated: Sep/28/2012
ID: C194

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…

How to enumerate solution and source code items using DXCore

April 6th, 2011 Comments off

One of the trivial tasks when developing a DXCore plug-in is the enumeration of the active solution items, such as projects, source files, then interfaces, classes, methods, properties, statements, etc. A similar task is to get an active element (in other words, the element where the editor caret is located) inside the active source file to start working with one.

All of the items of the solution are represented by the DXCore classes, located in the “DevExpress.DXCore.Parser” assembly inside the “DevExpress.CodeRush.StructuralParser” namespace. Consider, we have a standard Visual Studio solution, DXCore uses the following classes to represent its hierarchy:

Read more…

DXCore abstract source tree structure

January 12th, 2011 Comments off

DXCore supports lots of programming languages provided by the language services in Visual Studio. These services provide language-specific support (such as CSharp, Visual Basic, C++) for editing source code in the integrated development environment (IDE). DXCore includes appropriate source code parsers for these programming languages. When the source code is parsed, DXCore builds an abstract syntax tree (AST) that is a representation of the syntactic structure of the source code of a particular programming language. This abstract syntax tree is unified for all languages supported by IDETools. That’s why it is easy to develop a language-independent feature as a DXCore plug-in – in most cases your feature will be available in all corresponding languages automatically.

Read more…