Code View

fson / vscode-fson / extension / CHANGELOG.md
Preview
# Changelog — FSON for VS Code

## 0.10.0 — Disabled content: own color, and |-block-valued members fixed

Two fixes on top of 0.9.0:

- **`--key:` whose value is a `|`-block** (e.g. `--description:` followed by
  `|`-lines) was only dimming the `--key:` line; the block value lines
  stayed normal. Now the whole disabled member — the `--key:` line and all
  following `|` value lines — is dimmed as one region, ending correctly at
  the next normal member.
- **Disabled content now has its own color** instead of borrowing the
  comment color. Disabled regions are scoped `markup.disabled.fson`, and the
  extension ships a default token color for it — soft green `#acdea9`,
  italic — so it is visibly distinct from comments in every theme, with no
  user settings required. You can override it by targeting
  `markup.disabled.fson` in `editor.tokenColorCustomizations`.


## 0.9.0 — Disabled content now dims in every theme

Follow-up to 0.8.0. The 0.8.0 fix scoped disabled content with
`markup.strikethrough`, but many themes do not style that scope, and the
key/value kept their own (more specific) scopes on top — so disabled
members/blocks still looked unchanged in most themes.

Now each disabled region (member, keyless `--|` block, `%include`) is
scoped as `comment.block.disabled.fson` with no competing inner scopes, so
the whole construct takes the theme's comment color (dimmed/grey) in every
theme, with no user settings required. Disabled regions still end correctly
and do not leak into the following normal member or block.


## 0.8.0 — Disabled members and blocks are now visibly dimmed

Fix: a `--` disabled member and a keyless `--|` disabled multi-line block
were highlighted the same as normal content — only the `--` glyph was
marked, so a disabled block looked identical to an ordinary `|`-block and a
`--key:` member looked like a normal member.

Now the WHOLE disabled construct is wrapped in a disabled scope
(`meta.disabled.*.fson` + `markup.strikethrough`) so themes render it as
struck-through / removed:

- `--key: value` — the entire member (key, colon, value) is dimmed.
- `--|line` … `|line` — the opening line AND every following `|`
  continuation line are dimmed as one region; the block still ends
  correctly at the next non-`|` line, so following members are unaffected.
- `--%include …` — the whole directive is dimmed.

The key/value keep their own scopes underneath, so structure is still
visible. Verified: disabled scopes do not leak into the following normal
member or block. `npm test` green.

## 0.5.0 — Canonical formatter

Add a document formatter for `.fson` files (Format Document / format on
save). It is a faithful JavaScript port of FFS's canonical FsonWriter
(Fson dialect): the whole document is parsed into a model with attached
comments, then re-emitted canonically, losing nothing.

- 2-space indent, one member/element per line, `key: value` spacing
- preserves comments (header, leading, trailing, dangling, footer, nested
  block comments), `--` disabled members, `%include` directives, `|`-block
  strings, and exact number lexemes (hex/Infinity/NaN/`1.50` verbatim)
- empty containers stay compact unless they carry comments
- strings re-emitted double-quoted, mandatory escapes only, `\uXXXX`
  decoded to raw UTF-8
- idempotent: formatting an already-formatted file is a no-op
- declines to format a document with parse errors (never mangles a
  half-typed file)
- new setting `fson.format.preferBareKeys` (default off)

Validation: golden cases derived from FFS's FsonWriterTests (including the
comprehensive round-trip case) plus corpus idempotency — `npm test` green.

All notable changes to the FSON VS Code extension.

## 0.3.0 — Initial release

Syntax highlighting and editing support for `.fson` files.

- TextMate grammar (`source.fson`) implementing the spec/fson/TOKENS.md
  contract: nested block comments (recursive `#block-comment` include),
  the narrow bare-key `name` grammar, `--` disabled members/directives/
  keyless `|`-lines, `%include`/`as` directives, quoted and `|`-block
  strings (begin/while) with escapes, and all number forms (hex, `.5`,
  `5.`, exponent, `Infinity`, `NaN`).
- Language configuration: `//` and `/* */` comments, bracket matching and
  auto-closing for `{}` `[]` `""` `''`, and a `wordPattern` consistent
  with the bare-key grammar.
- Tests: inline scope assertions plus snapshot tests over all six
  corpus/fson/*.fson files (vscode-tmgrammar-test).

Highlight-only; a round-trip-preserving formatter is planned for a later
version.

Scope: `|`-block content is a single string; embedded Markdown is not
separately highlighted.