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…
Once you have a reference to an element and would like to get its declaration, simply call the GetDeclaration() method of a reference of the Expression type (all references have the Expression base type).
Read more…
According to the Embarcadero’s docwiki:
“Sync Edit mode in Delphi allows you to change all occurrences of an identifier when you change one instance of that identifier. When you enter Sync Edit mode, you can tab to each highlighted identifier in your current Code Editor window.”
The difference of the Sync Edit feature in Delphi from the usual Rename refactoring from Refactor! (for example) is that a declaration of an identifier may not exist. In this case the Rename is simple not available.
Read more…
Here’s what the standard Refactor!/Code! and “Jump to” Popup menu looks like:

Read more…
Note, this article has been moved to the official DevExpress Support Center site. Please refer to the moved article as it might have further updates or additional comments. Thank you.
Here is a sample code illustrating how to detect if the DXCore is installed and loaded from another add-in (without static dependencies on the DXCore assemblies) using reflection. This could be helpful if your add-in functionality somehow intersects with the DXCore’s.
From inside a usual DXCore plug-in, you can detect if the DXCore is loaded by calling the “CodeRush.IsLoaded” property. In case you are not going to reference the DXCore assemblies inside your add-in, this sample might help.
Read more…
Refactor! Pro has numerous refactorings which perform a single task. What if we could run several refactorings at once?
For example, there is a support for optimizing namespace references added to the Move Type to File refactoring: after the new file is created, the Optimize Namespace References refactoring does its job. Here are other examples of refactoring (code provider) combinations, which can be performed:
- Introduce Local and Promote to Parameter will create a new refactoring, called something like “Introduce Parameter”.
- Declare Class (Struct) and Declare Method (Property) will create a new multi-declare code provider, which will declare everything at once.
- Introduce Parameter Object and Move Type to File will add a new option for the first refactoring to create a new file.
- And so much more…
Read more…
If you’d like to show your tool window from a DXCore-based ToolWindow plug-in, you have to create another standard plug-in that will do this. You can add an additional DXCore standard plug-in project item into your solution, where the tool window is located. In the new plug-in, you need to handle the DXCoreLoaded event and manually add a code that opens and shows a tool window.
Read more…