Skip to content

Releases

v0.13.0 — scandicus-intervals and isolated-strophae rules

Choose a tag to compare

@lbssousa lbssousa released this 17 Nov 21:54
v0.13.0
a06f132

New validation rules

scandicus-intervals (Warning)

Checks the melodic shape of scandicus and salicus.

  • Three notes (a syllable whose GABC notes are exactly three ascending
    notes; connectors /, //, !, `, spaces, @ and accidentals are
    ignored):

    • first → second must not exceed a perfect fifth;
    • second → third must not exceed a third;
    • after a leap of a fourth or fifth, second → third must be a step.

    (dfh), (dgh), (dhi) are accepted; (dgi), (dhj) are flagged.

  • Four notes: only all steps (defg) or a third followed by steps
    (dfgh) are admitted. A connector after the first or second note
    (b/ceof, cd/fg) marks a scandicus composed with another neume, which is
    not checked.

  • Groups with a punctum inclinatum (FHjk) are not a scandicus.

isolated-strophae (Warning)

One or two strophae (st, ds, stst) alone on a syllable in an NABC voice
are flagged, since only three or more are admitted. For two strophae, the
message suggests a virga strata (vs).

Both rules can be silenced with linting.ignoreRules in the LSP settings or
grelint --ignore <code>.

API change

  • gregorio-core: Note gains a public field spaced_before (spacing
    connector before the note). Code that builds Note with struct literals must
    set it.

Install

cargo install --git https://github.com/AISCGre-BR/gregorio-lsp --tag v0.13.0 gregorio-server --bin gregorio-lsp
cargo install --git https://github.com/AISCGre-BR/gregorio-lsp --tag v0.13.0 gregorio-cli

Full changelog: v0.12.0...v0.13.0

v0.12.0 — grefmt word-per-line layout + security hardening

Choose a tag to compare

@lbssousa lbssousa released this 15 Nov 18:41
v0.12.0
c9786f4

What's new

Added

  • grefmt word-per-line layout (--word-per-line <auto|always|never>, LSP/WASM setting wordPerLine): places each word on its own line, keeping bars and * / ** attached to the preceding word. The default auto mode turns it on when the nabc-lines header is 2 or greater (e.g. Graduale Triplex), or when at least 25% of the words are wider than half of the line width. Library API: FormatOptions::word_per_line, WordPerLine::{Auto, Always, Never}.
  • Security workflows: CodeQL (Rust + GitHub Actions), Dependency Review on pull requests, and a daily cargo-deny audit against the RustSec advisory database with a license/source policy (deny.toml). SECURITY.md describes private vulnerability reporting.
  • Nix flake: gregorio-lsp, grelint and grefmt are exposed as separate packages (gregorio-lsp remains the default).

Security

  • Updated tokio from 1.52.1 to 1.54.1, fixing RUSTSEC-2026-0386 (AsyncFd::new and related constructors violate I/O safety).

Fixed

  • shift_notes (Shift Notes Up/Down) no longer transposes letters inside bracketed note attributes ([ll:1], [oh:h], [alt:abc], [cs:…], [nv:…], [nm1], [nocustos]); collective fusions @[…] are still shifted. A | inside an attribute no longer starts a new GABC/NABC segment.
  • fill_empty_groups no longer takes the fill pitch from a letter inside a bracketed attribute (e.g. (f[oh:h]) () → (f[oh:h]) (f)).
  • The note-ops integration tests, orphaned since the workspace restructure, run again (crates/gregorio-core/tests/note_ops.rs).
  • CI lint: fixed Clippy errors and applied cargo fmt to the workspace.

Installing

# LSP server
cargo install --git https://github.com/AISCGre-BR/gregorio-lsp --tag v0.12.0 --bin gregorio-lsp
# CLI tools (grelint, grefmt)
cargo install --git https://github.com/AISCGre-BR/gregorio-lsp --tag v0.12.0 gregorio-cli
# Nix
nix run github:AISCGre-BR/gregorio-lsp/v0.12.0#grefmt -- --help

Building the WASM module

cd crates/gregorio-wasm
wasm-pack build --target nodejs --release

Full changelog: v0.11.0...v0.12.0

v0.11.0 — Cargo workspace + gregorio-wasm WASM bindings

Choose a tag to compare

@lbssousa lbssousa released this 20 Jun 14:41
e3a934b

What's new

