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

HOW TO TURN OFF SPACE AUTO COMPLETE!!??? #3647

Open
pedwards95 opened this issue Mar 10, 2020 · 27 comments
Open

HOW TO TURN OFF SPACE AUTO COMPLETE!!??? #3647

pedwards95 opened this issue Mar 10, 2020 · 27 comments

Comments

@pedwards95
Copy link

The space auto complete in this extention is horrid. It doesn't consider what you typed past the first couple of letters. EVEN IF YOU WAIT TO PRESS SPACEBAR.
AND WHY IS THE AUTO COMPLETE BUTTON SPACEBAR???????
We use spacebar all the freaking time when coding. Why is such an important button the AUTOCOMPLETE.

After searching Google, this is a problem that has been around for at least 2 years. The only solution is to turn off autocomplete all together. Why can't I rebind it?

Bad design. Bad planning. Useless feature in current implementation.

ps. Its broken in insider too.
pss. It happens with ONLY your extension installed, and stops when disabling setting in the extension. The problem is 100% this and only this.

Steps to reproduce

  1. Make sure Omnisharp is working on your active file. If your open directory is too large, Omnisharp does nothing. (another failure of this extension)
  2. Type anything that is not a command, that you intend to use as a variable. Some examples are i, and input. (I use these all the time, and they are corrected every time, hence my frustration)
  3. Press space (as a normal person would do when they have finished writing a word. What kind of monster doesn't put a space between their variable names and the =)

Expected behavior

Normal typing behavior as defined by every computer, phone, tablet, ect.

Actual behavior

Your typed word or letter changes into a long variable name that doesn't even work in the context of the code.

@cartermp
Copy link

Thanks for the report. Do you have a code sample or screenshot showing this behavior? Thanks!

@jmarolf
Copy link

jmarolf commented Mar 10, 2020

Space should not be considered a commit character unless you have used the arrow keys to select something. Please let me know is this is not what you are seeing. A screen-shot or precise repo would help a lot :)

@cartermp
Copy link

Possible duplicate of #1936

@rhys-vdw
Copy link

rhys-vdw commented Mar 11, 2020

Could this be related? I get this madness when typing . in a comment, then space will autocomplete it.

image
image

Sorry couldn't work out how to attach video.

@pedwards95
Copy link
Author

pedwards95 commented Mar 11, 2020

Its going to be a duplicate of many reports because its a problem that has existed for 2 years. @cartermp

I don't feel like taking a video of typing 'input' and pressing space. @jmarolf @cartermp

I did not and have never used the arrow keys. @jmarolf

Yes. @rhys-vdw

@JoeRobich
Copy link
Member

JoeRobich commented Mar 11, 2020

OmniSharp is returning completion items while in doc comments and the completion items are not being returned as suggestions. Possible fix would be to first check if service.ShouldTriggerCompletion() returns true prior to generating a completion list here - https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/IntellisenseService.cs#L42. Also, not sure if the method of determining suggestion mode will always be accurate here - https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/IntellisenseService.cs#L56

@2jacobtan
Copy link

2jacobtan commented May 13, 2020

Workaround using Code Snippets:

image
image
image

At least now I can type var/*space*/ in peace, without it turning into EnvironmentVariableTarget.

P.S. @rhys-vdw I have faced the same problem T_T

P.P.S. Also works: disable "Accept Suggestion On Commit Character":
image
(I prefer to keep this setting enabled, because it's helpful usually.)

@Radeonmann
Copy link

Radeonmann commented Jan 18, 2021

I'm also giving +1

This is a big issue when e.g. adding an event handler with lambdas.
What i want to write:
image

I start to write:
image

I press comma:
image

@2jacobtan Thanks for the hint with "Accept Suggestion On Commit Character", it just saved my live, as I usually not use this functionality.

@mogocat
Copy link

mogocat commented Jun 5, 2021

This is really terrible! I even cannot type a 'var' with space! When could this be fixed?
Thanks @2jacobtan for saving my life.

@HymanZHAN
Copy link

HymanZHAN commented Jun 6, 2021

Thank you so much @2jacobtan for the tip! A true life saver!
It's super annoying and frustrating, especially when you compared that to the implementation of TS intellisense, which does not register so many characters like =, , <SPACE>, etc. as commit characters. The range of commit characters is simply way too wide.

@7Hazard
Copy link

7Hazard commented Jun 15, 2021

This is really annoying. Normally only tabbing should commit autocompletion. Thats how the autocompletion works on all other languages.

@simonhunt
Copy link

This setting fixed it for me:

image

@Drupalique
Copy link

Ohhhhhh, thank you! Typing "i" had become a nightmare! This is a feature?

@SpechtMagnus
Copy link

When will this finally be fixed? I'm thinking about disabling this extension altogether as "await" has become the bane of my existence!

@pucsdian
Copy link

image
turning this off Thanks it worked for me !!!!!!!

@Orkimedes
Copy link

So weird to read about turning off space autocompletion. I have an opposite problem - how to turn it on in VS code - it uses TAB which is extremely uncomfortable.

@Orkimedes
Copy link

So weird to read about turning off space autocompletion. I have an opposite problem - how to turn it on in VS code - it uses TAB which is extremely uncomfortable.

I have the same problem, couldn't find a trigger to use space to accept the suggestion.

I found a way to add space(or any other button in the same way). You have to go to the keybindings.json and add there the following:
{
"key": "space",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
}

@mgoerlich90
Copy link

image turning this off Thanks it worked for me !!!!!!!

To anyone being used to autocomplete on Tab and/or Enter and only these: This is the solution you're looking for.
Disable that and your autocomplete should be back to, as you're used to it.

https://code.visualstudio.com/docs/editor/intellisense#_settings

And @pedwards95 isn't quite right.
It's not a direct issue/feature of OmniSharp that he's confused with, but rather a IntelliSense Feature.
It works the same way in Visual Studio, so it shouldn't be that confusing when one already has some experience with C#.

The maintainers might consider pinning an issue explaining that this is not a bug and point the users to the docs, to prevent further "false-positives"
And MS could document that Feature of IntelliSense a tid bit better, maybe a list of the commit charachters would be cool.
But all of that is still not a reason for @pedwards95 to scream at people and act like a donkey, just because he's swamped.

@igblip
Copy link

igblip commented Nov 19, 2022

A space should never be used as a completion character. This setting should be turned off by default.

@distinctdan
Copy link

What is this garbage?!! Who thought it was a good idea to make space accept the autocomplete? Utterly ridiculous that this hasn't been fixed by now, the authors of this extension obviously don't actually use it.

@pepelax
Copy link

pepelax commented Jun 16, 2023

It would be great if this "Editor: Accept Suggestion On Commit Character" would be disabled by default
It was terrible when the extension overwrite my code if I want to add something at row beginning and I couldn't understand, why it's doing this strange thing
and it was complicated to find the reason
This option is real pain

@mecha-moonboy
Copy link

It would be great if this "Editor: Accept Suggestion On Commit Character" would be disabled by default It was terrible when the extension overwrite my code if I want to add something at row beginning and I couldn't understand, why it's doing this strange thing and it was complicated to find the reason This option is real pain

Agreed. This problem brought me here. This discussion should have been ended and fixed at least 2 years ago. I couldn't even add the 'public' keyword before an existing field without it autocompleting and doubling the time and typing required.

@pepelax
Copy link

pepelax commented Jun 25, 2023

It seems that after last update overwriting was fixed, if I write simething at row beginning and then press Enterk key, written text isn't errased and I can proceed normally without rewriting
And even if I activate "Editor: Accept Suggestion On Commit Character" option, it works normally as expected
Thank you so much!

@calebmeyer
Copy link

If you want to keep the behavior of acceptSuggestionOnCommitCharacter for other languages (just not csharp), you can use a language specific setting in your settings.json:
image

"[csharp]": {
  "editor.acceptSuggestionOnCommitCharacter": false
},

@conor-mccullough
Copy link

conor-mccullough commented Jul 25, 2023

Ran into this with C#. Workaround as suggested here was to disable "Accept Suggestion On Commit Character".

How is this still an issue 3 years later? I understand that the workaround is fairly easy to implement, but this isn't exactly desired out-of-the-box behaviour.

@cxlblm
Copy link

cxlblm commented Mar 24, 2024

This is a behavior that feels very uncomfortable to engage in, and there's no way to modify it.

@JustinGrote
Copy link

Ran into this with C#. Workaround as suggested here was to disable "Accept Suggestion On Commit Character".

How is this still an issue 3 years later? I understand that the workaround is fairly easy to implement, but this isn't exactly desired out-of-the-box behaviour.

Ran into this too, why in C# is space a commit character?

Here's how to do a C# specific disablement of that setting:

  "[csharp]": {
    "editor.acceptSuggestionOnCommitCharacter": false,
  }

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