Skip to content
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
Closed

Comments

@wouterroos
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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 Find In Solution Explorer throws error Find In Solution Explorer throws error if Track Active Item is enabled May 11, 2016
@wouterroos
Copy link
Author

wouterroos commented May 11, 2016

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

@codecadwallader
Copy link
Owner

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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
Projects
None yet
Development

No branches or pull requests

2 participants