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 357 forks source link

VS 2017 - Codemaid thinks files opened from "lightweight" projects are external #389

Open michaelaird opened 7 years ago

michaelaird commented 7 years ago

Environment

Description

When the solution is opened in "lightweight mode" not all the projects are loaded. If you navigate into a file in a project that is not fully loaded (ie. go to definition), when you tell CodeMaid to clean it, CodeMaid thinks the file is external.

Steps to recreate

  1. Open a solution in "lightweight mode"
  2. Navigate into a file in a project that is not fully loaded (use go to definition, etc)
  3. Clean the file

Current behavior

CodeMaid shows the dialog that the file is external and some cleanup actions may not be available.

Expected behavior

Ideally, it would prompt to load the project or do so silently in the background before cleaning.

codecadwallader commented 7 years ago

Thanks for the suggestion. Have you seen any code samples for how to detect that state and/or request a project load?

willl commented 7 years ago

@codecadwallader Perhaps some of this documentation on Lightweight solution loading from the VS2017 SDK would help https://docs.microsoft.com/en-us/visualstudio/extensibility/lightweight-solution-load-extension-impact

codecadwallader commented 7 years ago

Thanks for the documentation. I did discuss LSL mode with someone from Microsoft a couple months back as they were starting to push it harder. One of the main sticking points is that LSL mode is really only compatible with the newer Roslyn APIs, not the EnvDTE APIs that CodeMaid has been based on since VS2005 days. We know that a Roslyn rewrite (see #251) is inevitable for long term support of CodeMaid going forwards, but its a very large undertaking.

michaelaird commented 7 years ago

Is there any possibility of an interim solution ? Ie. check VSHPROPID9.VSHPROPID_IsDeferred for the project codemaid thinks is external and prompt to load it?

On Wed, May 31, 2017 at 7:13 AM Steve Cadwallader notifications@github.com wrote:

Thanks for the documentation. I did discuss LSL mode with someone from Microsoft a couple months back as they were starting to push it harder. One of the main sticking points is that LSL mode is really only compatible with the newer Roslyn APIs, not the EnvDTE APIs that CodeMaid has been based on since VS2005 days. We know that a Roslyn rewrite (see #251 https://github.com/codecadwallader/codemaid/issues/251) is inevitable for long term support of CodeMaid going forwards, but its a very large undertaking.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/codecadwallader/codemaid/issues/389#issuecomment-305159949, or mute the thread https://github.com/notifications/unsubscribe-auth/AANX6alPRcxD6YLfwbGNsZSgzhi-Gv1zks5r_UtmgaJpZM4Losjg .

codecadwallader commented 7 years ago

We are absolutely open source and would gladly welcome any contributions if you have time to experiment with it. http://www.codemaid.net/contribute/ has some helpful getting started information.