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.9k stars 358 forks source link

CodeMaid doesn't start automatically for CMake projects #996

Open Trider12 opened 1 year ago

Trider12 commented 1 year ago

Environment

Description

If you open a CMake project, the extension doesn't start working until you press Options or About. After that everything works fine.

image

I've always had this issue across multiple versions of both VS2019 and VS2022.

codecadwallader commented 1 year ago

Thanks for reporting the issue. All extensions (starting in VS2019) are now asynchronously loaded by the IDE in order to improve the startup experience. If you wait a few moments until the IDE fully loads (e.g. status bar quiets down about background loading), do you still see this behavior?

Trider12 commented 1 year ago

No, it cannot be fixed by waiting. Again, I've been having this issue for a very long time across multiple VS versions and different machines.

codecadwallader commented 1 year ago

Ok, I'm able to reproduce the issue. We explicitly auto load the extension once a solution is opened so that we have context about what kind of solution (e.g. C#, C++) is being utilized. It looks like CMake projects are a specific type of project that do not use the solution concept, which is why this automatic load doesn't happen. It may be possible to setup additional auto load conditions based on folder opens, but I'm not sure if that has any undesirable side effects.

https://github.com/codecadwallader/codemaid/blob/dev/CodeMaidShared/CodeMaidPackage.cs#L46