Added

  • Cargo workspace (resolver = "2"): the repository is now a multi-crate workspace with four members:
    • crates/gregorio-core — synchronous core library (parser, validator, formatter, note-ops, ligature helpers, body_start_byte). No tokio or tower-lsp dependencies; compiles to both native and wasm32-unknown-unknown.
    • crates/gregorio-server — the gregorio-lsp LSP binary (tower-lsp/tokio), unchanged protocol behaviour, now depends on gregorio-core.
    • crates/gregorio-cli — grelint and grefmt binaries, now depend on gregorio-core.
    • crates/gregorio-wasm — new cdylib/rlib crate exposing gregorio-core through wasm-bindgen for in-process use by the VS Code extension.
  • gregorio-wasm WASM bindings (built with wasm-pack --target nodejs): diagnostics, format, document_symbols, shift_notes_up, shift_notes_down, fill_empty_groups_wasm, ligatures_to_tags, tags_to_ligatures, nabc_lines, body_start_byte. The u32::MAX sentinel on end_byte signals "no range / shift entire body".
  • ligatures_to_tags / tags_to_ligatures helpers in gregorio-core::note_ops: convert between æ/ǽ/œ Unicode ligatures and <sp>ae</sp> / <sp>'ae</sp> / <sp>oe</sp> XML tags.
  • body_start_byte(text) in gregorio-core::note_ops: returns the byte offset of the first character after the %% header separator.

Changed

  • Repository layout: the previous flat src/ tree becomes crates/gregorio-core/src/. All source files are identical; use crate:: and use super:: references required no changes.
  • The tree-sitter Cargo feature is now declared on gregorio-core and re-exported by gregorio-server.

Installing the LSP binary

cargo install --git https://github.com/AISCGre-BR/gregorio-lsp --tag v0.11.0 --bin gregorio-lsp

Building the WASM module

cd crates/gregorio-wasm
wasm-pack build --target nodejs --release

v0.10.0

v0.10.0 Pre-release
Pre-release

Choose a tag to compare

@lbssousa lbssousa released this 18 Jun 11:08
5039cf1

Added

  • New validation rule nabc-space-in-code (warning, auto-fixable): flags whitespace inside NABC code blocks, which Gregorio 6.2.0 renders incorrectly. The autofix removes the spaces.
  • New validation rule bar-mixed-with-notes (warning, auto-fixable): flags GABC bar symbols (,, ;, :, ::) appearing in the same group as melody notes. Custos, line-break markers, and clef changes alongside bars are accepted. The autofix splits the group so each bar is isolated: (fg,hi) → (fg) (,) (hi).
  • New validation rule line-break-not-at-end (warning, auto-fixable): flags any non-whitespace content appearing after a line-break marker (z, Z, z+, z-, Z+, Z-) in a note group. z0 (auto-custos) is not treated as a line break. Two fix strategies:
    • Bar-only groups: lb marker moved to end — (z,) → (,z).
    • Note groups with melody notes: group split at first lb — (fg z h) → (fg z) (h).

