ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-oxfmt

by sublimelsp ST4

Oxfmt LSP server for Sublime Text

Details

Installs

  • Total 27
  • Win 7
  • Mac 16
  • Linux 4
Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16
Windows 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 2 1 0 0 1 0 1 1 1 1 0 1 2 0 1 0 1 1 0 1 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 1 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

LSP-oxfmt

Oxfmt support for Sublime Text, provided through the oxfmt language server.

Oxfmt formats JavaScript, TypeScript, JSX, TSX, JSON, JSONC, JSON5, CSS, SCSS, Less, HTML, Vue, Svelte, Angular templates, Handlebars, MJML, Markdown, MDX, YAML, TOML and GraphQL.

Installation

  1. Install LSP and LSP-oxfmt via Package Control.
  2. (Optional but recommended) Install LSP-file-watcher-chokidar via Package Control. The server uses file watching to reload when .oxfmtrc.json changes.
  3. Restart Sublime.

Oxfmt resolution

The package uses oxfmt from the project's local dependencies (node_modules/oxfmt) when it is present. We recommend to add oxfmt as a project dependency, so that the CLI and the editor use the same version.

You can also set an explicit path with the server_path setting. A relative path is resolved against the workspace folder.

If the project has no oxfmt dependency and server_path is auto, the package uses the oxfmt version that it manages itself.

Configuration

Open the configuration file with the Command Palette Preferences: LSP-oxfmt Settings command or from the Sublime menu.

The settings use the option keys of the oxc language server.

Formatting options are configured in the .oxfmtrc.json file of the project. Refer to Configuring oxfmt.

To disable oxfmt for some file types, override the selector setting.

Usage

To format a document, open the Command Palette and select LSP: Format File.

To format on save, open Preferences: LSP Settings from the Command Palette and set:

{
    "lsp_format_on_save": true,
}

When more than one server can format a file (for example LSP-oxfmt and LSP-biome), LSP: Format File asks which server to use and remembers the choice for that syntax. You can also set the formatter in the project settings:

{
    "settings": {
        "LSP": {
            "formatters": {
                "source.ts": "LSP-oxfmt",
            }
        }
    }
}