@codemirror/language
Advanced tools
Changelog
0.19.3 (2021-09-13)
Fix an issue where a parse that skipped content with skipUntilInView
would in some cases not be restarted when the range came into view.
Changelog
0.19.2 (2021-08-11)
Fix a bug that caused indentOnInput
to fire for the wrong kinds of transactions.
Fix a bug that could cause indentOnInput
to apply its changes incorrectly.
Changelog
0.19.0 (2021-08-11)
CodeMirror now uses lezer 0.15, which means different package names (scoped with @lezer) and some breaking changes in the library.
EditorParseContext
is now called ParseContext
. It is no longer passed to parsers, but must be retrieved with ParseContext.get
.
IndentContext.lineIndent
now takes a position, not a Line
object, as argument.
LezerLanguage
was renamed to LRLanguage
(because all languages must emit Lezer-style trees, the name was misleading).
Language.parseString
no longer exists. You can just call .parser.parse(...)
instead.
New IndentContext.lineAt
method to access lines in a way that is aware of simulated line breaks.
IndentContext
now provides a simulatedBreak
property through which client code can query whether the context has a simulated line break.
Changelog
0.18.2 (2021-06-01)
Fix an issue where asynchronous re-parsing (with dynamically loaded languages) sometimes failed to fully happen.
Changelog
0.18.1 (2021-03-31)
EditorParseContext.getSkippingParser
now replaces EditorParseContext.skippingParser
and allows you to provide a promise that'll cause parsing to start again. (The old property remains available until the next major release.)
Fix an issue where nested parsers could see past the end of the nested region.
Changelog
0.18.0 (2021-03-03)
Update dependencies to 0.18.
The Language
constructor takes an additional argument that provides the top node type.
Language
instances now have a topNode
property giving their top node type.
TreeIndentContext
now has a continue
method that allows an indenter to defer to the indentation of the parent nodes.
Changelog
0.17.5 (2021-02-19)
This package now exports a foldInside
helper function, a fold function that should work for most delimited node types.