dotnet / dotnet/vscode-csharp

Remove unused usings on format

Open
#5,261 15 comments 22 reactions 0 assignees View on GitHub
OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

## Is your feature request related to a problem? Please describe.

tl;dr: OmniSharp should allow configuring the formatter (omnisharp.json) to remove unused imports.

#1245 shows that it is possible to "remove unused usings" in a document using Omnisharp. However, this feature cannot be used during a "Format" operation (as per comment https://github.com/OmniSharp/omnisharp-vscode/issues/1245#issuecomment-763723115). Only "organizing" imports is possible via the omnisharp.json configuration (#1686).

## Describe the solution you would like

OmniSharp should allow configuring the formatter (omnisharp.json) to remove unused imports.

## Applicable Scenarios

* Ctrl+P >Format Document
* Format on Save

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.