codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.89k stars 356 forks source link

Third party command not being invoked on Ctr-M-Space shortcut #931

Open patso23 opened 2 years ago

patso23 commented 2 years ago

Environment

Description

Third party command not being invoked on Ctr-M-Space shortcut, but is being invoked when right clicking project and selecting Cleanup Selected Code. (Specifically CM+ in this instance)

Steps to recreate

  1. Install CodeMaid 12.0
  2. Install CM+ extension v1.1.5
  3. In Extensions -> CodeMaid -> Options -> Third Party, add "Tools.CM+Format" to other cleaning command textbox
  4. Open c# file with using statements and clean using Ctr-M-Space. System using statements are moved down alphabetically instead of to the top, as expected with CM+

Current behavior

CM+ third party command is not invoked, System using statements are moved down in the list alphabetically

Expected behavior

CM+ third party command would be invoked, moving System using statements to the top. (This expected behavior is observed when right clicking on a project and selecting Cleanup Selected Code, just not with Ctr-M-Space)

codecadwallader commented 2 years ago

Thanks for reporting the issue. Can you confirm if you have changed the Visual Studio settings to place system directives first? This is off by default, but can be enabled at Tools->Options->Text Editor->C#->Advanced->Using Directives->Place 'System' directives first when sorting usings

With that setting enabled you should find that directly invoking Format Document or using CodeMaid (which invokes Format Document) both move System using statements to the top.

image

patso23 commented 2 years ago

Doh, yes you're correct. I didn't have this checked. Apologies, so many settings sometimes it's hard to figure where everything is.

Thank you for the response.