Settings do not apply if .editorconfig file is not in curently opened folder / workspace
See original GitHub issuePlease fill-in this template.
- I have a question that is specific to this extension; thus, inappropriate for the main EditorConfig issue tracker.
- I tried running
code --disable-extensions
and the issue did NOT present itself. (Does not apply as my problem is with the extensions functionality)
Delete the following condition if it doesn’t apply to your case:
If the extension is not picking up the expected configuration for a file:
- I tried
npm install editorconfig -g
and raneditorconfig [file-in-question]
and the configuration was what I expected. If not, please file on theeditorconfig-core-js
issue tracker.
Issue
Visual Studio Code | editorconfig-vscode | |
---|---|---|
Version | 1.17.2 |
0.11.1 |
Root .editorconfig
File
root = true
[*]
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
end_of_line = crlf
Are there any other relevant .editorconfig
files in your project? No
Visual Studio Code Setting | Default | User | Workspace |
---|---|---|---|
editor.insertSpaces |
true |
true |
____ |
editor.tabSize |
4 |
2 |
_ |
editor.trimAutoWhitespace |
true |
true |
____ |
files.autoSave |
"off" |
"off" |
"___" |
files.insertFinalNewline |
false |
false |
_____ |
files.trimTrailingWhitespace |
false |
false |
_____ |
File opened
relative to root .editorconfig: ./dir1/dir2/dir3/dir4/foo.sql
relative to folder opened in VS Code: ./dir4/foo.sql
Expected behavior
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
end_of_line = crlf
Actual behavior
VS Code settings
Additional comments or steps to reproduce
The .editorconfig file is 3 directories up from directory opened in VS Code
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
EditorConfig settings - Visual Studio (Windows) - Microsoft Learn
Settings in EditorConfig files let you maintain consistent coding styles and settings in a codebase, such as indent style, tab width, end of...
Read more >editorconfig editor window does not show correct file Location
editorconfig file in Visual Studio, the Location column does not show the right value. It seems that if a code style rule is...
Read more >editorconfig vscode not working - You.com | The AI Search ...
Open Visual Studio Code User Settings (menu File → Preferences → Settings → User Settings tab). Click the icon in the top-right part...
Read more >Should I commit the .vscode folder to source control?
Check in the .vscode folder if you want to share settings, task configuration and debug configuration with the team. I think generally it...
Read more >Web IDE - GitLab Docs
You can also open the Web IDE when viewing a file, from the repository file list, ... .gitlab/.gitlab-webide.yml does not exist or is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Note for some people as me: for
[*.{ts,tsx}]
do not use space after comma!After creating the .editorconfig file, I had to close and re-open vscode for it to notice.