Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort Usings #788

Closed
jchannon opened this issue Sep 27, 2016 · 8 comments
Closed

Sort Usings #788

jchannon opened this issue Sep 27, 2016 · 8 comments

Comments

@jchannon
Copy link
Contributor

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003121)

Product Information:
 Version:            1.0.0-preview2-003121
 Commit SHA-1 hash:  1e9d529bc5

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

VS Code version:1.5.3
C# Extension version:1.4.1

Steps to reproduce

Create a file with lots of usings statement

Expected behavior

Intellisense to offer "Sort Usings"

Actual behavior

Nothing

@Leopotam
Copy link
Contributor

For temporaty workaround you can use Uncrustify plugin with proper config option for using sorting.

@Leopotam
Copy link
Contributor

Extension for fix usings order

@rchande
Copy link

rchande commented Jan 12, 2018

@akshita31 Can figure out if sorting usings is a public API of Roslyn? If it is, we could go ahead and add a command to do this. (I bet we could also add a command that removes the unused ones)

@DustinCampbell
Copy link
Member

@rchande : I don't believe we've exposed these as public APIs yet.

@cuibty
Copy link

cuibty commented May 2, 2019

+1

1 similar comment
@Siccity
Copy link

Siccity commented Feb 19, 2020

+1

@filipw
Copy link
Contributor

filipw commented Feb 19, 2020

This is already implemented as part of formatting, see release notes here https://github.com/OmniSharp/omnisharp-roslyn/blob/master/CHANGELOG.md#13410---2020-01-27

it's not enabled by default so needs to be enabled with omnisharp.json file (global or local https://github.com/OmniSharp/omnisharp-roslyn/wiki/Configuration-Options#global-omnisharpjson)

see also the blog post for more info https://www.strathweb.com/2020/02/hidden-features-of-omnisharp-and-c-extension-for-vs-code/#toc_4

@filipw
Copy link
Contributor

filipw commented Apr 15, 2020

I will close this based on the above comment ^

@filipw filipw closed this as completed Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants