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.

Editorconfig should not apply styles to files located outside the root directory

See original GitHub issue

I’ve found that editorconfig changes to tabs as specified in the project’s .editorconfig when I edit my settings.json file which is located away from the root open folder in ~/.config. It should instead not apply the editorconfig settings in this case.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Tyriarcommented, Sep 25, 2016

Verified fixed 👍 thanks guys

1reaction
SamVerschuerencommented, Sep 23, 2016

@Tyriar You are right!

@jedmao It looks like the code wasn’t compiled before releasing a new version.

Source: DocumentWatcher.ts

private _onConfigChanged() {
    const workspaceConfig = workspace.getConfiguration('editor');
    const detectIndentation = workspaceConfig.get<boolean>('detectIndentation');

    this._defaults = (detectIndentation) ? {} : {
        tabSize: workspaceConfig.get<string | number>('tabSize'),
        insertSpaces: workspaceConfig.get<string | boolean>('insertSpaces')
    };
}

Code in Extension: DocumentWatcher.js

_onConfigChanged() {
    this._defaults = {
        tabSize: vscode_1.workspace.getConfiguration('editor')
            .get('tabSize'),
        insertSpaces: vscode_1.workspace.getConfiguration('editor')
            .get('insertSpaces')
    };
}
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 >
Use EditorConfig | ReSharper Documentation - JetBrains
As EditorConfig convention suggests, ReSharper will apply code styles defined in files named .editorconfig in the directory of the current ...
Read more >
EditorConfig
EditorConfig is a file format and collection of text editor plugins for maintaining consistent coding styles between different editors and IDEs.
Read more >
how to apply .editorconfig to existing project in intellij
just enable it... ;). (unfortunately the setting is off by default). Settings > Editor > Code Style. checkbox Enable EditorConfig support.
Read more >
Why You Should Use EditorConfig to Standardize Code Styles
You must set root to true for the top level EditorConfig in the project, which is normally in the root of your project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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