Sort usings by ascending when optimize imports
Answered
Hello,
When using the optimize imports (ctrl + alt + o), this calls the Optimize 'using' directives. As stated on https://www.jetbrains.com/help/rider/Code_Cleanup__Index.html
Optimize 'using' directives
Removes unused namespace import directives and sorts the namespace import directives: allSystem.
namespaces go first, sorted alphabetically by the second word after the dot;
*
all other namespaces go next, in alphabetical order
How do I change the settings so all System namespaces do NOT go first, but instead are sorted alphabetically??
Please sign in to leave a comment.
Hello,
Unfortunately, sorting all using directives alphabetically (including System) is not supported at the moment. Please vote for the corresponding feature request in Rider issue tracker: https://youtrack.jetbrains.com/issue/RIDER-19024
`Optimize imports` doesn't do anything in my C++ files in Rider. Is that supposed to work?
Sascha You can invoke the Remove unused #include directives code inspection in Context Actions menu.
Or run the inspection in Code | Analyze Code | Run inspection by Name and apply the changes.