Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta: Over-eager autocompletion in anonymous functions #5732

Closed
StringEpsilon opened this issue Jun 8, 2023 · 1 comment · Fixed by dotnet/roslyn#69327
Closed

Beta: Over-eager autocompletion in anonymous functions #5732

StringEpsilon opened this issue Jun 8, 2023 · 1 comment · Fixed by dotnet/roslyn#69327
Assignees
Milestone

Comments

@StringEpsilon
Copy link

Environment data

dotnet --info output:

.NET SDK:
 Version:   7.0.100
 Commit:    e12b7af219

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.100\

VS Code version: 1.78.2
C# Extension version: v2.0.206

Note: I have disabled the extension "IntelliCode for C# Dev Kit".

OmniSharp log

Not applicable.

Steps to reproduce

  1. Open any C# file.
  2. Write an anonymous function

Expected behavior

The C# extension will not autocomplete with random, irrelevant suggestions.

Actual behavior

I'll use "|" to mark my cursor position.

var foo = myList.Where(|)
-> type "y"
var foo myList.Where(y|)
-> type " " (space)
var foo myList.Where(YDecoder |)

Alternative example:

Func<int, int> square = |
-> type "x"
Func<int, int> square = x|
-> type " "
Func<int, int> square = X25519 |

This happens with a lot of one-letter variable names. It can also happen with proper names, although at least so far I have not encountered that all to often. Seems to depend on how close the name matches whatever types are available.

@dibarbet dibarbet added this to the GA milestone Jun 8, 2023
@arunchndr arunchndr modified the milestones: GA, Preview 2 Jun 28, 2023
@arunchndr arunchndr modified the milestones: Preview 2, GA Jul 25, 2023
@genlu
Copy link
Member

genlu commented Aug 1, 2023

This is quite annoying indeed. It's caused by not handling the case equivalent to what we call SuggestionMode in VS. Working on a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants