Skip to content

Modes

Moves {, }, ;, and trailing , to the right margin. Source semantics are completely untouched — the formatted file is identical in behaviour to the original.

// input
function greet(name) {
if (!name) {
return "hello";
}
return `hi, ${name}`;
}
// default mode output
function greet(name) {
if (!name) {
return "hello"; }
return `hi, ${name}`; }

Everything default does, plus:

  1. A synthetic end line is injected after each closing brace, matching the indentation of the block it closes.
  2. A variable declaration is injected right after the first { (so the file still executes without errors).
// ruby mode output
function greet(name) { let end=null;
if (!name) {
return "hello"; }
end
return `hi, ${name}`; }
end

When ruby.smartEnd is true (the default), end is not inserted before these continuation keywords:

  • else
  • catch
  • finally
  • while (do…while)

Change the injected identifier via ruby.variableName:

{ "ruby": { "variableName": "_end" } }

Set to false to skip the variable declaration injection (useful if you’re formatting a snippet that isn’t a standalone file).

Each plugin declares whether it supports ruby mode. For plugins that do, the declaration template is language-appropriate:

PluginDeclaration
(core)let end=null;
@indentier/plugin-rustconst end:()=();
@indentier/plugin-govar end any=nil
@indentier/plugin-cvoid*end=0;
@indentier/plugin-php$end=null;