Telerik® JustCode™ by Progress

Telerik® JustCode™ can suggest you to convert the "var" keyword to the actual type and vice versa.

Note

Language Support

Supported: C#, VB.NET

Not supported: JavaScript, ASP.NET, XAML, HTML

The behavior can be controlled in JustCode Options - JustCode / Options / Code Analysis / Hints / C#.

When "Replace 'var' with explicit type declaration" option is checked in the options dialog, then Telerik® JustCode™ suggests you to replace all "var" type declarations with explicit type declarations.

  1. Position the caret over a "var" keyword.
  2. Press Alt+Enter. From the pop-up menu, select Use explicitly typed local variable declaration.

    Quick Hints var
  3. The result is:

    Quick Hints var result

When "Replace explicit type with 'var' keyword when possible" option is checked in the options dialog, then Telerik® JustCode™ suggests you to replace all explicit type declarations with "var" type declarations.

  1. Position the caret over a type keyword.
  2. Press Alt+Enter. From the pop-up menu, select Use 'var'.

    Quick Hints Explicit Type
  3. The result is:

    Quick Hints Explicit Type Result

When "Replace type instantiation with 'var' keyword" option is checked in the options dialog, then Telerik® JustCode™ suggests you to replace all explicit type instantiations with "var" type instantiations.

  1. Position the caret over a type keyword.
  2. Press Alt+Enter. From the pop-up menu, select Use 'var'.

    Quick Hints Explicit Type instant
  3. The result is:

    Quick Hints Explicit Type instant result

See Also