Editor support

Note

Version numbers of the Jarl extensions may differ from the version number of Jarl itself. This is made on purpose so that it is easier to make releases that are specific to each extension or to Jarl itself.

To get the version number of Jarl itself, use jarl --version.

VS Code / Positron

Both VS Code and Positron have access to the Jarl extension via the VS Marketplace and Open VSX.

This extension provides code higlights and quick fixes:

  • code highlights will underline pieces of code that violate any rule in your setup:

R script with `any(is.na(x))` underlined in yellow, indicating a rule violation. A popup shows Jarl message.

  • quick fixes lightbulb icons will appear when the cursor is next to a highlighted piece of code. Clicking this icon will give you several options: apply the fix only for this piece of code, add a comment to ignore this specific violation, or add a comment to ignore all violations present in this piece of code. The screenshots below show the procedure to apply the fix:

R script showing the code `any(is.na(x))`. A blue lightbulb shows that a quick fix is available for this piece of code.

After clicking on the lightbulb, a popup appears with a button to automatically apply the fix.

The fix has been applied, the screenshot now shows `anyNA(x)`.

This extension provides few options integrated in VS Code or Positron. One of them is “Assignment operator”, that indicates which of "=" or "<-" is preferred in the files parsed by Jarl. This option can be set at the User or Workspace level by looking for “Jarl” in the IDE settings.

It is recommended to use jarl.toml if more configuration is needed.

Tip

The Tombi extension is useful to have suggestions and autocompletion when editing jarl.toml.

Zed

Jarl is available in the list of Zed extensions. After installing it, you will need to update settings.json, in particular the field languages:

"languages": {
  "Python": {
    [...]
  },
  "R": {
    "language_servers": ["jarl"]
  }
}

language_servers accepts multiple values, so you may have "language_servers": ["jarl", "air"] for example.

As in Positron / VS Code, it is possible to pass a few options, such as assignmentOperator. This has to be specified in the lsp field:

"lsp": {
  "jarl": {
    "initialization_options": {
      "assignmentOperator": "="
    }
  }
}