razor
razor copied to clipboard
Icons change for the @for intellisense and more
Describe the bug: Two issues:
- The icon changes when you type
@fo
for the@for
and@foreach
autocomplete from aT
to a different icon. (See below) - As far as I can see, there shouldn't be 4 options? Other than the 2 snippet options, I don't even know what the other icons mean.
Version used: VS2022 Version 17.0.1
To reproduce:
See below
@jessegood thanks for the report! This is indeed odd, I'll add it to our triage list 😆
@NTaylorMullen
Thanks. Just a follow-up, but it seems all the keywords have the same behavior.
In the below example, it says "Note: Tab twice to insert the if snippet" and when you do that, it inserts nothing...
The if snippet happens to be the one below that, and when you select that the note doesn't appear (although the snippet actually works).
Also, when you select the if snippet, the brackets are misaligned... (it does realign them after you hit enter though)
Hopefully the above reports will be useful, but I'm starting to think the intellisense in razor files was never actually looked at before shipping... I mean just type an @
and displays a million things which you would never use...
@jessegood
I'm starting to think that the intellisense in the razor files was never reviewed before shipping...
Yes mate, that's exactly what I was thinking.
@dibarbet @genlu it looks like the C# language server is returning snippets in non-snippet applicable scenarios (we don't support these yet). Do you know why this could be happening?
in non-snippet applicable scenarios
In that case, you need to explicitly specify SnippetsRule.NeverInclude
when calling completion service to exclude them
@genlu we already specify that, so something else must be going wrong - https://sourceroslyn.io/#Microsoft.CodeAnalysis.EditorFeatures/Implementation/LanguageServer/Handlers/Completion/CompletionHandler.cs,558
@dibarbet / @genlu hmmm, we technically "fake" if/for/foreach etc. items when you type @
, is it possible completion resolve is filling in the snippet info / icons?