
Syntax highlighting and editing support for FSON — the hand-editable configuration notation used by the FFS project. FSON is a pragmatic superset of JSON5 that adds nested block comments, a narrower bare-key grammar, -- disabled members, %include directives, and |-block multi-line strings.
source.fson):// line and nested /* … */ block comments|-block strings, with escape sequences0xFF), Infinity / NaN, leading/trailing-dot formstrue / false / null%include … as directives-- disabled members (dimmable via the keyword.operator.disabled.fson scope){}, [], "", ''wordPattern that matches FSON's narrow bare-key grammarMarketplace (publisher Fedem): search FSON in the Extensions view, or
code --install-extension Fedem.vscode-fson
From a .vsix (e.g. the one hosted on <https://fson.fedem.eu>): download it, then either
code --install-extension vscode-fson-<version>.vsix
or, in VS Code, open the Extensions view → ⋯ menu → Install from VSIX… and pick the file.
For development, open this folder in VS Code and press <kbd>F5</kbd> to launch an Extension Development Host, then open any .fson file.
Open a .fson file and run Developer: Inspect Editor Tokens and Scopes from the Command Palette to see the TextMate scope under the cursor.
The extension registers a document formatter for .fson files — use Format Document (or format-on-save) as usual. The formatter is a faithful JavaScript port of FFS's canonical FSON writer, so its output matches what the FFS fson library itself would produce:
key: value with a single space after :-- disabled members, %include directives, |-block multi-line strings, and the exact spelling of each number (0xFF stays 0xFF, 1.50 stays 1.50, Infinity stays Infinity) are all preserved{} / []) unless they carry comments\uXXXX escapes) is decoded and passed through — e.g. "\u00FC" becomes "ü"If the document contains parse errors, the formatter declines to run (so a half-typed file is never mangled) and shows a warning.
fson.format.preferBareKeys (default false) — when on, quoted keys are rewritten without quotes wherever the name satisfies the FSON bare-name grammar (host, maxRetries, a_1_b2). Off by default to preserve the author's chosen key style.|-block is highlighted as a single string; Markdown embedded inside it is intentionally not separately highlighted.name production, not JSON5's IdentifierName — keys like $foo, _x, name_, or a__b must be quoted. The exact production is: name = [A-Za-z] ( _? [A-Za-z0-9] )*
npm install
npm test # formatter tests + inline scope tests + corpus snapshots
npm run test:formatter # formatter golden + corpus idempotency only
npm run test:update # regenerate corpus snapshots after grammar changes
Grammar tests use vscode-tmgrammar-test over the project's real corpus/fson/ files. The formatter (formatter/) is validated against golden cases derived from FFS's own FsonWriterTests and checked for idempotency on the corpus.
MIT