razor icon indicating copy to clipboard operation
razor copied to clipboard

Some tag helper are not in the completion list when available

Open DoctorKrolic opened this issue 3 years ago • 1 comments

Version used: VS 2022 v17.3 Preview 2

To reproduce:

  1. Create "ASP.NET Core Web App"
  2. Go to Index.cshtml page
  3. Start typing <fo

Expected behavior: There is a form tag helper completion in the list, because as soon as you write it, it becoms colorized as a tag helper: devenv_hoxeoVh1eU

Actual behavior: There is only html tag completion

Demo: devenv_HqStkaGrCT

Additional context: Compare to the same case for script tag for clarity: jZFwqQvFDW

I would like from to work the same (kind of, see https://github.com/dotnet/razor-tooling/issues/6584). Also form is no the only one with this problem. For instance, here is link in _Layout.cshtml: devenv_whwbtNqBng As you clearly see, it can be a tag helper in this context

DoctorKrolic avatar Jul 12 '22 16:07 DoctorKrolic

This is going to require some discussions on our end about expected behaviors and how to achieve that.

ryanbrandenburg avatar Jul 14 '22 21:07 ryanbrandenburg

This is interesting, and looking at the code as written, the expectation here would be the script doesn't show up in completion. It's showing up because we happen to see the UrlResolutionTagHelper before we see the ScriptTagHelper. Current completion implementation doesn't show tag helpers in completion if they don't have a capital letter.

It feels to me like that behaviour is correct, and the bug is that UrlResolutionTagHelper shouldn't be impacting completion at all, but there could be a custom element scenario that would break if we did that.

Thinking about this and https://github.com/dotnet/razor-tooling/issues/6768 it seems like there are some issues around completion that need to be re-designed, around ordering, and dealing with tag helpers that have rules about other tag names.

davidwengier avatar Sep 09 '22 06:09 davidwengier

So in a way this will be fixed by https://github.com/dotnet/razor-tooling/pull/6823 in that the form tag helper will be shown in completion.

In an entirely other way though, thats a bug.

davidwengier avatar Sep 13 '22 06:09 davidwengier