-
Notifications
You must be signed in to change notification settings - Fork 16
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
Expose matched rule name #9
Comments
This is pretty cool too: https://github.com/mike-lischke/antlr4-c3 |
I was thinking of doing a slightly different idea for the same purpose, where as part of the configuration for the auto-suggester, the user can provide an optional mapping of token name => callback. So basically it's the same idea, except that we'd be using a callback mechanism, which I think makes the experience more streamlined. |
Hey, I've been playing around with antlr4-c3 more, and it seems to offer the most flexibility to the end user by having a very unopinionated API, and as a result the library is very composable |
I would like this too, I need to provide fuzzy matches for some rules instead of the explicit values. Will look into antlr4-c3 |
I wonder if it's possible to expose the matching rule name as part of the autosuggest API? i.e. Let's consider the following SQL input string that we would like to provide suggestions for:
If we've defined the following grammar:
I can see from where the cursor is, that the grammar would expect parse the
table
rule name next, which happens to be an IDENTIFIER token.Currently if we use this library we'll get given the following autosuggestions list:
This module generates a list of valid identifiers, but if it exposed the matched rule name as part of this module's API, we could see that the matching rule name is
table
, and we could apply our own domain knowledge to provide a richer auto suggestion list, i.e. Looking at the database schema and suggesting the available table names instead of guessing valid identifiers.Let me know your thoughts! 👍
The text was updated successfully, but these errors were encountered: