razor icon indicating copy to clipboard operation
razor copied to clipboard

Icons change for the @for intellisense and more

Open jessegood opened this issue 2 years ago • 7 comments

Describe the bug: Two issues:

  1. The icon changes when you type @fo for the @for and @foreach autocomplete from a T to a different icon. (See below)
  2. 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 oixNIECNXN

jessegood avatar Nov 29 '21 22:11 jessegood

@jessegood thanks for the report! This is indeed odd, I'll add it to our triage list 😆

NTaylorMullen avatar Nov 29 '21 22:11 NTaylorMullen

@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). image

Also, when you select the if snippet, the brackets are misaligned... (it does realign them after you hit enter though) image

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 avatar Nov 30 '21 20:11 jessegood

@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.

AslanAmca avatar Dec 01 '21 23:12 AslanAmca

@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?

NTaylorMullen avatar Dec 02 '21 22:12 NTaylorMullen

in non-snippet applicable scenarios

In that case, you need to explicitly specify SnippetsRule.NeverInclude when calling completion service to exclude them

genlu avatar Dec 02 '21 23:12 genlu

@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 avatar Dec 02 '21 23:12 dibarbet

@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?

NTaylorMullen avatar Dec 02 '21 23:12 NTaylorMullen