Fixed

  • Parser: <v>...</v> and <alt>...</alt> blocks in syllable text no longer cause ( inside to be mis-parsed as a note-group delimiter.
  • Parser: syllables whose text is entirely verbatim no longer trigger false positives in text-markup validation rules (duplicate-syllable-center, unmatched-center-close, etc.).
  • Parser: note attributes with nested brackets ([nv:\cmd[opt]{arg}]) are now parsed correctly using bracket-depth counting.

v0.9.4

v0.9.4 Pre-release
Pre-release

Choose a tag to compare

@lbssousa lbssousa released this 26 May 04:18
v0.9.4
3ae14c0

Fixed

  • grefmt / format_gabc_text: when the token that would be pushed to the start of a new line is a bar ((,), (;), (:), etc.), the packer now wraps the preceding anchor token instead, keeping the bar at the end of the line with its syllable.

    Before:

    … e(gf) jus(fg)to,(g)
    (;)
    

    After:

    … e(gf)
    jus(fg)to,(g) (;)
    

    The fall-back to the old behaviour is preserved when anchor + bar together would exceed max_line_width.

v0.9.3

v0.9.3 Pre-release
Pre-release

Choose a tag to compare

@lbssousa lbssousa released this 26 May 04:06
v0.9.3
6ca39d8

Fixed

  • grefmt / format_gabc_text: the line packer now respects max_line_width correctly. Two bugs caused lines to exceed the limit:
    1. The wrap decision did not account for adjacent (no-space) tokens following a space-separated anchor token; the lookahead now measures the full adjacent group so that an anchor that would push the line over the limit is wrapped to the next line.
    2. Bar and clef tokens were exempt from wrapping even when they would push the current line over the limit; they now wrap like any other token, and the blank-line separator is still emitted after them on their new line.

v0.9.2

v0.9.2 Pre-release
Pre-release

Choose a tag to compare

@lbssousa lbssousa released this 24 May 18:15
v0.9.2
f3fe14f

What's changed

Fixed

  • LSP formatting default mismatch: FormattingConfig::default() now derives its values from FormatOptions::default() instead of hardcoding false for break_after_clef and break_after_bar. Before this fix, editors that didn't send workspace/didChangeConfiguration (or sent it before the document was open) would format without blank lines after clefs and bars, inconsistent with grefmt.

Added

  • Nix flake packages.default: nix build .# now builds all three binaries (gregorio-lsp, grefmt, grelint) via buildRustPackage, using the same rust-overlay toolchain as the dev shell.
  • Example file examples/prefacio.gabc for manual testing.

v0.9.1

v0.9.1 Pre-release
Pre-release

Choose a tag to compare

@lbssousa lbssousa released this 24 May 02:51

v0.9.1

Fixed

  • break_after_clef / break_after_bar now default to true — with both options false (the old default) the formatter packed the entire score onto a single line. The natural default layout is now:

    (c4)
    
    Foo()bar() (;)
    
    ba()oz() (::)
    
  • Adjacent syllables no longer get a space inserted — tokens that had no whitespace between them in the source (e.g. foo()bar()) are now kept adjacent. Previously the packer unconditionally added a space between every pair of tokens.

  • break_after_clef / break_after_bar correctly insert a blank line — an intermediate fix had incorrectly reduced this to a single newline; the correct behaviour (empty line between clef/bar and following music) is restored.

See CHANGELOG.md for full details.

v0.9.0

v0.9.0 Pre-release
Pre-release

Choose a tag to compare

@lbssousa lbssousa released this 23 May 15:41
6a777ff

Added

  • grefmt CLI formatter (src/bin/grefmt.rs): a new standalone binary that
    formats GABC source files.
    • -w/--width <n>: maximum output line width (default: 80). The formatter
      re-flows the notation body so that no source line exceeds this limit; existing
      inter-syllable whitespace (including newlines) is replaced by the packer's
      output. Content inside parentheses is never modified.
    • --break-after-clef: inserts a blank line after each clef token (e.g. (c4)).
    • --break-after-bar: inserts a blank line after each bar token (,, ;, :,
      ::, etc.).
    • -c/--check: exits with code 1 if any file would change without writing
      anything; useful for CI checks.
    • -i/--in-place: writes formatted output back to each file.
    • Reads from stdin / writes to stdout when no files are given.
  • src/format library module: format_gabc_text(text, &FormatOptions) -> String
    is the public entry point used by both grefmt and the LSP server. The header
    section (before %%) is preserved verbatim except for trailing whitespace per line.
  • LSP textDocument/formatting: the gregorio-lsp server now advertises and
    handles the textDocument/formatting capability. Editors that support
    format-on-save (Helix, Neovim, VS Code, etc.) will call this handler, which
    returns a single TextEdit replacing the whole document with the formatted text.
  • Formatter configuration in workspace/didChangeConfiguration under the
    "formatting" key: maxLineWidth (integer), breakAfterClef (bool),
    breakAfterBar (bool). See CONFIG.md for the full schema.

Full changelog: https://github.com/AISCGre-BR/gregorio-lsp/blob/main/CHANGELOG.md

v0.8.0

v0.8.0 Pre-release
Pre-release

Choose a tag to compare

@lbssousa lbssousa released this 17 May 22:39
950cee6

v0.8.0

Fixed

  • Clippy lint fixes (6 warnings resolved, CI now passes cleanly):
    • int_remainder_by_odd: replaced seg % period == 0 with seg.is_multiple_of(period) in note_ops.rs
    • option_if_let_else: replaced .map_or(true, |r| r.contains(...)) with .is_none_or(...) in note_ops.rs
    • manual_find: refactored manual for loop in trailing_line_break_marker into an Iterator::find chain
    • needless_question_mark: removed redundant Some(expr?) in TreeSitterParser::find_node_at (tree-sitter feature)

See CHANGELOG.md for full details.