admin管理员组文章数量:1022935
I want to use tabs for indentation in my Javascript files. I changed the configuration as usual, but the preview doesn't seem to take my modification in account. Neither in the acutal files.
What is surprising is that the "Spaces" subtab is formatting the code the right way, but it's is the only place where it works. (See screenshots below)
Did anyone have the same issue ?
I am using IntelliJ Ultimate 2016.1
I want to use tabs for indentation in my Javascript files. I changed the configuration as usual, but the preview doesn't seem to take my modification in account. Neither in the acutal files.
What is surprising is that the "Spaces" subtab is formatting the code the right way, but it's is the only place where it works. (See screenshots below)
Did anyone have the same issue ?
I am using IntelliJ Ultimate 2016.1
Share Improve this question asked Apr 15, 2016 at 10:35 xureixurei 1,0868 silver badges23 bronze badges 2- Did you actually change the files? The setting just applies to new indentation, you'd have to reformat existing files in order to apply it retrospectively. – T.J. Crowder Commented Apr 15, 2016 at 10:40
- Yes, I did change the files. Actually, when I press I add a new line or try to reformat a javascript file, the indentation is converted to spaces even when I check the "Use tab character" as shown on the screenshot. – xurei Commented Apr 15, 2016 at 10:46
2 Answers
Reset to default 5Take a look a editorconfig . You will need a .editorconfig file at the root of your project. It's a markup file that works accros multiple IDE's to set some mon configuration like indentation and trailing spaces. Here is an example.
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
[*.js]
indent_size = 2
From Intellij Idea 14 onwards, IDE by default detects existing indentation styles in existing files and uses them instead of your settings. You can Turn this feature off in the prefferences:
Prefferences -> Editor -> Code Style -> Detect and use existing file indents for editing
If turning off this feature does not help, make sure your project does not have .editorconfig file, which defines indentation styles as well.
I want to use tabs for indentation in my Javascript files. I changed the configuration as usual, but the preview doesn't seem to take my modification in account. Neither in the acutal files.
What is surprising is that the "Spaces" subtab is formatting the code the right way, but it's is the only place where it works. (See screenshots below)
Did anyone have the same issue ?
I am using IntelliJ Ultimate 2016.1
I want to use tabs for indentation in my Javascript files. I changed the configuration as usual, but the preview doesn't seem to take my modification in account. Neither in the acutal files.
What is surprising is that the "Spaces" subtab is formatting the code the right way, but it's is the only place where it works. (See screenshots below)
Did anyone have the same issue ?
I am using IntelliJ Ultimate 2016.1
Share Improve this question asked Apr 15, 2016 at 10:35 xureixurei 1,0868 silver badges23 bronze badges 2- Did you actually change the files? The setting just applies to new indentation, you'd have to reformat existing files in order to apply it retrospectively. – T.J. Crowder Commented Apr 15, 2016 at 10:40
- Yes, I did change the files. Actually, when I press I add a new line or try to reformat a javascript file, the indentation is converted to spaces even when I check the "Use tab character" as shown on the screenshot. – xurei Commented Apr 15, 2016 at 10:46
2 Answers
Reset to default 5Take a look a editorconfig . You will need a .editorconfig file at the root of your project. It's a markup file that works accros multiple IDE's to set some mon configuration like indentation and trailing spaces. Here is an example.
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
[*.js]
indent_size = 2
From Intellij Idea 14 onwards, IDE by default detects existing indentation styles in existing files and uses them instead of your settings. You can Turn this feature off in the prefferences:
Prefferences -> Editor -> Code Style -> Detect and use existing file indents for editing
If turning off this feature does not help, make sure your project does not have .editorconfig file, which defines indentation styles as well.
本文标签: IntelliJTab indentation in Javascript does not workStack Overflow
版权声明:本文标题:IntelliJ - Tab indentation in Javascript does not work - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745593640a2158032.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论