Skip to content
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

Not autosuggesting the values after brute force #14

Open
albanx opened this issue Feb 14, 2022 · 0 comments
Open

Not autosuggesting the values after brute force #14

albanx opened this issue Feb 14, 2022 · 0 comments

Comments

@albanx
Copy link

albanx commented Feb 14, 2022

Thanks again for this code it is really great.

I am having an issue integrating it with my local JS parser (using ANLTR4 4.9.3).

I have a SQL like grammar (sort of subset). When I run the autosuggest it starts doing a sort of brute force and at the end it does not find the property autosuggest value. For example when I start typing S for SELECT this is what I see in the console.log:

....
SUGGEST: tokenSoFar=DESCH remainingText= lexerState=131
debug.js?c20a:2 SUGGEST: tokenSoFar=DESCH remainingText= lexerState=63
debug.js?c20a:2 SUGGEST: tokenSoFar=DESCH remainingText= lexerState=137
debug.js?c20a:2 SUGGEST: tokenSoFar=DESCH remainingText= lexerState=63
debug.js?c20a:2 SUGGEST: tokenSoFar=DESC remainingText= lexerState=169
debug.js?c20a:2 SUGGEST: tokenSoFar=DESC remainingText= lexerState=28
debug.js?c20a:2 SUGGEST: tokenSoFar=DESC remainingText= lexerState=174
debug.js?c20a:2 SUGGEST: tokenSoFar=DESC remainingText= lexerState=30
debug.js?c20a:2       Not following visited 58->(1) 9
debug.js?c20a:2       Not following visited 109->(1) 29
debug.js?c20a:2       Not following visited 58->(1) 9
debug.js?c20a:2       Not following visited 109->(1) 29
debug.js?c20a:2 DROPPING non-parseable suggestion: GROM
debug.js?c20a:2 DROPPING non-parseable suggestion: GROMA
debug.js?c20a:2 DROPPING non-parseable suggestion: GROMAND
debug.js?c20a:2 DROPPING non-parseable suggestion: GROMANDELIT
debug.js?c20a:2 DROPPING non-parseable suggestion: GROMANDECT
debug.js?c20a:2 DROPPING non-parseable suggestion: GROMANDEC
debug.js?c20a:2 DROPPING non-parseable suggestion: GROMANDE
....

At the end autosuggests only:

['=', '!=', ')', ',']

Cannot understand if the issue is in the lexer definition or if I am doing something wrong. Would be great if I can have some help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant