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

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

Closed
2 of 3 tasks
gardient opened this issue Oct 26, 2017 · 13 comments
Closed
2 of 3 tasks

Comments

@gardient
Copy link

gardient commented Oct 26, 2017

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

@jednano
Copy link
Member

jednano commented Oct 26, 2017

Please clarify the atual behavior. Which vscode settings have been set? It looks like you have no workspace settings, so is it applying your user settings? Please be very specific.

Also, are the settings applied different than running editorconfig ./dir4/foo.sql? If so, which part is different?

@gardient
Copy link
Author

gardient commented Oct 26, 2017

No workspace settings

Actual behavior

insert_final_newline = false
indent_size = 2

these are different from running editorconfig ./dir4/foo.sql

can't reproduce it at home so will have to check again at work

@akougblenou
Copy link

akougblenou commented Dec 21, 2017

My issue is similar to that of @gardient (I also try the same fixes he did), but the editorconfig settings are still not applied:

Expected Settings:

root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_size = 4
indent_style = space

[{*.json,.vera}]
indent_size = 2

Tried:
editorconfig ./src/components/StatelessRadio.js

Got the actual settings:

end_of_line=lf
insert_final_newline=true
charset=utf-8
indent_size=4
indent_style=space
tab_width=4

I don't know where tab_width=4came from and my eslint is still shouting like crazy...

@gsemet
Copy link

gsemet commented Jan 7, 2018

i think this plugin does not support the [{...}] synthax

@xuhdev
Copy link
Member

xuhdev commented Jan 7, 2018

@AKFourSeven You should use [*.json], not [{*.json}].

@gsemet
Copy link

gsemet commented Jan 7, 2018

it's a legal syntax. [*.{js,json}] for instance should work, but I don't find a way to have it working with vscode

@xuhdev
Copy link
Member

xuhdev commented Jan 7, 2018

If you don't have a comma inside the curly braces, the curly braces are treated as literals.

@akougblenou
Copy link

Sorry there was something missing in my post, I just corrected it :
it's [{*.json,.vera}] and not just [[*.json}], should I still remove the curly braces ?

I thought there was a typo with .vera as in I should right *.vera and that got it to work for 10 seconds, and then it got problematic again (wrong spaces and whatnot!!)

@xuhdev
Copy link
Member

xuhdev commented Jan 8, 2018

@AKFourSeven I guess you want [*.{json,vera}]. In your version, *.vera would not match.

@akougblenou
Copy link

I will change that, but it seems to work better now anyways !!

@jednano
Copy link
Member

jednano commented Jan 23, 2018

It looks like the current state of this issue is that people cannot reproduce or it's now working better after some config tweaks, so I'm going to close until further notice.

@jednano jednano closed this as completed Jan 23, 2018
@tacone
Copy link

tacone commented Aug 31, 2018

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

@Somnium7
Copy link

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

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

No branches or pull requests

7 participants