Access to editorState or full text in StreamParser

Given the same use case as in my previous topic. I’m currently upgrading from CodeMirror 5 to 6. The custom DSLs that we are using are complex in terms of syntax highlighting and autocompletions, and because I’m not quite prepared yet to invest the significant effort to convert these languages to Lezer, I’m gratefully making using of StreamLanguage to keep time and effort under control.

One issue I’m running in is that there seems to be no way to access the full text of the current codemirror instance from within the StreamParser#token method; only the current line. I can see that the method parseLine does have access to the full text, but does not pass it on to the readToken and token method.

There are a few cases where I need the full text, where it doesn’t appear feasible to keep track of things via the state.

Would you consider given access to the parse context (which gives access to the full text) in the token method? Alternatively, passing the editorState to startState would also work, and might be even better.

No—that would mean partial parses cannot be reused when the state changes. The whole idea here is that these only consume the lines they are parsing, and nothing more.