Sieve Complete — Syntax Highlighting and FormatterA VS Code extension that provides syntax highlighting and auto-formatting for Sieve email filter scripts — useful if you manage Proton Mail rules (or any other Sieve-based filter system) in a git repository. FeaturesSyntax highlightingFull TextMate grammar covering:
Trailing comma removalRemoves trailing commas from string lists so you don't have to think about them while writing rules:
Multi-line list expansionLists with 2 or more items are automatically expanded to one-item-per-line, making git diffs much cleaner:
Block indentationRe-indents
Interior lines of
|
| Setting | Default | Description |
|---|---|---|
sieve.formatter.expandLists |
true |
Expand string lists with 2 or more items to one-item-per-line, and normalise indentation of already-multi-line lists. Disable to leave all list formatting untouched. |
sieve.formatter.alwaysExpandRequire |
false |
Apply the same expansion rule to require [...]. Single-item require is never expanded. Has no effect when expandLists is disabled. |
sieve.formatter.indentBlocks |
true |
Re-indent the contents of if, elsif, and else blocks based on brace nesting depth. |
sieve.formatter.joinElsifElse |
true |
Join a lone } line with a following elsif or else onto the same line. |
sieve.formatter.normalizeBlankLines |
true |
Collapse runs of more than one consecutive blank line into a single blank line. |
sieve.formatter.sortRequire |
false |
Sort extensions inside require [...] alphabetically. Has no effect on a bare require "string" or a single-extension list. |
The indentation inside expanded lists and block bodies respects your VS Code editor settings (spaces vs. tabs, tab size).
Usage
- Install the extension
- Open a
.sievefile - Format with
Shift+Alt+F(or enable Format On Save in VS Code settings)
Development
See CLAUDE.md for full development guidance. Quick start:
npm install
npm run compile # build
npm test # run unit tests
npm run lint # lint
Press F5 to launch an Extension Development Host with the extension loaded.