New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find In Solution Explorer throws error if Track Active Item is enabled #290

Closed
wouterroos opened this Issue May 10, 2016 · 9 comments

Comments

Projects
None yet
2 participants
@wouterroos

wouterroos commented May 10, 2016

Environment

  • Visual Studio version: 2015 Enterprise Update 2
  • CodeMaid version: 10.1.93
  • Code language: C#

Description

When selecting the Find In Solution Explorer command in the right-click menu of a Code Editor window, the following error is thrown:

image

Steps to recreate

  1. Install Update 2
  2. Open Code Editor window
  3. Right-click the window tab
  4. Click on Find In Solution Explorer

Current behavior

Above error message is shown.

Expected behavior

File is found in Solution Explorer.

@codecadwallader codecadwallader added the bug label May 10, 2016

@codecadwallader

This comment has been minimized.

Owner

codecadwallader commented May 10, 2016

Thanks for reporting the issue. This command used to be a custom implementation, but became a pass-through invocation to a now native capability of VS. We do have a little remaining logic that makes the command more robust than native. Can you please try the following?

  1. Launch the Command Window (Ctrl+Alt+A)
  2. Type SolutionExplorer.SyncWithActiveDocument

alternatively you can click the "Sync with Active Document" button in the solution explorer toolbar (two arrows pointing in opposite directions).

@wouterroos

This comment has been minimized.

wouterroos commented May 11, 2016

Thanks for the feedback. After doing some testing, it seems the issue only occurs when Tools > Options > Projects and Solutions > General > Track Active items in Solution Explorer is enabled. Maybe you could consider hiding the Find In Solution Explorer menu item when this option is enabled to prevent the error?

@codecadwallader

This comment has been minimized.

Owner

codecadwallader commented May 11, 2016

Aha, thanks for the clarification. I have reproduced the issue as well now when that setting is enabled and that makes sense.

In this scenario, perhaps if the command is invoked we could just activate the solution explorer window? The net behavior then would be the same between both modes, the solution explorer has focus and the current document is highlighted. Thoughts?

@codecadwallader codecadwallader changed the title from Find In Solution Explorer throws error to Find In Solution Explorer throws error if Track Active Item is enabled May 11, 2016

@wouterroos

This comment has been minimized.

wouterroos commented May 11, 2016

Good suggestion! I think that would produce the desired behaviour.

@codecadwallader

This comment has been minimized.

Owner

codecadwallader commented May 11, 2016

Cool, we'll plan on that. Thanks!

@codecadwallader codecadwallader added this to the v10.2 milestone May 11, 2016

codecadwallader added a commit that referenced this issue May 14, 2016

@codecadwallader

This comment has been minimized.

Owner

codecadwallader commented May 14, 2016

I've made a change that I believe will handle this scenario. If you would like to test it out a build will be available in our CI channel shortly (v10.1.99 or higher).

@wouterroos

This comment has been minimized.

wouterroos commented May 17, 2016

I just tested the v10.199 build and I don't get the error any more when I click Find in Solution Explorer. The only issue remaining is that, when the solution explorer gains focussed, it does not highligth the correct file (in my current solution it switches to a folder called Solution Items).

@codecadwallader

This comment has been minimized.

Owner

codecadwallader commented May 17, 2016

Thanks for confirming the error is no longer seen.

Since you're using the native document tracking, that replaces the logic that would normally highlight the correct file. We are now only invoking the solution explorer when tracking is enabled because the command that finds the correct item cannot be used while tracking is active. FWIW I have noticed that behavior if you have a document open that is not a part of the solution.

@codecadwallader codecadwallader self-assigned this May 22, 2016

@codecadwallader

This comment has been minimized.

Owner

codecadwallader commented Dec 11, 2016

Marking this as closed as we prepare for a next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment