Closed UliPlabst closed 3 years ago
This is pretty much what was added in 0.15.0—the Markdown parser and stream parser aren't Lezer LR parsers, but do produce Lezer-style trees, expose the same interface, and support incremental parsing using tree fragments as input. Those aren't trivial requirements to support (though you can ignore the last one if you don't care about efficiency on large documents), but they do make it possible to integrate non-Lezer parsers.
Ah ok thanks. I'll have a look at those plugins and see how they expose the ParseTree interface.
I'm trying to integrate the powerquery language for this editor. There already is a great and maintained custom parser running in javascript. I'm wondering if it's at all possible to provide features that need the Ast structure of the current document (like code folding or indentation) without a lezer parser.
It would be nice if the required structure of the Ast would be generic enough so I can transform the ast from the custom parser to fit the interface. From what I see in https://github.com/codemirror/codemirror.next/blob/8e72e5fe722783db55735aaefc739dc13cfbf8b3/language/src/language.ts#L49-L82 it looks like the the logic is tightly coupled with the inner workings of lezer. Is my usecase something you would support? Or maybe there is a workaround that I can use that goes around using the language api? At the moment I can only provide highlighting using the decorators feature.