Skip to content

floatas/auto-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto Import

Visual Studio Marketplace

Overview

Auto Import is a Visual Studio extension that automates the process of importing classes and interfaces into your C# codebase. This can help streamline your development process by eliminating the need for manual importing of types, saving you time and reducing the chance of errors.

Features

  • Auto-detects the classes/interfaces used in your code and adds appropriate using statements.
  • Refactors and renames identifiers, improving code readability and organization.
  • Provides support for generic types.
  • Allows integration into the constructor of a class.

Introduce service

Introduce Interface

Introduce Generic

Installation

This extension can be installed through the Visual Studio Marketplace. Click here to download and install.

Usage

Once the extension is installed, it will automatically run in the background. It analyzes your code as you type, detecting classes, interfaces, and binary expressions that require imports. If any are found, the extension will automatically generate the appropriate using statements at the top of your code file.

Code Overview

The main functionality of the extension is defined in AutoImportCodeRefactoringProvider. This class inherits from the CodeRefactoringProvider class in the Microsoft.CodeAnalysis namespace. The primary method, ComputeRefactoringsAsync, performs the analysis and refactoring.

Additionally, the helper methods Refactor, CreateDataModel, and RenameGeneric assist in handling specific aspects of the code refactoring process.

Contributing

Contributions are always welcome. If you have any ideas for improvement, please feel free to fork the repository and create a pull request.

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.

License

This project is licensed under the MIT License.


Your feedback is important to make the project better. Feel free to contribute and help the developer community.