From e398c24ba19948727affdc6a29254ac69a6b7699 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 03:35:02 -0300 Subject: syntax: helix's indents.scm vendored beside each grammar's textobjects.scm and embedded the same way (zig's adapted to this grammar's node names, rust's \A regexes written with ^, erlang's left out as it does not compile here), compiled when first asked for as a Lazy beside the textobjects, so a new line can take its indent from the tree Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- build.zig | 3 + src/syntax.zig | 69 +++++++++----- vendor/queries/README.md | 15 ++- vendor/queries/bash/indents.scm | 23 +++++ vendor/queries/c/indents.scm | 58 ++++++++++++ vendor/queries/c_sharp/indents.scm | 20 ++++ vendor/queries/clojure/indents.scm | 65 +++++++++++++ vendor/queries/cpp/indents.scm | 63 +++++++++++++ vendor/queries/css/indents.scm | 12 +++ vendor/queries/elixir/indents.scm | 27 ++++++ vendor/queries/fortran/indents.scm | 36 ++++++++ vendor/queries/go/indents.scm | 55 +++++++++++ vendor/queries/html/indents.scm | 20 ++++ vendor/queries/java/indents.scm | 53 +++++++++++ vendor/queries/javascript/indents.scm | 72 +++++++++++++++ vendor/queries/json/indents.scm | 14 +++ vendor/queries/kotlin/indents.scm | 51 +++++++++++ vendor/queries/ocaml/indents.scm | 27 ++++++ vendor/queries/php/indents.scm | 34 +++++++ vendor/queries/python/indents.scm | 98 ++++++++++++++++++++ vendor/queries/ruby/indents.scm | 32 +++++++ vendor/queries/rust/indents.scm | 166 ++++++++++++++++++++++++++++++++++ vendor/queries/scala/indents.scm | 29 ++++++ vendor/queries/zig/indents.scm | 22 +++++ 24 files changed, 1039 insertions(+), 25 deletions(-) create mode 100644 vendor/queries/bash/indents.scm create mode 100644 vendor/queries/c/indents.scm create mode 100644 vendor/queries/c_sharp/indents.scm create mode 100644 vendor/queries/clojure/indents.scm create mode 100644 vendor/queries/cpp/indents.scm create mode 100644 vendor/queries/css/indents.scm create mode 100644 vendor/queries/elixir/indents.scm create mode 100644 vendor/queries/fortran/indents.scm create mode 100644 vendor/queries/go/indents.scm create mode 100644 vendor/queries/html/indents.scm create mode 100644 vendor/queries/java/indents.scm create mode 100644 vendor/queries/javascript/indents.scm create mode 100644 vendor/queries/json/indents.scm create mode 100644 vendor/queries/kotlin/indents.scm create mode 100644 vendor/queries/ocaml/indents.scm create mode 100644 vendor/queries/php/indents.scm create mode 100644 vendor/queries/python/indents.scm create mode 100644 vendor/queries/ruby/indents.scm create mode 100644 vendor/queries/rust/indents.scm create mode 100644 vendor/queries/scala/indents.scm create mode 100644 vendor/queries/zig/indents.scm diff --git a/build.zig b/build.zig index 0aacd3b2..1b9d9651 100644 --- a/build.zig +++ b/build.zig @@ -331,6 +331,9 @@ pub fn build(b: *std.Build) void { // grammar without one gets none const objects = configureRead(b, io, b.root, "vendor/queries/" ++ g.name ++ "/textobjects.scm", 0x100000) catch ""; ts_queries.addOption([]const u8, g.name ++ "_textobjects", objects); + // and their indent queries, beside them + const indents = configureRead(b, io, b.root, "vendor/queries/" ++ g.name ++ "/indents.scm", 0x100000) catch ""; + ts_queries.addOption([]const u8, g.name ++ "_indents", indents); const lib = b.addLibrary(.{ .name = "tree-sitter-" ++ g.name, diff --git a/src/syntax.zig b/src/syntax.zig index 96af9fa7..5fe557ae 100644 --- a/src/syntax.zig +++ b/src/syntax.zig @@ -12,7 +12,7 @@ const zig_grammar = config.syntax_zig_grammar; const minimal_grammars = config.syntax_minimal_grammars; const full_grammars = config.syntax_full_grammars; -const ts = if (enabled) @import("tree-sitter") else struct { +pub const ts = if (enabled) @import("tree-sitter") else struct { pub const Language = opaque {}; pub const Query = opaque {}; pub const Parser = opaque {}; @@ -24,15 +24,18 @@ const LanguageFn = *const fn () callconv(.c) *const ts.Language; pub const Syn = enum(u8) { none, keyword, string, number, comment }; +/// A query compiled when first asked for: "" for none, null when it fails. +const Lazy = struct { src: []const u8 = "", query: ?*ts.Query = null, failed: bool = false }; + const Spec = struct { name: []const u8, exts: []const []const u8, language: *const fn () callconv(.c) *const ts.Language, query_src: []const u8, - /// helix's textobjects.scm for the grammar (vendor/queries), "" for none - objects_src: []const u8 = "", - objects: ?*ts.Query = null, - objects_failed: bool = false, + /// helix's textobjects.scm and indents.scm for the grammar + /// (vendor/queries), compiled the first time they are asked for + objects: Lazy = .{}, + indents: Lazy = .{}, selected: ?Selected = null, capture_styles: [256]u8 = undefined, }; @@ -137,7 +140,8 @@ fn initSpecs() [specCount()]Spec { .exts = g.exts, .language = @extern(LanguageFn, .{ .name = "tree_sitter_" ++ g.name }), .query_src = querySrc(g), - .objects_src = @field(ts_queries, g.name ++ "_textobjects"), + .objects = .{ .src = @field(ts_queries, g.name ++ "_textobjects") }, + .indents = .{ .src = @field(ts_queries, g.name ++ "_indents") }, }; i += 1; } @@ -180,9 +184,10 @@ pub fn stop() void { selected.query.destroy(); } spec.selected = null; - if (spec.objects) |q| q.destroy(); - spec.objects = null; - spec.objects_failed = false; + for ([_]*Lazy{ &spec.objects, &spec.indents }) |lazy| { + if (lazy.query) |q| q.destroy(); + lazy.* = .{ .src = lazy.src }; + } } for (&diff_pieces) |*slot| { if (slot.*) |piece| syntax_allocator.free(piece.styles); @@ -499,21 +504,37 @@ fn objectName(o: Object) []const u8 { /// The grammar's textobject query for `path`, compiled the first time; null /// when the grammar has none. fn objectQuery(path: []const u8) ?*ts.Query { + const spec = specFor(path) orelse return null; + return lazyQuery(spec, &spec.objects); +} + +/// The grammar's indent query for `path` (src/indent.zig) and the +/// grammar's name; null when it has none. +pub fn indentQuery(path: []const u8) ?struct { *ts.Query, []const u8 } { + if (!enabled) return null; + const spec = specFor(path) orelse return null; + return .{ lazyQuery(spec, &spec.indents) orelse return null, spec.name }; +} + +fn specFor(path: []const u8) ?*Spec { const ext = std.Io.Dir.path.extension(path); for (&specs) |*spec| for (spec.exts) |choice| { - if (!std.ascii.eqlIgnoreCase(ext, choice)) continue; - if (spec.objects) |q| return q; - if (spec.objects_src.len == 0 or spec.objects_failed) return null; - var error_offset: u32 = 0; - spec.objects = ts.Query.create(spec.language(), spec.objects_src, &error_offset) catch { - spec.objects_failed = true; - return null; - }; - return spec.objects; + if (std.ascii.eqlIgnoreCase(ext, choice)) return spec; }; return null; } +fn lazyQuery(spec: *Spec, lazy: *Lazy) ?*ts.Query { + if (lazy.query) |q| return q; + if (lazy.src.len == 0 or lazy.failed) return null; + var error_offset: u32 = 0; + lazy.query = ts.Query.create(spec.language(), lazy.src, &error_offset) catch { + lazy.failed = true; + return null; + }; + return lazy.query; +} + fn captureId(q: *const ts.Query, name: []const u8) ?u32 { for (0..q.captureCount()) |i| if (std.mem.eql(u8, q.captureNameForId(@intCast(i)) orelse "", name)) return @intCast(i); return null; @@ -1260,19 +1281,19 @@ test { _ = diff; } -test "every vendored textobject query compiles against its grammar" { +test "every vendored textobject and indent query compiles against its grammar" { if (!enabled) return; var failed: usize = 0; - for (&specs) |*spec| { - if (spec.objects_src.len == 0) continue; + for (&specs) |*spec| for ([_]Lazy{ spec.objects, spec.indents }, [_][]const u8{ "textobjects", "indents" }) |lazy, what| { + if (lazy.src.len == 0) continue; var error_offset: u32 = 0; - const q = ts.Query.create(spec.language(), spec.objects_src, &error_offset) catch { - std.debug.print("textobjects for {s} do not compile (offset {d})\n", .{ spec.name, error_offset }); + const q = ts.Query.create(spec.language(), lazy.src, &error_offset) catch { + std.debug.print("{s} for {s} do not compile (offset {d})\n", .{ what, spec.name, error_offset }); failed += 1; continue; }; q.destroy(); - } + }; try std.testing.expectEqual(@as(usize, 0), failed); } diff --git a/vendor/queries/README.md b/vendor/queries/README.md index 082f4e6b..2977e1cc 100644 --- a/vendor/queries/README.md +++ b/vendor/queries/README.md @@ -1,4 +1,4 @@ -# Textobject queries +# Textobject and indent queries `/textobjects.scm` is helix's own query for that grammar, vendored from helix (https://github.com/helix-editor/helix) at 278b24389, the @@ -16,3 +16,16 @@ them), and erlang, whose helix query does not compile against the grammar version pardes builds. Those grammars have no textobjects, and the keys do nothing there, as in helix without a query. + +`/indents.scm` is helix's indent query for that grammar, vendored +the same way from the same commit, for src/indent.zig: the indent a new line +takes on Enter, `o` and `O`. Vendored for bash, c, c_sharp, clojure, cpp +(with c's inlined), css, elixir, fortran, go, html, java, javascript (ecma's +inlined), json, kotlin, ocaml, php, python, ruby, rust, scala and zig. +`zig/indents.scm` is MODIFIED for this zig grammar's node names, and +`rust/indents.scm` writes its three `#match?` regexes with `^` where helix's +open with `\A`, which mvzr does not know; their headers say so. Not vendored: +ada, haskell, markdown, pascal, powershell and typst (helix has no indent +query for them), and erlang, whose query does not compile against the +grammar version pardes builds. A file of those keeps acme's autoindent, the +line's own indent as it is. diff --git a/vendor/queries/bash/indents.scm b/vendor/queries/bash/indents.scm new file mode 100644 index 00000000..5ca59a57 --- /dev/null +++ b/vendor/queries/bash/indents.scm @@ -0,0 +1,23 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/bash/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (function_definition) + (if_statement) + (for_statement) + (while_statement) + (case_statement) + (case_item) + (pipeline) +] @indent + +[ + "}" + "fi" + "elif" + "else" + "done" + "esac" +] @outdent diff --git a/vendor/queries/c/indents.scm b/vendor/queries/c/indents.scm new file mode 100644 index 00000000..0ed0b66d --- /dev/null +++ b/vendor/queries/c/indents.scm @@ -0,0 +1,58 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/c/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (compound_statement) + (declaration_list) + (field_declaration_list) + (enumerator_list) + (parameter_list) + (init_declarator) + (expression_statement) +] @indent + +[ + "case" + "default" + "}" + "]" + ")" +] @outdent + +; Single statement after if/while/for/do without braces. Capture the body child +; naturally; on a typed newline the engine descends into it (no wrapper trick). +(if_statement + consequence: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) +(while_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) +(do_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) +(for_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) + +(parameter_list + . (parameter_declaration) @anchor + ) @align +(argument_list + . (_) @anchor + ) @align +; These are a bit opinionated since some people just indent binary/ternary expressions spanning multiple lines. +; Since they are only triggered when a newline is inserted into an already complete binary/ternary expression, +; this should happen rarely, so it is not a big deal either way. +; Additionally, adding these queries has the advantage of preventing such continuation lines from being used +; as the baseline when the `hybrid` indent heuristic is used (which is desirable since their indentation is so inconsistent). +(binary_expression + ) @anchor @align +(conditional_expression + "?" @anchor + ) @align diff --git a/vendor/queries/c_sharp/indents.scm b/vendor/queries/c_sharp/indents.scm new file mode 100644 index 00000000..bf875d4b --- /dev/null +++ b/vendor/queries/c_sharp/indents.scm @@ -0,0 +1,20 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/c-sharp/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (declaration_list) + (block) + (enum_member_declaration_list) + (accessor_list) + (switch_body) + (switch_section) + (initializer_expression) +] @indent + +[ + "}" + ")" + "]" +] @outdent diff --git a/vendor/queries/clojure/indents.scm b/vendor/queries/clojure/indents.scm new file mode 100644 index 00000000..5c232fc9 --- /dev/null +++ b/vendor/queries/clojure/indents.scm @@ -0,0 +1,65 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/clojure/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +; If a list has 2 elements on the first line, align to the second element. +; Exclude literals and special keywords that have different indentation rules. +(list_lit . (_) @first . (_) @anchor + (#same-line? @first @anchor) + + (#not-kind-eq? @first "bool_lit") + (#not-kind-eq? @first "nil_lit") + (#not-kind-eq? @first "str_lit") + (#not-kind-eq? @first "num_lit") + (#not-kind-eq? @first "kwd_lit") + (#not-match? @first "^(def|defn|defn-|defmacro|defmethod|defmulti|defonce|defprotocol|deftype|defrecord|defstruct|definline|definterface|deftest|ns|let|letfn|binding|loop|for|doseq|dotimes|when-let|if-let|when-some|if-some|with-.*|fn)$")) @align + +; If the first element in a list is also a list and on a line by itself, +; the outer list is aligned to it +(list_lit . (list_lit) @anchor . + ) @align + +(list_lit . (list_lit) @anchor . (_) @second + (#not-same-line? @anchor @second) + ) @align + +; If the first element in a list is not a list and on a line by itself, +; indent the list body by one level +(list_lit . (_) @first . + (#not-kind-eq? @first "bool_lit") + (#not-kind-eq? @first "nil_lit") + (#not-kind-eq? @first "str_lit") + (#not-kind-eq? @first "num_lit") + (#not-kind-eq? @first "kwd_lit") + (#not-match? @first "^(def|defn|defn-|defmacro|defmethod|defmulti|defonce|defprotocol|deftype|defrecord|defstruct|definline|definterface|deftest|ns|let|letfn|binding|loop|for|doseq|dotimes|when-let|if-let|when-some|if-some|with-.*|fn)$")) @indent + +(list_lit . (_) @first . (_) @second + (#not-same-line? @first @second) + (#not-kind-eq? @first "bool_lit") + (#not-kind-eq? @first "nil_lit") + (#not-kind-eq? @first "str_lit") + (#not-kind-eq? @first "num_lit") + (#not-kind-eq? @first "kwd_lit") + (#not-match? @first "^(def|defn|defn-|defmacro|defmethod|defmulti|defonce|defprotocol|deftype|defrecord|defstruct|definline|definterface|deftest|ns|let|letfn|binding|loop|for|doseq|dotimes|when-let|if-let|when-some|if-some|with-.*|fn)$")) @indent + +; If the first element is a literal, align the list to it +(list_lit . [(bool_lit) (nil_lit) (str_lit) (num_lit) (kwd_lit)] @anchor + ) @align + +; Special indentation for def-like forms, let bindings, and other special forms +; These forms typically have the body indented by one level after the name/bindings +(list_lit . (sym_lit) @first + (#match? @first "^(def|defn|defn-|defmacro|defmethod|defmulti|defonce|defprotocol|deftype|defrecord|defstruct|definline|definterface|deftest|ns|let|letfn|binding|loop|for|doseq|dotimes|when-let|if-let|when-some|if-some|with-.*|fn)$")) @indent + +; Align vector/map elements when first two are on same line (e.g., let bindings) +(vec_lit . (_) @anchor . (_) @second + (#same-line? @anchor @second) + ) @align + +(map_lit . (_) @anchor . (_) @second + (#same-line? @anchor @second) + ) @align + +; Indent vectors, maps, and sets +[(vec_lit) (map_lit) (set_lit)] @indent diff --git a/vendor/queries/cpp/indents.scm b/vendor/queries/cpp/indents.scm new file mode 100644 index 00000000..ea91ba4b --- /dev/null +++ b/vendor/queries/cpp/indents.scm @@ -0,0 +1,63 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/cpp/indents.scm, with what it inherits from c inlined. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (compound_statement) + (declaration_list) + (field_declaration_list) + (enumerator_list) + (parameter_list) + (init_declarator) + (expression_statement) +] @indent + +[ + "case" + "default" + "}" + "]" + ")" +] @outdent + +; Single statement after if/while/for/do without braces. Capture the body child +; naturally; on a typed newline the engine descends into it (no wrapper trick). +(if_statement + consequence: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) +(while_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) +(do_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) +(for_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "header")) + +(parameter_list + . (parameter_declaration) @anchor + ) @align +(argument_list + . (_) @anchor + ) @align +; These are a bit opinionated since some people just indent binary/ternary expressions spanning multiple lines. +; Since they are only triggered when a newline is inserted into an already complete binary/ternary expression, +; this should happen rarely, so it is not a big deal either way. +; Additionally, adding these queries has the advantage of preventing such continuation lines from being used +; as the baseline when the `hybrid` indent heuristic is used (which is desirable since their indentation is so inconsistent). +(binary_expression + ) @anchor @align +(conditional_expression + "?" @anchor + ) @align + + +(access_specifier) @outdent + +(raw_string_literal) @opaque diff --git a/vendor/queries/css/indents.scm b/vendor/queries/css/indents.scm new file mode 100644 index 00000000..e42c3be0 --- /dev/null +++ b/vendor/queries/css/indents.scm @@ -0,0 +1,12 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/css/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (block) +] @indent + +[ + "}" +] @outdent diff --git a/vendor/queries/elixir/indents.scm b/vendor/queries/elixir/indents.scm new file mode 100644 index 00000000..cc535930 --- /dev/null +++ b/vendor/queries/elixir/indents.scm @@ -0,0 +1,27 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/elixir/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (anonymous_function) + (do_block) + (stab_clause) + (map) + (list) + (tuple) +] @indent + +; The else/rescue/catch/after clause blocks nest *inside* the do_block, which +; already provides the body's one level of indent; the keyword itself outdents +; back to the construct's level. +[ + "end" + "else" + "rescue" + "catch" + "after" + "]" + "}" + ")" +] @outdent diff --git a/vendor/queries/fortran/indents.scm b/vendor/queries/fortran/indents.scm new file mode 100644 index 00000000..073d4f32 --- /dev/null +++ b/vendor/queries/fortran/indents.scm @@ -0,0 +1,36 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/fortran/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (module) + (submodule) + (program) + (subroutine) + (module_procedure) + (function) + ; (interface) + (if_statement) + (do_loop) + (where_statement) + (derived_type_definition) + (enum) +] @indent + +[ + (end_module_statement) + (end_submodule_statement) + (end_program_statement) + (end_subroutine_statement) + (end_module_procedure_statement) + (end_function_statement) + ; (end_interface_statement) + (end_if_statement) + (end_do_loop_statement) + (else_clause) + (elseif_clause) + (end_type_statement) + (end_enum_statement) + (end_where_statement) +] @outdent diff --git a/vendor/queries/go/indents.scm b/vendor/queries/go/indents.scm new file mode 100644 index 00000000..3734f458 --- /dev/null +++ b/vendor/queries/go/indents.scm @@ -0,0 +1,55 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/go/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +[ + (import_declaration) + (const_declaration) + (type_declaration) + (type_spec) + (func_literal) + (literal_value) + (literal_element) + (keyed_element) + (expression_case) + (default_case) + (type_case) + (communication_case) + (argument_list) + (parameter_list) + (field_declaration_list) + (block) + (var_declaration) + (selector_expression) + (binary_expression) +] @indent + +[ + "]" + ")" +] @outdent + +; Switches and selects aren't indented, only their case bodies are. +; Outdent all closing braces except those closing switches or selects. +( + (_ "}" @outdent) @outer + (#not-kind-eq? @outer "select_statement") + (#not-kind-eq? @outer "type_switch_statement") + (#not-kind-eq? @outer "expression_switch_statement") +) + +; Handle ERROR nodes for when auto-pairs is disabled. +; Typing an opening delimiter without a closing one produces an ERROR node. +(ERROR "{") @indent @extend +(ERROR "(") @indent +(ERROR "[") @indent + +; Labels (`Loop:`, `done:`) are de-indented one level by gofmt. +; Capturing the label_name (a child, not an ancestor of the labeled body) +; outdents only the label line. +(labeled_statement + (label_name) @outdent) + +; Raw string literals (backticks) span lines and are literal content. +(raw_string_literal) @opaque diff --git a/vendor/queries/html/indents.scm b/vendor/queries/html/indents.scm new file mode 100644 index 00000000..ea83fddd --- /dev/null +++ b/vendor/queries/html/indents.scm @@ -0,0 +1,20 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/html/indents.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +; Indent the contents of an element; pull the end tag — and the close of a +; multi-line start/self-closing tag — back to the element's column. Mirrors the +; jsx rules. Void elements (`
`, ``) are single-line `element`s, so the +; tail-scoped indent is a no-op for them. +[ + (element) + (script_element) + (style_element) +] @indent +(end_tag) @outdent +(start_tag ">" @outdent) +(self_closing_tag "/>" @outdent) + +;