-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript runtime: could the transition classes be exported? #4539
Comments
Mmm... interesting.... |
My understanding of why we have a custom implementation is:
|
Thanks for the explanation. Is this source code accessible ? |
Its not public, but I'm currently checking if I can share it. |
@ericvergnaud I can probably send you the relevant code via email. |
It would definitely. |
@ericvergnaud I've sent you an email to your address from git |
@seb314 I've started implementing a built-in ANTLR solution such that developers don't nee to know about ANTLR internals for computing suggestions. Pair<RuleContext, IntervalSet> getExpectedTokensAt(RuleContext startRuleContext, int line, int column) { .../... } The returned context is the most specific context that contains the token (or last token) at the caret position. From there, it's straightforward to walk the hierarchy of contexts upwards (using the The above assumes all semantic predicates default to true. See PR #4557 |
@seb314 Re 1) i.e. "our desired autocomplete suggestions are not individual tokens, but a sequence of tokens that corresponds to the input consumed by the rule", I have some questions re your example:
|
By "sequence of tokens" I meant: if we are in a
Resolved by the previous point. (Note: we are not using tokens for full paths for some quite specific reasons, but think those reasons are not relevant for the general case.) Re your previous message: I'll first have to dig in a bit and respond in more detail afterwards. |
@ericvergnaud I commented a testcase in #4557 (comment) |
The classes from the
transition/*
subfolder of the javascript runime are not exported in in index.node.js and index.web.js.Is this intentional, or could they be exported similar to e.g. the classes in
atn/*
?Background: we rely on some of the classes in our autocomplete implementation. With antlr4 v4.9.3, we were able to import them via their path, but now that "exports" are configured in antlr's package.json, the imports by path no longer work.
Happy to open a PR if this makes sense.
The text was updated successfully, but these errors were encountered: