1

Let's assume I have a JavaScript file with the following content and the cursor placed at the pipe symbol (|):

class ItemCtrl { getPropertiesByItemId(id) { return this.fetchItem(id) .then(item => { return this.getPropertiesOfItem(item); }); }| } 

If I now hit enter, the code changes in the following way:

class ItemCtrl { getPropertiesByItemId(id) { return this.fetchItem(id) .then(item => { return this.getPropertiesOfItem(item); }); } | } 

It wrongly aligns the closing curly brace with the return statement, when it should be aligned with the method definition. I know that the formatting inside the function is not the best but I still would rather disable that feature to prevent weird things like that from happening.

I already set editor.autoIndent to false but it still keeps happening. Is there any other way, how I can turn this feature off entirely? (or make it work in a smarter way)

2
  • Do you have eslint extension by any chance? Or another that is doing it? Commented Oct 11, 2017 at 16:07
  • I disabled all Extensions. But I actually realised that autoIndent seems to be disabled if I set editor.autoIndent to true. Seems like a bug to me or my installation is messed up. Commented Oct 11, 2017 at 18:38

1 Answer 1

5

In VS Code 1.17, this bug caused "editor.autoIndent": false to not work

This should be fixed in VS Code 1.18

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.