Remove unused references/nuget packages #36068
Labels
Area-IDE
Feature Request
Need Design Review
The end user experience design needs to be reviewed and approved.
Milestone
User Scenario
Users should be able to
Design
1. Provide a compiler level API to list used (or the opposite unused) references per compilation #37768 The compiler team will provide an API to list used references in the compilation (or the same: unused references in the compilation). These are individual assembly references.
2. https://github.com/dotnet/cli/issues/12168 The build team will generate a file with a map of assemblies, packages which can be checked for usage/non-usage. MS Build will generated the file. If other environments are used, they have to provide this file on their own.
3. Provide project-system API to remove unused references (assemblies, packages) project-system#5258 The project-system team will provide an API for fixing issues.
4. Implement an analyzer to remove unused references #37769 The IDE team will look for both the compiler API, the file generated and the project-system API, and provide an analyzer with a fixer that will report references which can be removed.
5. The project-system team will help with driving UI implementation. It can be grey out references with actions in the context menu or a special user control like one described below. This can be decided later based on restrictions found on previous steps.
UX Model
The functionality should be available in the Solution Explorer. In an ideal case, we should grey out unused references directly in the Solution Explorer and add an option in the context menu to remove them. If this is not available e.g. due to performance reasons, please see the UX model below.
Here is the UX model in case if we cannot arrange this directly in the Solution Explorer:
In the Solution Explorer right click on either a project, a solution or the References node of a project.
Have 2 of the following options:
A. Right-click the selection and choose an option to Remove Unused References in the context menu.
B. Or a keyboard shortcut to Remove Unused References.
When selecting Remove Unused References have a dialogue that displays all references that have no actual usages in source code in a tree view grouped by projects. By default, all references are selected for deletion. If necessary, deselect references that you want to keep.
The text was updated successfully, but these errors were encountered: