question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Settings do not apply if .editorconfig file is not in curently opened folder / workspace

See original GitHub issue

Please 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 ran editorconfig [file-in-question] and the configuration was what I expected. If not, please file on the editorconfig-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:closed
  • Created 6 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
Somnium7commented, Feb 24, 2021

Note for some people as me: for [*.{ts,tsx}] do not use space after comma!

6reactions
taconecommented, Aug 31, 2018

After creating the .editorconfig file, I had to close and re-open vscode for it to notice.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found