Skip to content

oxfmt with zed malforming files when there are unsaved changes #178

Description

@osdiab

Problem

I added a line of code, and then format the file; it's applying formatting badly, which ends up malforming my code. See this video:

https://www.loom.com/share/10fe8ae1db2e4c14aa8cc1ab792ec885

This does not happen when I run oxfmt from the command line, nor in Cursor. Just in Zed.

Zed config:

{
  "lsp": {
    "tsgo": {
      "settings": {
        "package_version": "7.0.0-dev.20260423.1"
      }
    },
    "oxlint": {
      "initialization_options": {
        "settings": {
          "configPath": "./oxlint.config.ts",
          "disableNestedConfig": false,
          "fixKind": "safe_fix",
          "run": "onType",
          "unusedDisableDirectives": "deny"
        }
      }
    },
    "oxfmt": {
      "initialization_options": {
        "settings": {
          "fmt.configPath": "./oxfmtrc.json",
          "run": "onSave"
        }
      }
    }
  },
  "format_on_save": "on",
  "prettier": {
    "allowed": false
  },
  "formatter": [{ "language_server": { "name": "oxfmt" } }],
  "languages": {
    "TypeScript": {
      "language_servers": ["tsgo", "oxlint", "oxfmt"],
      "format_on_save": "on",
      "prettier": {
        "allowed": false
      },
      "formatter": [
        {
          "language_server": {
            "name": "oxfmt"
          }
        }
      ]
    },
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions