Closed mitchcapper closed 1 year ago
Minor change create the custom profile (if enabled) at project startup and set it active any time something in SCA changes. This prevents it from automatically forcing itself as the debug profile the very first time you debug something.
I haven't had the time to look at the code yet but hopefully find some next weekend.
Sounds good, I can separate them out to different PRs then (will close this). I like the #2 UI improvements and the ability to import the existing profiles. I think allowing the users to import profiles after the initial launch would be nice (ie pull down updates and be able to import new cases). I think to handle existing project data one could have an option at import to: A) Only import CPS profiles that do not have existing folders in SCA or B) import all profiles, for overlapping SCA folder names any new arguments (not already in that folder) are added.
I do think the ability to disable the launch take over by SCA is still a useful one. In the past week I have had 19 solutions open (by a quick scan of VS history) SCA is a fantastic addon but (as with most addons) I want it to stay out of my way until I want to be using it. The new per solution first-run UI is nice, but once I enable it on a project I would need to manually seek out its config file and delete it just to disable it taking over. It also provides no option if I simply want to toggle back to the projects launch options rather than SCA. One can manually go to VS enable/disable extension but that really seems like overkill and effort. The other nice part about adding enable/disable to the options is you get the global/per project/solution customization other options get. That means I can globally have it enabled by default or off by default, and then for specific projects either disable it by default (or enable it). This I think is the gold standard of doing what the user wants.
All of this is a bit moot for CPS projects with the profile changes in this PR as most things are non destructive and SCA just becomes one of the options in the drop down, but still may be worth considering as it had minor user impact added as an option. If you like I can do a PR for the second one with some minor changes against branch for #121 .
Finally, I will cleanup the 3rd and polish the UI when resubmitting as it seems like it may be worthwhile.
- Sounds pretty awesome! I never noticed that a in memory profile is possible.
Yeah in memory was a great addition, I think I caught it on a VS blog awhile back and was happy I remembered it when I was thinking of the CPS changes. Sadly the VS team has somewhat stalled in putting out the lib updates with their cool new things (thus the nuget config here) but that may change soon: https://github.com/dotnet/project-system/issues/7010
So if there is desire for any of these features I can split the PR up into multiple, for now I just have the 3 features as separate commits.
The big addition is the CPS custom profile support. The current behavior is when changing anything in SCA it overrides the settings in the active profile. If you are working on a project with others this may not be desired. This adds (an off by default) option to use a separate profile just for us. This profile is only kept in memory, so wont change the launchSettings.json. If you have this enabled, it will only use SCA features when you have the custom SCA profile selected. This is except the first time after start where it will always select the SCA profile by default. This may want to be tweaked, IE adding our profile before they go to debug, automatically selecting our profile if they change something in SCA, etc. The nice part though is you can use other existing launch profiles and SCA side by side and SCA will not consistently destroy your active profile with it enabled.
Second decent feature is the Enable / disable extension checkbox. I know previously this was declined but I think it should be reconsidered. It sounds like just closing the window should disable it but I have found even closed when I start a project it would still override the existing profile. Even if it did work though I think users may not want to change their layout back and forth to control if its enabled. The checkbox as fast and quick to access.
Finally, the least polished, on the settings page I added the global settings. Right now the 3 state checkboxes are great, except you don't know what the global setting is currently. This adds it to the description line. if this is wanted can refine (maybe move up next to the checkbox or explain in more detail).