Skip to content

"editor.formatOnSave": false doesn't appear to be respected #303

@rmtsrc

Description

@rmtsrc

In my project workspace settings file .vscode/settings.json I have:

{
  "editor.formatOnSave": true,
  "[shellscript]": {
    "editor.formatOnSave": false
  }
}

However, when I save a shell script it's still auto formatted.

As a workaround, to stop auto formatting on shell scripts in my project I have to add all supported file types except for shellscript to:

{
  "shellformat.effectLanguages": [
    "dockerfile",
    "dotenv",
    "hosts",
    "jvmoptions",
    "ignore",
    "gitignore",
    "properties",
    "spring-boot-properties",
    "azcli",
    "bats"
  ]
}

It would be good if this extension also respected the standard VSCode editor.formatOnSave setting.

Activity

changed the title [-]`"editor.formatOnSave": false` doesn't appear to be supported[/-] [+]`"editor.formatOnSave": false` doesn't appear to be respected[/+] on Oct 19, 2022
soredake

soredake commented on Feb 23, 2023

@soredake

Reported the same in vscode repo microsoft/vscode#173689

linked a pull request that will close this issue on Jul 20, 2023
self-assigned this
on Jul 20, 2023
foxundermoon

foxundermoon commented on Jul 20, 2023

@foxundermoon
Owner

The early implementation is not elegant enough, it seems that it needs to be re-architected.
https://code.visualstudio.com/blogs/2016/11/15/formatters-best-practices#_the-formatting-api

trinitronx

trinitronx commented on Jun 25, 2024

@trinitronx

This would be a very nice to have feature, as it would allow for configurations like other formatters & linters:

    "[shellscript]": {
      "files.eol": "\n",
      "editor.formatOnSave": true,
      "editor.codeActionsOnSave": {
        "source.fixAll.shellcheck": "explicit"
      },
      "editor.defaultFormatter": "foxundermoon.shell-format"
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Status

todo

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @trinitronx@rmtsrc@foxundermoon@soredake

    Issue actions

      `"editor.formatOnSave": false` doesn't appear to be respected · Issue #303 · foxundermoon/vs-shell-format