dotnet / dotnet/roslyn

Razor editor doesn't recommend base.BuildRenderTree(__builder) via intellisense

Open
#85,612 5 comments 0 reactions 0 assignees View on GitHub
Area-Razor enhancement
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

Consider you have two components which you want to inherit from each other like this.

`Component1.razor`:
```razor


This component is defined in the RazorClassLibrary1 library.

```

`Component2.razor`:
```razor
@inherits Component1
```

Now I want to render the same UI from `Component1.razor` in `Component2.razor`. This can be achieved by adding this code to `Componen2.razor`:
```razor
@{
base.BuildRenderTree(__builder);
}
```

However when you type `base.` the method `BuildRenderTree` won't get suggested by intellisense. When you type it manually, the razor editor finds the methods and displays it correctly.

![Image](https://github.com/user-attachments/assets/a1110b02-0eee-4e21-95b0-ade394c92a84)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with Component1.razor and Component2.razor, then trace the Razor editor's completion behavior after typing `base.`. Done means IntelliSense recommends BuildRenderTree(__builder), while the manually entered call continues to resolve and display correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.