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
502 stars 195 forks source link

The Intellisense does not suggest all available tag helpers and attributes #6768

Closed vsfeedback closed 2 years ago

vsfeedback commented 2 years ago

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


Bug report: When typing " "kendo-button" and "kendo-buttongroup" are not displayed in the suggestion list;

Expected behavior: The Intellisense should recognize all available Telerik UI for ASP.NET Core TagHelpers, their attributes, and nested tags.

Actual behavior: The Intellisense does not recognize all available Telerik UI for ASP.NET Core TagHelpers, their attributes, and nested tags.


Original Comments

Feedback Bot on 20/05/2022, 00:50 PM:

(private comment, text removed)

Feedback Bot on 20/05/2022, 06:35 PM:

(private comment, text removed)


Original Solutions

(no solutions)

davidwengier commented 2 years ago

Issue is best illustrated in this screenshot:

image

Some important things to note:

The missing tag helpers are being filtered out here: https://github.com/dotnet/razor-tooling/blob/main/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/LanguageServerTagHelperCompletionService.cs#L213

In this case kendo-button has a TagOutputHint of button but that doesn't exist in elementCompletions so we filter it out. This also repros if I turn off single-server completion, so not sure when this regressed, but as is the code doesn't really make sense to me. elementCompletions is empty when we enter the method, so the only thing in it is tags we've added to the completion list, and we only add tags that don't have an output hint.

My reverse-engineered guess is that this used to work by seeding the collection with completion from the Html language server, and we're essentially saying "if Html said that button was valid here, then we'll allow kendo-button to be valid here".

davidwengier commented 2 years ago

My guess was wrong, this was regressed by this commit: https://github.com/dotnet/razor-tooling/commit/d273c6cd4cad4d51306abd8d44bb9575d063d69d