Bug 11811 - Goto declaration doesn't work unless assembly browser tab is already open
Summary: Goto declaration doesn't work unless assembly browser tab is already open
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Assembly browser ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
: 10485 ()
Depends on:
Blocks:
 
Reported: 2013-04-16 15:12 UTC by Chris Hamons
Modified: 2013-05-10 16:53 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Chris Hamons 2013-04-16 15:12:15 UTC
If you goto definition without the assembly browser tab open, it will open but not goto your type. If you switch back and goto definition again it will work the 2nd time.
Comment 1 Chris Hamons 2013-04-16 15:13:36 UTC
This will also happen if you click a link inside assembly browser that refers to another assembly that isn't in the tree. Hitting back once the assembly is in the tree will work.
Comment 2 Mikayla Hutchinson [MSFT] 2013-04-22 18:11:52 UTC
*** Bug 10485 has been marked as a duplicate of this bug. ***
Comment 3 Mike Krüger 2013-05-03 04:33:37 UTC
Should've been fixed.
Comment 4 Mikayla Hutchinson [MSFT] 2013-05-03 19:27:43 UTC
I still have this problem with master.
Comment 5 Mike Krüger 2013-05-10 06:07:54 UTC
Can't repro it with master
Comment 6 Mikayla Hutchinson [MSFT] 2013-05-10 13:27:16 UTC
I can.

Probably your machine has different perf characteristics, e.g. SSD.
Comment 7 Mikayla Hutchinson [MSFT] 2013-05-10 13:47:34 UTC
When it fails, I do get an error, e.g.

ERROR [2013-05-10 13:46:32Z]: Can't open: M:System.Threading.ThreadPool.QueueUserWorkItem(System.Threading.WaitCallback) (not found).

But it works if the assembly browser already has the assembly loaded.

And some things won't navigate at all e.g.
ERROR [2013-05-10 13:46:18Z]: Can't open: M:System.Threading.Tasks.TaskCompletionSource`1.#ctor (not found).
Comment 8 Mikayla Hutchinson [MSFT] 2013-05-10 14:08:16 UTC
I took a look at the code and the problem is exactly what I suggested i previous bugs: https://bugzilla.xamarin.com/show_bug.cgi?id=10485#c12

AssemblyBrowserWidget.Open calls AddReferenceByFileName, which loads assemblies into the tree asynchronously. It then tries to navigate to the member without waiting for the loading to complete.
Comment 9 Mikayla Hutchinson [MSFT] 2013-05-10 16:53:24 UTC
Fixed by moving the URL lookup into a continuation.

Thought IMO the entire assembly/tree loading mechanism needs reworking, it looks very race prone and does too much on the UI thread.

Filed bug 12199 for the error looking up generic types.