Editor Bug: Auto-indent does not work correctly in TypeScript files
- VSCode Version: 0.10.11
- OS Version: Windows 7 / 64-bit
Steps to Reproduce:
- Click Enter at the end of a nested line (e.g., after if / for statement).
- A new line is created, but the cursor is placed at the beginning of the line instead of the expected indented position.
After the new line is completed, the indentation is fixed. But i would expect the indentation to be correct already when the line is just created.
@gilboa23 I assume you have format on type. Could you provide a screen cast showing the problem (animated gif) or better the project with steps how to reproduce this. I am asking since I can't reproduce this:

See screencast below (vscode 1.0.0, editor.formatOnType==true).
As can be seen, when creating a new line, the cursor is initially placed at column 0 instead of the column that corresponds to the current nesting level. The indentation is fixed only when the line is completed (by entering the semi-colon).

@gilboa23 I still can't reproduce. Could you share your workspace. May be it is another settings that needs to be different. What kind of line ending do you use? Did you tweak the typescript formatter options?
Or do you have any additional plugins installed?
I have the same problem with JavaScript files. Using v1.0.1-insider on Mac OSX. My plugins installed are eslint, tslint and editorconfig.
@jrieken I am out on vacation for two weeks. Can you please follow up.
@gilboa23 @4kochi could you start vscode from a command prompt with --disable-extensions and lets us know if you still experience the problems.
I think i found the cause for the issue in my project. The "typescript.tsdk" parameter in the settings file was set to an older version of typescript lib (v1.8.0). I cleared the flag and this seems to have solved the issue.
I'm closing this issue. Thank you for your assistance.
I still have the problem, also with disabled extensions. But as I said if have .js file instead of .ts files. I also tried a never typescript version with the setting:
"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib"
The typescript version is Version 1.9.0-dev.20160423

@4kochi What you are seeing is #3797
Ok, thanks for clarification.
pls see https://github.com/Microsoft/vscode/issues/3797#issuecomment-214650742 for how to use Code with a new version of TypeScript.