@codemirror/language
Advanced tools
Changelog
6.9.2 (2023-10-24)
Allow StreamParser
tokens get multiple highlighting tags.
Changelog
6.9.1 (2023-09-20)
Indentation now works a lot better in mixed-language documents that interleave the languages in a complex way.
Code folding is now able to pick the right foldable syntax node when the line end falls in a mixed-parsing language that doesn't match the target node.
Changelog
6.9.0 (2023-08-16)
Make getIndentation
return null, rather than 0, when there is no syntax tree available.
The new preparePlaceholder
option to codeFolding
makes it possible to display contextual information in a folded range placeholder widget.
Changelog
6.8.0 (2023-06-12)
The new baseIndentFor
method in TreeIndentContext
can be used to find the base indentation for an arbitrary node.
Changelog
6.7.0 (2023-05-19)
Export DocInput
class for feeding editor documents to a Lezer parser.
Changelog
6.6.0 (2023-02-13)
Syntax-driven language data queries now support sublanguages, which make it possible to return different data for specific parts of the tree produced by a single language.
Changelog
6.5.0 (2023-02-07)
Make indentation for stream languages more reliable by having StringStream.indentation
return overridden indentations from the indent context.
The toggleFold
command folds or unfolds depending on whether there's an existing folded range on the current line.
indentUnit
now accepts any (repeated) whitespace character, not just spaces and tabs.
Changelog
6.4.0 (2023-01-12)
The bracketMatchingHandle
node prop can now be used to limit bracket matching behavior for larger nodes to a single subnode (for example the tag name of an HTML tag).
Changelog
6.3.2 (2022-12-16)
Fix a bug that caused ensureSyntaxTree
to return incomplete trees when using a viewport-aware parser like StreamLanguage
.
Changelog
6.3.1 (2022-11-14)
Make syntax-based folding include syntax nodes that start right at the end of a line as potential fold targets.
Fix the indentService
protocol to allow a distinction between declining to handle the indentation and returning null to indicate the line has no definite indentation.