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

javacript code formatting not working after typescript v2.x update #12705

Closed
mlakmal opened this issue Sep 27, 2016 · 6 comments
Closed

javacript code formatting not working after typescript v2.x update #12705

mlakmal opened this issue Sep 27, 2016 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded

Comments

@mlakmal
Copy link

mlakmal commented Sep 27, 2016

  • VSCode Version: 1.6.0 insider
  • OS Version: Windows 7 64

Steps to Reproduce:

  1. update to latest VS Code insider v1.6.0 and update typescript to v2.0.x
  2. format the javascript code with below workspace settings.
    "editor.tabSize": 2,
    "javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": true,
    "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
    "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
    "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
  3. above formatting settings are not adhered after typescript v2.0x update

tabsize is 4 and not using above override and spaces are not getting added after function keyword and parenthesis/brackets.

@dbaeumer dbaeumer added this to the September 2016 milestone Sep 28, 2016
@dbaeumer dbaeumer added typescript Typescript support issues bug Issue identified by VS Code Team member as probable bug labels Sep 28, 2016
@dbaeumer
Copy link
Member

@mlakmal there is a real issue here that the formatter also told otherwise replaces tabs with spaces.

Regarding the tabSize: the file is always formatted using the tab size detected by the editor and shown in the status line. So if the status line says Tab Size: 4 in the lower right corner then we use tabSize: 4 during formatting even with the setting "editor.tabSize": 2.

I will follow up in the TS bug microsoft/TypeScript#11199 since the fix for this has to come from the TS team.

Keeping the issue open to make sure we have a fix for this for September.

@dbaeumer
Copy link
Member

Got fixed for the next update:

cast

@mlakmal
Copy link
Author

mlakmal commented Sep 28, 2016

Thanks @dbaeumer.

@dbaeumer
Copy link
Member

Closing.

@IgorNovozhilov
Copy link

Repeats for html, the spaces are replaced with tabs, regardless of the settings.

@roblourens roblourens added the verified Verification succeeded label Sep 29, 2016
@dbaeumer
Copy link
Member

dbaeumer commented Oct 3, 2016

@IgorNovozhilov can you please open a separate issue describing the problem you have with HTML. This was about TS and replacing tabs with spaces :-)

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants