Home > Blockchain >  Stop VSCode triggering suggestion when pressing "enter" key
Stop VSCode triggering suggestion when pressing "enter" key

Time:12-04

I am editing JSX code in .js files, and since two days (i don't know why), each time I press ENTER key in VS Code to add a new empty line, then VS Code display this:

This is what VS code do

If I press ENTER again, then VS Code add "//#endregion" in my code.

But the point is, I don't want this, I just want to jump a line, I don't want VS Code to write this for me.

Do you know why VS Code has this behavior now, and how I can avoid VS Code doing this ?

PS: this is my Trigger Suggest config enter image description here

Thank you very much

CodePudding user response:

Go to File > Preferences > Keyboard Shortcuts

In the search bar select the Recording keys option and press Enter.

For all the results, right click and click on Remove Keybinding as shown below.

enter image description here

CodePudding user response:

As Rajesh and Malte said, go in Key Binding preferences (Preferences > Keyboard Shortcuts) and remove the key binding on "ENTER" key related to "suggestWidgetVisible" solved the problem.

But you actually have to restart VS Code to make this changes being took in account.

You can also go here if you want to keep suggestion but if you don't want them to apply on pressing "ENTER": enter image description here

Settings > Text editor > Suggestions > Accept suggestion on Enter > off

  • Related