Skip to content

oxc-project/oxc-zed

Repository files navigation

OXC Logo

Oxc extension for Zed

This extension adds support for Oxc in Zed.

Languages currently supported:

  • JavaScript
  • TypeScript
  • JSX
  • TSX
  • Vue.js
  • Astro
  • Svelte

Installation

Requires Zed >= v0.205.0.

This extension is available in the extensions view inside the Zed editor. Open zed: extensions and search for Oxc.

Configuration

Configuration is done within your settings.json file. Below are some example configurations. See https://github.com/oxc-project/oxc/tree/main/crates/oxc_language_server for the options that are supported by the language server.

Oxfmt

{
  "languages": {
    "JavaScript": {
      "format_on_save": "on",
      "formatter": [
        {
          "language_server": {
            "name": "oxfmt"
          }
        }
      ]
    }
  },
  "lsp": {
    "oxfmt": {
      "initialization_options": {
        "settings": {
          "configPath": null,
          "flags": {},
          "fmt.configPath": null,
          "fmt.experimental": true,
          "run": "onSave",
          "typeAware": false,
          "unusedDisableDirectives": false
        }
      }
    }
  }
}

Oxlint

{
  "languages": {
    "JavaScript": {
      "format_on_save": "on",
      "formatter": [
        {
          "code_action": "source.fixAll.oxc"
        }
      ]
    }
  },
  "lsp": {
    "oxlint": {
      "initialization_options": {
        "settings": {
          "disableNestedConfig": false,
          "fixKind": "safe_fix",
          "run": "onType",
          "typeAware": true,
          "unusedDisableDirectives": "deny"
        }
      }
    }
  }
}

Oxfmt and Oxlint

{
  "languages": {
    "JavaScript": {
      "format_on_save": "on",
      "formatter": [
        {
          "language_server": {
            "name": "oxfmt"
          }
        },
        {
          "code_action": "source.fixAll.oxc"
        }
      ]
    }
  },
  "lsp": {
    "oxlint": {
      "initialization_options": {
        "settings": {
          "disableNestedConfig": false,
          "fixKind": "safe_fix",
          "run": "onType",
          "typeAware": true,
          "unusedDisableDirectives": "deny"
        }
      }
    },
    "oxfmt": {
      "initialization_options": {
        "settings": {
          "configPath": null,
          "flags": {},
          "fmt.configPath": null,
          "fmt.experimental": true,
          "run": "onSave",
          "typeAware": false,
          "unusedDisableDirectives": false
        }
      }
    }
  }
}

About

Oxc extension for Zed

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages