Skip to content

Visual Studio Extension to replace var with strong type. Based on .NET Compiler (Roslyn) refactoring, the extension provides the ability to replace var in code files with the strong types. The refactoring can be applied on selected instance, on a document, project or solution.

Notifications You must be signed in to change notification settings

Rishabh-V/varToType

Repository files navigation

Build status

var To Type

Visual Studio 2015 Extension to replace var with strong type.

Getting started

To try the varToType Extension:

  1. Download the VSIX from here
  2. Install VSIX.
  3. Open a new instance of Visual Studio 2015 (tested only in VS 2015 as of now).
  4. Open a C# project, which has code files using var.
  5. On every usage of var, a light bulb style refactoring should be available.
  6. Click on light bulb or Ctrl+ . and it would show the preview of the fix.
  7. Choose to fix that instance, all instances in document, project or solution.
  8. On accepting, the fix is applied.var should be replaced with Fully qualified name as discovered.
Screenshot

Replace var with Type Preview changes

About

Visual Studio Extension to replace var with strong type. Based on .NET Compiler (Roslyn) refactoring, the extension provides the ability to replace var in code files with the strong types. The refactoring can be applied on selected instance, on a document, project or solution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages