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

FullyQualifyNamespace light bulb behaves broken in methods within @code blocks #19449

Closed
NTaylorMullen opened this issue Feb 28, 2020 · 4 comments · Fixed by dotnet/razor#1751
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed

Comments

@NTaylorMullen
Copy link
Contributor

  1. dotnet new blazorserver
  2. Open Counter.razor
  3. In the IncrementCount() method add the following above the currentCount++; line: RenderTree.
  4. Invoke the FullyQualifyNamespace light bulb

Expected:

    private void IncrementCount()
    {
        Microsoft.AspNetCore.Components.RenderTree
        currentCount++;
    }

Actual:

    private void IncrementCount()
    {
            Microsoft.AspNetCore.Components.RenderTree
            currentCount++;
    }

Note the extra indent.

@NTaylorMullen NTaylorMullen added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates cost: S bug This issue describes a behavior which is not expected - a bug. labels Feb 28, 2020
@NTaylorMullen NTaylorMullen added this to the Razor LSP Preview 3 milestone Feb 28, 2020
@ajaybhargavb
Copy link
Contributor

Also, in some cases the lightbulb doesn't even show up.

    private void IncrementCount()
    {
        RenderTree // 1
        currentCount++;
        RenderTree // 2
    }

In the above case, Ctrl+. on 1 shows the FQN code action but Ctrl+. on 2 shows nothing,

@NTaylorMullen
Copy link
Contributor Author

Ctrl+. on 2 shows nothing,

If you complete the statement under // 1 does it? I ask because it might be C# failing to understand the rest of the document since it's malformed

@ajaybhargavb
Copy link
Contributor

ajaybhargavb commented Feb 28, 2020

If you complete the statement under // 1 does it? I ask because it might be C# failing to understand the rest of the document since it's malformed

Yes. But it has the same indentation issue as you described above.

    private void IncrementCount()
    {
        currentCount++;
        RenderTree // 2
    }

Also, Ctrl+. on 2 doesn't work even in this case.

@TanayParikh
Copy link
Contributor

TanayParikh commented Apr 1, 2020

@ajaybhargavb your example has been handled separately in #20397 as it has a unique root cause.

@NTaylorMullen NTaylorMullen added the Done This issue has been fixed label Apr 7, 2020
@ghost ghost locked as resolved and limited conversation to collaborators May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates bug This issue describes a behavior which is not expected - a bug. Done This issue has been fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@ajaybhargavb @NTaylorMullen @TanayParikh @ryanbrandenburg and others