CodeRush Ultimate 19.2

Adds new code analysis diagnostics.
October 25, 2019 - 12:04
New Version

Features

RushNav for VS Code

  • This release introduces the RushNav extension for VS Code. RushNav is a powerful new free navigation tool helping you jump to TypeScript type declarations and references with ease. RushNav also allows you to mark required parts of your code with markers and bookmarks to return to these locations at any time.

New Code Analysis Diagnostics - This release extends the set of code analysis rules. CodeRush Server can now detect:

  • Local unused variables that can be safely deleted.
  • Unused or assigned–only variables which can be replaced with a discard.
  • Redundant field initialization values which can be safely removed.
  • Type names that differ from the file name. These types can be moved to a new file (with the same name as the type) to improve code readability and discoverability.
  • Type names that do not match the name of the files containing them.
  • "\r\n" string values, which can be converted to Environment.NewLine calls.
  • String comparison expressions which can be replaced with a String.Compare call
  • Expressions that test a string for null (or "Nothing" in Visual Basic) or an empty value, which can be replaced with a String.IsNullOrEmpty call.
  • Composed string expressions which can be converted to interpolated strings.

New Refactorings

  • Inline Lambda - This refactoring сreates a lambda expression and inlines the referenced delegate.
  • Declare Partial Class Part - The "Declare Partial Class Part" refactoring creates a class part in a new file (for the active class), declaring both classes as partial.
  • Import Missing Namespaces - "Import Missing Namespaces" adds using directives for each type with a missing namespace reference in the file. This refactoring is only available in Visual Studio 2019. "Import Missing Namespaces" works inside a selected code block or for an active code element (based on caret position).
  • Remove Unused Variables - To help you remove unused variables from your code:
    • Remove Variable
    • Remove Variable with its Initializer
    • Remove Discard Variable
    • Also added the Discard Variable refactoring that replaces unused or assigned-only variables with a discard.
  • Remove Unused Type and Parameters - You can now use the Remove Unused Type and Remove Unused Parameter refactorings to quickly remove the corresponding unused types or parameters.

Code Cleanup

  • Remove Unused Variables, Types and Parameters - If you want to remove unused variables, types, and parameters across multiple files at once, you can use the Code Cleanup feature with the following rules enabled:
    • Remove unused variables
    • Replace unused variables with discard
    • Remove unused types
    • Remove unused private types
    • Remove unused parameters
  • Improved Code Cleanup Options Page - The release completely redesigns the Code Cleanup options page. Providers now are grouped by categories. You can quickly find a required code provider specifying its name in the search field. Added the following options for each code action:
    • Apply in Action - allows you to select which code cleanup actions will be executed when you explicitly call code cleanup.
    • Apply on Save - allows you to select which code cleanup actions will be applied before files are saved.

Code Analysis - This release gets the following new code analysis diagnostics:

  • Unused local variable - identifies local variables which are never used in your code and can be safely deleted.
  • Local variable can be replaced with discard - identifies unused or assigned-only variables which can be replaced with a discard.
  • Redundant field initialization - identifies redundant field initialization values which can be safely removed.
  • The type can be moved to a separate file - identifies types whose name differ from the file name. These types can be moved to a new file (with the same name as the type) to improve code readability and discoverability.
  • The type name does not correspond to the file name - this issue appears in the Code Issues window if a type name does not match the name of the file that contains it.
  • Environment.NewLine can be used - identifies "\r\n" string values, which can be replaced with Environment.NewLine calls.
  • String.Compare can be used - identifies string comparison expressions which can be replaced with a String.Compare call.
  • String.IsNullOrEmpty can be used - identifies expressions that test a string for null (or “Nothing” in Visual Basic) or an empty value, which can be replaced with a String.IsNullOrEmpty call.
  • String interpolation can be used - identifies composed string expressions which can be converted to interpolated strings.

Organize Members

  • Added the "Explicit interface implementations" rule to the Default rule set.
  • Static constructors and explicitly-implemented interface members are now sorted correctly in the StyleCop scheme.
  • Member rules are now applied based on the "Rule priority" option value, followed by rule order.
  • Ability to wrap sorted groups in dynamic regions with built-in variables using the "Wrap distinct groups in regions" option.

Code Formatting

  • This release introduces new options for Other options pages.
  • Indent Options - The following options allow you to align comments and directives with their surrounded/following content:
    • Indent comments started at the first column
    • Indent region directives started at the first column
    • Indent conditional compilation directives started at the first column
    • Indent other directives started at the first column
  • XML Documentation Comments Options
    • Wrap comments at column - This option wraps comment long lines exceeding the specified column width.
    • Content Indent - You can specify the indentation of content within XML tags.
  • You can now easily add or remove a single space in documentation lines and within tags with the following:
    • Documentation lines should begin with a single space
    • Add a space before self-closing tag
    • Add a space after opening tag and before closing tag
  • Also added options to place tags on separate lines:
    • Place summary tags on separate lines
    • Place all tags on separate lines

Code Places

  • TypeScript / JavaScript Support - Code Places now works in JavaScript and TypeScript code:
  • Favorite Code Places - You can favorite code places and access them instantly in the Favorites tab. Favorite places are saved across sessions.
  • To favorite a code place, right-click a desired member in the File Places tab, and select Add to Favorites. In the context menu, select "Add to new group" and enter a group name in the New Favorites Group dialog and press Enter.
  • You can also add code places to existing favorite groups. Right-click a code place in the File Places tab, and select the desired group in the Add to Favorites sub menu.
  • Sort Code Places
  • Starting with this release, CodeRush allows you to sort code places with the following criteria:
    • As Is (sorts members by the order in which they appear in the file)
    • By Name (sorts members alphabetically)
    • By Kind, then Name (sorts members by kind and then alphabetically)
    • By Accessibility, by Kind, then Name (sorts members by accessibility, kind, and then alphabetically)
    • By Kind, by Accessibility, then Name (sorts members by kind, accessibility, and then alphabetically).
  • You can configure code places sorting using the "Sort Code Places" option on the "Navigation | Code Places" options page.
  • Navigate to Member Body
  • Jump to member bodies by holding down the Alt key while clicking entries in the code places list.
  • Improved Performance for Large Files
  • Significantly improved Code Places performance for large files (files with more than 3000 lines of code) in the following scenarios:
    • Opening/closing documents
    • Moving the caret through documents
    • Switching between documents

Miscellaneous

  • Selection Expand/Reduce Enhancement - When using the Selection Expand/Reduce feature you can see a code preview in the code editor if a portion of the selected code falls outside the boundaries of the code editor.
  • To enable this new code preview, go to the Editor | All Languages | Selection options page and enable the "Show code preview hints when selection changes" option.
Local unused variables that can be safely deleted

CodeRush Ultimate

Create better code, more quickly.

Got a Question?

Live Chat with our DevExpress licensing specialists now.