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

Auto format is allways set 4 tab indentation #1236

Closed
ASnow opened this issue Apr 4, 2017 · 3 comments · Fixed by #1243
Closed

Auto format is allways set 4 tab indentation #1236

ASnow opened this issue Apr 4, 2017 · 3 comments · Fixed by #1243

Comments

@ASnow
Copy link

ASnow commented Apr 4, 2017

When I press Ctrl+Alt+L code I will get code with 4 space tabs.
I had editor config Tab Length: 2 space and tsconfig in subdirrectory:

  "formatCodeOptions": {
    "indentSize": 2,
    "tabSize": 2,
    "newLineCharacter": "\n",
    "convertTabsToSpaces": true,
    "insertSpaceAfterCommaDelimiter": true,
    "insertSpaceAfterSemicolonInForStatements": true,
    "insertSpaceBeforeAndAfterBinaryOperators": true,
    "insertSpaceAfterKeywordsInControlFlowStatements": true,
    "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
    "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
    "placeOpenBraceOnNewLineForFunctions": false,
    "placeOpenBraceOnNewLineForControlBlocks": false
  }
@ASnow
Copy link
Author

ASnow commented Apr 4, 2017

Also have a problem with correct indent size
2017-04-04 12 25 59

@william-gr
Copy link

+1, I have the same issue and its annoying because all my code has indent of 2 so it became unusable for now.

@guncha
Copy link
Contributor

guncha commented Apr 10, 2017

This shouldn't be too hard to add. The format command needs to run projectInfo on the file first to get the path to the tsconfig.json, read it, parse it to get the options and then pass those to the format command. I'll gladly accept PRs or eventually I'll get to it myself since I need it, but it might take some time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants