mfractor / mfractor-feedback

Found a bug or have a feature request for MFractor? Submit it here!
3 stars 0 forks source link

Go To Code Behind, Go To XAML View, Go To VM missing on MFractor windows #282

Open lachlanwgordon opened 3 years ago

lachlanwgordon commented 3 years ago

On VS Mac you can use Alt+Shift+1/2/3 to navigate between CodeBehind, XAML/Razor and ViewModel. You can also access these from right click menu.

I think when they used to be here they used a different hotkey to Mac, maybe Alt+1/2/3? My preference would be for the same hotkeys on both platforms, but VS Win and VS Mac have such different hotkeys that might to be reasonable.

I can't find these anywhere in VS Windows although I think I remember seeing this in an earlier build.

Using MFractor 4.2.11 and VS 16.6.4

ravero commented 3 years ago

Hi @lachlanwgordon, Unfortunately we couldn't keep the same keys because it was clashing to existing ones on VS for Windows. On the final release of MFractor we have mapped it to ALT+1/2/3. Take a look at this:

mvvm-navigation

lachlanwgordon commented 3 years ago

I thought that clash might be the case. When you say Final do you mean next version, or should I have this now?

Alt+1/2/3 aren't working for me and I can't see them in my right click menu either.

Screen Shot 2020-07-23 at 11 13 41 am
ravero commented 3 years ago

By final I mean the post-beta version of the Windows extension. It's implemented on the current stable release. This sample picture you've taken by right-clicking on what file? I'll need to investigate, sometimes the menu items doesn't appear if MFractor is still loading in background just after you load the project.

lachlanwgordon commented 3 years ago

Hmm, I've just opened a different solution and it works fine there, but doesn't work in the solution I'm working on. To be fair, it is a pretty chunky solution with 37 projects.

Whoops, not much context in that screen shot, here's on in a xaml and one in a xaml.cs.

Screen Shot 2020-07-23 at 11 24 37 am Screen Shot 2020-07-23 at 11 23 32 am
ravero commented 3 years ago

If you use the keyboard shortcuts directly, does it works? Maybe the size of the solution could be causing the issue. Visual Studio queries the extension every-time its about to show the right-click menu. It could be timing out our check because we need to resolve the related objects and maybe its getting too long on this big solution.

I'll investigate this.

lachlanwgordon commented 3 years ago

Nope, keyboard shortcuts do nothing.

I actually want to use this with .razor/.razor.cs, but tested with XAML too. Both are behaving the same.

Could you speed thing up by only querying within the active project rather than the whole solution?

Also feel free to put this aside for now if you've got more important things going on, I don't think this affects many users.

matthewrdev commented 3 years ago

@lachlanwgordon Yes, we can speed this up by only querying the current project. Cross-project resolution/solution scanning is a new addition (see https://github.com/mfractor/mfractor-feedback/issues/254) which came with a potential performance hit.

Maybe a solution for this is for a feature flag to disable solution scanning?

lachlanwgordon commented 3 years ago

Ah, and a new addition that came from me requesting it.

Yeah, if there was a per solution option to turn it on or off that would be cool, and would fix all the use cases I've seen so far.

Maybe it could be even more powerful to configure which assemblies should be scanned. E.g. When I'm working in a certain project MyApp.Forms i want to me able to also scan MyApp.Core but ignore all the others. This may be a lot of work, only to make a confusing feature that wouldn't be used much.

matthewrdev commented 3 years ago

@lachlanwgordon Given our discussions in Thursday's support call, and that this is surfacing in the mobile blazor bindings project, I think that the in-memory workspace/solution/project copy is not generated successfully.

Other customer issues (#291, #271 ) has the same symptoms as this: features dependant on projects/project files are not populating. All of these issues seem related and are explainable if the shadow-model generation fails.

matthewrdev commented 3 years ago

@lachlanwgordon I've located the cause of this issue, the workspace model is failing to get the GUID for the project when it opens, causing everything to unravel and for the workspace to not replicate correctly. Effectively, MFractor can't "see" the files as it hasn't created a shadow version of them.

Fixing this issue will resolve many other issues customers are reporting.

lachlanwgordon commented 3 years ago

Excellent, glad this led somewhere useful instead of just an edge case in my weird project.

matthewrdev commented 3 years ago

@lachlanwgordon Think I've nailed it.

This was a combination of several factors:

Looking like this is fixed. Will continue testing and confirm.

matthewrdev commented 3 years ago

@lachlanwgordon Can I get you to retest this on the latest Windows release? v4.2.12

lachlanwgordon commented 3 years ago

It still doesn't work in the Mobile Blazor Bindings Solution but does work in other apps.

matthewrdev commented 3 years ago

@lachlanwgordon Which files and projects does the MVVM navigation shortcuts not appear/work in? I'll dive in and investigate each one specifically.

lachlanwgordon commented 3 years ago

Take a look at this branch https://github.com/lachlanwgordon/MobileBlazorBindings/tree/mfractorCodeNavigationRepro

In the MobileBlazorBindingsHelloWorld project I've added a SampleXamlPage/SampleXamlPageViewModel and a SampleRazorPage/SampleRazorPageViewModel. Alt+1/2/3 and right click navigation doesn't work in any of these files.