Skip to content

Formats on save even if excluded by deno.json #1338

@felipecrs

Description

@felipecrs

Describe the bug

The Deno extension for VS Code formats files on save even if they are excluded by deno.json.

To Reproduce

.vscode/settings.json:

{
  "[jsonc]": {
    "editor.defaultFormatter": "denoland.vscode-deno",
    "editor.formatOnSave": true
  }
}

deno.json:

{
  "fmt": {
    "exclude": [
      "fixture.jsonc"
    ]
  }
}

fixture.jsonc:

{"a": "property"} // should not be formatted

Gets formatted to:

{
    "a": "property"
} // should not be formatted

Expected behavior

Deno should not format files on save if excluded by deno.json. Similar to Deno CLI:

$ deno fmt fixture.jsonc
error: No target files found.

Screenshots

No response.

Versions

  • vscode: 1.105.1
  • deno: 2.5.4
  • extension: 3.45.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions