Skip to content

LanguageServiceOptions

Defined in: packages/engine/src/language/LanguageService.ts:70

Options for the editor-facing language service: completions and highlighting.

optional normalizeForHighlighting?: boolean;

Defined in: packages/engine/src/language/LanguageService.ts:101

Run the normalizer on the highlighting path, so phrase-fused tokens are classified as the thing the parser will actually see.

Off by default, and the default is a judgement rather than an oversight. Highlighting runs per keystroke, normalization is real work, and a host that is happy with lexer-level categories should not start paying for fusion because a new version shipped. Turn it on and 12/09/2026 is one datetime span instead of five number and operator spans; leave it off and nothing about this class changes.

See benchmarks/languageServiceBenchmarks.spec.ts for what it costs.


optional variableNameSource?: () => Iterable<string>;

Defined in: packages/engine/src/language/LanguageService.ts:86

Overrides how the service discovers “variable names known in this document”, used to legitimize a lone bare identifier line (see getSemanticTokens’s single-token gate) and variable-name completions (getCompletions). Defaults to reading engine.getDag().getSnapshot(), which works for any consumer sharing one ExpressionEngine between evaluation and the language service (the real Obsidian editor).

Required for consumers whose language service is backed by a different, non-evaluating engine than the one that actually runs the document (the playground’s dedicated lexing-only engine, whose own DAG is always empty), pass a function reading the real evaluation engine’s DAG snapshot instead.

Iterable<string>