Setup
Requirements
Dixtra runs against Scala 3 code and it supports Scala 2.13 output for cross-compiled projects. The plugin requires sbt 2.
The sbt plugin
Add the plugin to project/plugins.sbt:
addSbtPlugin("com.colofabrix.scala" % "sbt-dixtra" % "1.0.0-RC1")
The plugin is enabled in every project of the build. Its tasks are listed in the sbt plugin.
With the plugin installed, format the sources of a project:
sbt dixtraFormatAll
and check that they are formatted:
sbt dixtraCheckAll
Dixtra formats the code it understands and copies the rest, so the first run rarely fails: it reports the files it could not format, and the ones it could not parse.
The VS Code extension
The extension formats the document of the editor with Dixtra when you run Format Document (Shift+Alt+F).
Install it with code --install-extension dixtra-vscode-<platform>-<version>.vsix, from the releases page, or from the VS Code marketplace when it is published there. It is described in the VS Code extension.
The command line
The command line is a single executable, dixtra. It formats the files you give it, whatever they are, and it is the same formatter the plugin and the extension use.
Download the executable for your platform from the releases page, and put it on your path:
linux-x64 dixtra-linux-x64
macos-arm64 dixtra-darwin-arm64
windows-x64 dixtra-win32-x64.exe
Then format a directory:
dixtra src
The options are listed in the command line.
The library
The formatter alone, with no dependency other than scalameta:
libraryDependencies += "com.colofabrix.scala" %% "dixtra-core" % "1.0.0-RC1"
Its API is described in using Dixtra as a library.