roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

IntelliSense not suggesting correct variable

Open mikadumont opened this issue 3 years ago • 3 comments

Direct customer quote copying here:

I’m trying to write a simple If statement, and I’m trying to use a local variable called howMany. No matter how much I type, intellisense will not suggest the variable howMany. I press [Cntrl] + [spacebar] for suggestions and you can see it says there are no suggestions. Once I finish typing out the entire variable name VS is happy, and the red squiggly goes way, indicating it knows the variable is good.

image

Here is the repo with the sample code - https://dev.azure.com/ChalkLogic/_git/VisualStudio-Intellisense-Woe

mikadumont avatar Jun 15 '21 16:06 mikadumont

I can reproduce this. The weird thing is that it doesn't reproduce with == or >. Only reproducible with <.

howMany

Youssef1313 avatar Jun 15 '21 16:06 Youssef1313

My guess is that it relates to our code to detect and handle generic expressions as they're being typed.

CyrusNajmabadi avatar Jun 15 '21 17:06 CyrusNajmabadi

I found that after removing using System.Linq; the variable shows. I guess the Count<T> extension method caused intellisense to only show suggestions for T.

pawchen avatar Jul 12 '21 16:07 pawchen

Fixed by #70122 Please confirm @CyrusNajmabadi

Rekkonnect avatar Oct 01 '23 16:10 Rekkonnect

Sounds good

CyrusNajmabadi avatar Oct 01 '23 16:10 CyrusNajmabadi