This project is read-only.

Go to Definition for Views and Links

Jun 20, 2012 at 8:58 AM

I'm looking for a good way to navigate to resources (Views and Links) referenced in T4MVC, via a "Go to Definition"-like functionality.

I hacked together a macro to replace VS F12 keybind. If there's a better solution, please let me know. Otherwise, for whatever use you find it:

Jun 20, 2012 at 6:52 PM

That's pretty cool! Though I did find one bug: it only works if you select something in the right project in the solution explorer. e.g. try selecting the Solution at the root of the tree and run the macro.

Here is a possible fix that seems to work:

        Dim proj As Object = DTE.Solution.FindProjectItem(DTE.ActiveDocument.FullName).ContainingProject
        navpath = Path.GetDirectoryName(proj.Fullname()) + navpath.TrimStart("~")

Once you get it well working, we should think about including it in the T4MVC repo so we can evolve it properly.

Jun 21, 2012 at 4:47 AM

Awesome, thanks for the fix. Surely it needs more. I added this, and won't be offended if anyone with SO edit rights drops changes in directly either.

Oct 23, 2012 at 9:17 PM

Hi David/T4MVC,

Have this feature been included in T4MVC? Thanks.

Oct 23, 2012 at 11:20 PM

I think this is something that can only exist outside of itself, so it couldn't be included in the NuGet package. I'd be happy to add the Macro to the source repo so it's not too far from the rest.

Oct 26, 2012 at 7:53 AM

Thanks again David. I haven't found any further changes necessary yet.