dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
501 stars 191 forks source link

Go-to-definition in C# files on Razor generated code does not bring me to .razor file #7317

Open vsfeedback opened 2 years ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


In blazor I have this line private MyComp comp1; the caret is on MyComp (after y); I hit F12 to go to type (MyComp.razor), but nothing happens (MyComp is in another project in the same solution)


Original Comments

Feedback Bot on 1/23/2022, 06:54 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 1/24/2022, 11:26 AM:

Thank you for reporting this issue to us. We have changed the title to better describe the problem so others can find and engage with it.

Feedback Bot on 2/2/2022, 00:07 PM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

Wenwen Fan [MSFT] on 2/7/2022, 01:04 AM:

Thank you for taking the time to log this issue!
I can’t repro it with following steps:

  1. Create two BlazorApp projects(BlazorApp1 and BlazorApp2) in same solution.
  2. In BlazorApp1, add BlazorApp2 as project reference .
  3. Add new class(Class1.cs) in BlazorApp1, add new class(Class2.cs) in BlazorApp2.
  4. In Class1.cs write this code: private Class2 comp;
  5. Place the mouse over Class2(after a), then hit F12.
    I can go to the definition. Did I miss any steps? If so, can you provide the repro steps or a sample project?
    We look forward to hearing from you!

Valentin Plamadeala on 2/7/2022, 03:55 AM:

they have to be in a razor file like this:

@code {
    private Counter counter1;
    private Component1 component1;
}

this way F12 won’t do anything;
if you put it in a .razor.cs partial class like this:

namespace BlazorApp7.Pages
{
    public partial class Index2
    {
        private Counter counter1;
        private Component1 component1;
    }
}

F12 will give you a message box:
“Cannot navigate to symbol under the caret”

seems it doesn’t even need to be in a different project

Feedback Bot on 2/7/2022, 11:45 AM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.

Wenwen Fan [MSFT] on 2/8/2022, 05:11 PM:

(private comment, text removed)

Feedback Bot on 2/8/2022, 05:16 PM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

(no solutions)

ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.