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

LSP-oxfmt

by sublimelsp ST4 New

Oxfmt LSP server for Sublime Text

Details

Installs

  • Total 0
  • Win 0
  • Mac 0
  • Linux 0
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 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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",
            }
        }
    }
}