Is it not working only for me or for everyone? It's not working everytime I write 'foreach' block inside lambda (dot after Enumerable
):
Action t = ()=>
{
foreach (var item in Enumerable.)
{
}
};
Any idea why it's not working in such cases?
I have VS 2010 SP1
update: It's not about Enumerable
, it's about any object. I can try to write new object().
and have the same problem.
If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.
Please try: Go to Visual Studio Installer, click Modify , uncheck IntelliCode in Individual components, then click Modify button to save the change, wait for the installation to complete, and then reinstall IntelliCode . In Visual Studio, go to Tools->Options->IntelliCode to check if the setting is Default.
To access this options page, choose Tools > Options, and then choose Text Editor > C# > IntelliSense.
I can reproduce the bug with VS2010 SP1 and a brand new project:
class Program
{
static void Main(string[] args)
{
Action t = () =>
{
foreach (var item in Enumerable.Range(1, 10))
{
}
};
}
}
Delete ".Range(1, 10)" and type "." and you should see Intellisense choices but there are none. But if you assign the expression to a temporary variable it works as expected. Follow Hans advice and file a bug report.
Even if you type the open and close parantheses for foreach
, you can get intellisense. For intellisense to work, you need to be typing in front of a white space.
For example:
foreach
then ()
and then go back into ()
and start typing var x in
... no intellisense!
But, foreach
then ( )
with a space and then go back into ( )
and start typing right after the (
... now you get intellisense.
This is the behavior with C# settings. Not sure about settings for other languages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With