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

Autocompletion replaces the current word after hitting space or other characters #1936

Closed
math2001 opened this issue Dec 22, 2017 · 5 comments

Comments

@math2001
Copy link

Environment data

$ dotnet --info
.NET Command Line Tools (2.1.2)

Product Information:
 Version:            2.1.2
 Commit SHA-1 hash:  5695315371

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

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.3
  Build    : a9190d4a75f4a982ae4b4fa8d1a24526566c69df

VS Code version: 1.19.1

C# Extension version: Unity 2017.2's version

Steps to reproduce

using System;

class App {
    
    void Main() {
        Console.WriteLine("Hello world!");
        // start writing cons and hit space
    }

}

Expected behavior

Do not auto complete unless I hit tab

Actual behavior

It actually auto completes when I hit space or dot.

This is really annoying, especially because sometimes it cannot be right when writing code "upside down" (some guy made a post about it and called it wishful coding).

Sometimes, when I type a word quickly and press dot, it actually replaces the current word with the previous top completion, not the one corresponding to all the letters I typed.

So, I just would like to know if there is a way to disable this behavior.

Thanks anyway for this extension, it makes learning a new language so much easier! 👍

@DustinCampbell
Copy link
Member

Thanks for the feedback. This design is very intentional as the completion list is intended to be a typing enhancement. In fact, we find that many users really appreciate it because they can type in all lowercase characters and the completion list will "case correct" the identifiers as the user types. This is precisely the same behavior that we have in C# in Visual Studio as well.

One completion list feature that Visual Studio has but C# for VS Code does not have is "suggestion mode". This is a mode where that can be activated to cause the completion list to ONLY complete on TAB, and no other characters. I think we'd be willing to add that feature to C# for VS Code, but the default behavior would still be what you described, as that's how it's designed. Does that make sense?

@DustinCampbell
Copy link
Member

cc @rchande

@yifanwww
Copy link

Seems that the suggestion mode is still not added?

To get the temporary suggestion mode, every time this extension updated I needed to change the completion list in the extension.js.

@cartermp
Copy link

Since this is by design I'll close it out. We'll want to match the VS experience (which happens today) as best we can for now, especially as we work to centralize components in the VS Online service that can have multiple different clients.

@lilith
Copy link

lilith commented Jun 21, 2023

It would be phenomenal if it didn't replace "var" with "VariantType" on spacebar.

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

No branches or pull requests

5 participants