DEV Community

VScode completes things I don't want it to complete.

Anton on November 06, 2018

This upon hitting the enter key > turns into this > It should actually start a new line with indentation instead. When I hit ente...
Collapse
 
foresthoffman profile image
Forest Hoffman • Edited

That is an interesting problem. Because of the general scope of the problem, I don't know how helpful it would be, but with snippets, you can control where the cursor lands.

code.visualstudio.com/docs/editor/...

EDIT: I use snippets to avoid VSCode's auto-completion suggestions when writing Jest tests in TypeScript.

Collapse
 
antonrich profile image
Anton

I looked into snippets they explain how to work with prefixes at the end they have something about keybinding. But I need somehow to explain vscode that when I hit enter key inside curly braces open them in a certain way. It's a hard.

As I understand putting the cursor in a certain place is an easy part.

Collapse
 
mattnmoore profile image
Matt Moore

I've been having this issue too and haven't gotten around to solving it so I'll be following this thread closely. For now I just use shift+enter instead which is honestly pretty annoying.

Collapse
 
antonrich profile image
Anton

I have made an update, because I found the solution. I have a question though: When I made an update did you receive a notification?

Collapse
 
mattnmoore profile image
Matt Moore

Nope! I only got notified from this reply.

Collapse
 
antonrich profile image
Anton

I do the same thing with shift+enter.