Are there any plans to support Twig and Yaml lang modes in CM6?

Will those be part of @codemirror/lang-* scope?

I don’t have plans to write them, but the nice thing about language modes being separate packages is that other people can provide them. (Yaml exists in the legacy mode package).

1 Like

@marijn Can you clarify on the legacy modes? How do they differ from extensions based on Lezer?
Is the latter supposed to replace them eventually?

They are basically the old CodeMirror mode code, which can be used with the @codemirror/stream-parser adapter to get basic language support. Lezer modes are preferable, in that they will be faster and support a bunch of features like code folding and syntax-aware navigation that are hard to provide with a flat token stream. But since it’ll probably be a while before Lezer grammars exist for all those languages, these are intended to provide at least some support.

1 Like

Thanks! The yaml mode is working flawlessly. Except I’m not able to style the initial ---. The source code says token: "def" but the tags enum don’t have this value. Tried with the most logical choice tags.contentSeparator but it is ignored. Should I open an issue?

The stream parser maps def to tag.definition(tag.variableName) (which isn’t very appropriate in this case, but that’s due to the legacy layering and the abuse of token types in the original Yaml mode implementation).