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.88k stars 352 forks source link

`Find in Solution Explorer` command Collapses Solution Explorer instead #1007

Open astrohart opened 1 year ago

astrohart commented 1 year ago

Environment

Description

When I click the Extensions menu in Visual Studio, point to Code Maid, and then click Find in Solution Explorer with a .cs file open, Solution Explorer collapses all its expanded TreeView nodes -- it's as if I actually chose the Collapse All Recursively command instead.

It's as if, inside CodeMaid's source code itself, the Find in Solution Explorer command is "wired up" to the incorrect "command handler."

Steps to recreate

  1. Open a C# project in Visual Studio.
  2. Open Solution Explorer.
  3. Click the Tools menu, and then click Options.
  4. Under Projects and Solutions, click General.
  5. Place a checkmark in the Track Active Item in Solution Explorer check box.
  6. Click OK.
  7. Find and double-click on a .cs file in your project to open it in the Editor.
  8. Navigate somewhere else in your source code.
  9. Click the Extensions menu, point to CodeMaid, and then click Find in Solution Explorer.

Current behavior

When the above steps are followed, Solution Explorer's tree view collapses all, recursively.

Expected behavior

The desired outcome of the steps above is for the tree view in Solution Explorer to jump to the file that is currently open.

codecadwallader commented 11 months ago

Thanks for reporting the issue. I have been unable to reproduce the issue as you have described.

I'm curious, if tracking the active item is active isn't the solution explorer already jumping to the file that is currently open?

astrohart commented 11 months ago

@codecadwallader Yes, tracking the active item is open, but, for some reason, it did not function, thus the need for me to activate the Find in Solution Explorer command. Make sure tracking the active item is activated when you try to reproduce, if you have not already.