Skip to content

Some editor settings are not being respected by language #19511

Closed

Description

Following settings are not getting update by language

editor.tabSize
editor.insertSpaces
editor.detectIndentation
editor.trimAutoWhitespace

Activity

  1. added
    bug
    important
    on Jan 27, 2017
  2. sandy081 commented on Jan 27, 2017

    @sandy081
    MemberAuthor

    Above settings comes from the Model and are created/updated by the modelService. Fixing this need adoption in modelService to language based changes to configurations.

  3. added
    candidate
    on Jan 27, 2017
  4. 9 remaining items

  5. added a commit that references this issue on Jan 31, 2017
  6. removed
    candidate
    on Jan 31, 2017
  7. sandy081 commented on Feb 6, 2017

    @sandy081
    MemberAuthor

    @mdalpi Please let me know the use case behind supporting files.exclude in the list? Also please create a separate issue for that. Thanks.

  8. kristianmandrup commented on Mar 7, 2017

    @kristianmandrup

    I'm currently unable to avoid auto-save indentation of 4 spaces for my .js files.
    I tried everything. Disabled all linter extensions. Configuring .vscode/settings.json

    {
        "vsicons.presets.angular": false,
        "editor.tabSize": 2,
        "editor.detectIndentation": false,
        "editor.formatOnSave": false
    }

    Added the same for my preferences/user settings file:

    // Place your settings in this file to overwrite the default settings
    {
        "editor.tabSize": 2,
        "editor.detectIndentation": false,
        "editor.formatOnSave": false,
        "typescript.check.tscVersion": false,
        "window.zoomLevel": 0,
        "files.trimTrailingWhitespace": true,
        "npm.validate.enable": false,
        "editor.minimap.enabled": true,
        "workbench.iconTheme": "vscode-icons",
        "[javascript]": {
            "editor.tabSize": 2
        }
    }

    Still it auto-indents on every save to 4 spaces! Is there any way to get around this on the current release? Or is it some extension playing tricks on me?

  9. sandy081 commented on Mar 7, 2017

    @sandy081
    MemberAuthor

    Kristian Mandrup (@kristianmandrup) You can try disabling all extensions, with vanilla VS Code, do following

    • Have empty .vscode/settings.json
    • In user settings have following
    "editor.detecetIndentation": false,
    "editor.tabSize": 2
    

    Above user settings will have tab size to 2 for all files. To do just for javascript files have following in user settings

    "[javascript]": {
    "editor.detecetIndentation": false,
    "editor.tabSize": 2
    }
    

    Let me know if above works for you?

  10. kristianmandrup commented on Mar 7, 2017

    @kristianmandrup

    This is exactly what I tried (see above), except disabling all my extensions. Thanks anyways.

  11. sandy081 commented on Mar 7, 2017

    @sandy081
    MemberAuthor

    can you try disabling extensions and see if it works?

  12. kristianmandrup commented on Mar 7, 2017

    @kristianmandrup

    Turned out the vscode-JS-CSS-HTML-formatter extension was to blame. Solved now! Thanks

  13. ryenus commented on Aug 20, 2017

    @ryenus
    Contributor

    I just encountered the same trap, and Kristian Mandrup (@kristianmandrup) is right.
    For those installed JS-CSS-HTML Formatter extension, please check Formatter Config (via Command Palette), especially, the following (default) settings:

    "javascript": {
      "indent_size": 4,
      "end_with_newline": true
      // ...
    }
    
  14. Earl-Brown commented on Oct 12, 2017

    @Earl-Brown

    Sandeep Somavarapu (@sandy081) - the editor.detectIndentation trick worked for me. Thanks!

  15. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugimportantverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions