Archive

Archive for the ‘Plug-in Development’ Category

How to set the default encoding for all files saved in Visual Studio

July 31st, 2012 2 comments

In Visual Studio, you can use the File -> Advanced Save Options menu item to save the file in the chosen encoding:

Visual Studio Advanced Save Options menu item

Read more…

How to add assembly and project references to a specific project using DXCore

April 19th, 2012 Comments off

To add an assembly reference, you first require a reference to the target project. To get one, you can use the Source Model DXCore service, for example:

ProjectElement projectElement = CodeRush.Source.ActiveProject;

Read more…

How to add new projects to a solution programmatically using DXCore

April 19th, 2012 Comments off

You can add new projects from the Visual Studio built-in project templates to the current solution using the DXCore Solution service:

CodeRush.Solution.AddProject("ProjectTemplateName", "UniqueProjectName");

Read more…

How to create shortcuts for refactorings that require a sub-menu choice

March 20th, 2012 Comments off

There is a built-in capability in CodeRush/DXCore to create shortcuts for any type of content providers, such as refactoring and code providers. Just choose the Refactor command and type in a provider’s name as a parameter. However, this approach does not work for refactorings that require a sub-menu choice; for example:

Read more…

Creating a new code issue and its fix for Java Script

March 6th, 2012 Comments off

The process of adding a new CodeRush code issue and a code fix provider for the code issue in the Java Script language is the same as for any other supported language. As an example, we are going to add a code issue that will highlight the “for..in” loop with the following structure:

Read more…

Creating a custom CodeRush Intellassist extension

October 18th, 2011 Comments off

In this topic we are going to extend the CodeRush Intellassist feature using the DXCore IntellassistExtension component. A sample extension will suggest all possible variable names of a local declaration based on its entered type in C# language.

Read more…

How to manage the refactoring provider appearance and sub menus in the Popup menu

September 30th, 2011 Comments off

The Refactor!/CodeRush Popup menu shows available refactoring and code operations in the current context. When you develop a DXCore plug-in with a refactoring provider component, you might need to tweak its appearance in the popup menu. We will see how to change the caption of a refactoring menu item and the text of the hint describing a refactoring operation. Also, we will learn how to add and manage sub menu items for the popup menu.

Read more…

Creating a simplest refactoring using the RefactoringProvider control

September 30th, 2011 Comments off

In this article we will create the simplest refactoring which will remove the active comment. Sometimes, there are comments left that are not utilized any longer, such as implemented TO-DO comments, UNDONE comment that is now complete, etc. We will use the RefactoringProvider control shipped in DevExpress Refactor! Pro for this purpose.

Read more…