Repository navigation
Releases
v0.13.0 — scandicus-intervals and isolated-strophae rules
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:Notegains a public fieldspaced_before(spacing
connector before the note). Code that buildsNotewith 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-cliFull changelog: v0.12.0...v0.13.0
v0.12.0 — grefmt word-per-line layout + security hardening
What's new
Added
grefmtword-per-line layout (--word-per-line <auto|always|never>, LSP/WASM settingwordPerLine): places each word on its own line, keeping bars and*/**attached to the preceding word. The defaultautomode turns it on when thenabc-linesheader 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-denyaudit against the RustSec advisory database with a license/source policy (deny.toml).SECURITY.mddescribes private vulnerability reporting. - Nix flake:
gregorio-lsp,grelintandgrefmtare exposed as separate packages (gregorio-lspremains the default).
Security
- Updated
tokiofrom 1.52.1 to 1.54.1, fixing RUSTSEC-2026-0386 (AsyncFd::newand 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_groupsno 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 fmtto 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 -- --helpBuilding the WASM module
cd crates/gregorio-wasm
wasm-pack build --target nodejs --releaseFull changelog: v0.11.0...v0.12.0
v0.11.0 — Cargo workspace + gregorio-wasm WASM bindings
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 andwasm32-unknown-unknown.crates/gregorio-server— thegregorio-lspLSP binary (tower-lsp/tokio), unchanged protocol behaviour, now depends ongregorio-core.crates/gregorio-cli—grelintandgrefmtbinaries, now depend ongregorio-core.crates/gregorio-wasm— newcdylib/rlibcrate exposinggregorio-corethroughwasm-bindgenfor in-process use by the VS Code extension.
gregorio-wasmWASM bindings (built withwasm-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. Theu32::MAXsentinel onend_bytesignals "no range / shift entire body".ligatures_to_tags/tags_to_ligatureshelpers ingregorio-core::note_ops: convert betweenæ/ǽ/œUnicode ligatures and<sp>ae</sp>/<sp>'ae</sp>/<sp>oe</sp>XML tags.body_start_byte(text)ingregorio-core::note_ops: returns the byte offset of the first character after the%%header separator.
Changed
- Repository layout: the previous flat
src/tree becomescrates/gregorio-core/src/. All source files are identical;use crate::anduse super::references required no changes. - The
tree-sitterCargo feature is now declared ongregorio-coreand re-exported bygregorio-server.
Installing the LSP binary
cargo install --git https://github.com/AISCGre-BR/gregorio-lsp --tag v0.11.0 --bin gregorio-lspBuilding the WASM module
cd crates/gregorio-wasm
wasm-pack build --target nodejs --releasev0.10.0
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).
- Bar-only groups: lb marker moved to end —
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
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
Fixed
grefmt/format_gabc_text: the line packer now respectsmax_line_widthcorrectly. Two bugs caused lines to exceed the limit:- 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.
- 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
What's changed
Fixed
- LSP formatting default mismatch:
FormattingConfig::default()now derives its values fromFormatOptions::default()instead of hardcodingfalseforbreak_after_clefandbreak_after_bar. Before this fix, editors that didn't sendworkspace/didChangeConfiguration(or sent it before the document was open) would format without blank lines after clefs and bars, inconsistent withgrefmt.
Added
- Nix flake
packages.default:nix build .#now builds all three binaries (gregorio-lsp,grefmt,grelint) viabuildRustPackage, using the samerust-overlaytoolchain as the dev shell. - Example file
examples/prefacio.gabcfor manual testing.
v0.9.1
v0.9.1
Fixed
-
break_after_clef/break_after_barnow default totrue— with both optionsfalse(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_barcorrectly 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
Added
grefmtCLI 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/formatlibrary module:format_gabc_text(text, &FormatOptions) -> String
is the public entry point used by bothgrefmtand the LSP server. The header
section (before%%) is preserved verbatim except for trailing whitespace per line.- LSP
textDocument/formatting: thegregorio-lspserver now advertises and
handles thetextDocument/formattingcapability. Editors that support
format-on-save (Helix, Neovim, VS Code, etc.) will call this handler, which
returns a singleTextEditreplacing the whole document with the formatted text. - Formatter configuration in
workspace/didChangeConfigurationunder the
"formatting"key:maxLineWidth(integer),breakAfterClef(bool),
breakAfterBar(bool). SeeCONFIG.mdfor the full schema.
Full changelog: https://github.com/AISCGre-BR/gregorio-lsp/blob/main/CHANGELOG.md
v0.8.0
v0.8.0
Fixed
- Clippy lint fixes (6 warnings resolved, CI now passes cleanly):
int_remainder_by_odd: replacedseg % period == 0withseg.is_multiple_of(period)innote_ops.rsoption_if_let_else: replaced.map_or(true, |r| r.contains(...))with.is_none_or(...)innote_ops.rsmanual_find: refactored manualforloop intrailing_line_break_markerinto anIterator::findchainneedless_question_mark: removed redundantSome(expr?)inTreeSitterParser::find_node_at(tree-sitter feature)
See CHANGELOG.md for full details.