codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

`Collapse solutions when they are opened` doesn't consider solution-specific value

Open fabianoriccardi opened this issue 4 years ago • 2 comments

Environment

  • Visual Studio version: 2019
  • CodeMaid version: 11.2
  • Code language: XAML

Description

The option Collapse solutions when they are opened in solution-specific context seems not considered, and codemaid considers only the value in user-specific context. I had tried with other settings, and they are applied as expected (i.e. solution-specific has higher-priority over user-specific options).

Current vs Expected behavior

  1. Try to check Collapse solutions when they are opened in user settings, and uncheck in solution settings.
  2. Clone and open the same project.
  3. The projects will collapse

fabianoriccardi avatar May 21 '21 20:05 fabianoriccardi

Thanks for reporting the issue, I am able to reproduce it. I suspect we are both loading the solution-specific settings and collapsing the solution explorer in response to the same OnSolutionOpened event. If these are running in parallel and are not chained together then it would make sense that the solution-specific settings may not have had a chance to load before the collapse logic is applied.

Relevant code: https://github.com/codecadwallader/codemaid/blob/dev/CodeMaid/CodeMaidPackage.cs#L320-L333

codecadwallader avatar May 26 '21 12:05 codecadwallader

I have tried to read your code.. Are you loading Solution-specific setting when OnSolutionOpened is triggered, right? Maybe 2 events (OnSolutionOpened and OnSolutionSettingsLoaded) may help to fix?

fabianoriccardi avatar May 26 '21 19:05 fabianoriccardi