-
Notifications
You must be signed in to change notification settings - Fork 59
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
request for collectCandidates work even if there is syntax error #29
Comments
The problem is: what path should the walker take then? If the syntax is not correct before the caret there's no way to even find a path to the Your request is impossible to implement. Note: already the existing approach is sometimes consuming too much time and I had to apply several optimizations to make it passably work. |
Yes, you are right. I tried implemented a different version of |
ANTL4's error strategy is to try re-synching the ATN walk to the actual input. However, that goes only so far to find either a single additional token or a single missing token. This won't help in this scenario, which would require to (theoretically) skip an unknown number of tokens and resynch. |
Very appreciate about the work! I came across a problem and believe walker should have ability to go further even if there is syntax error before caret position. Suppose I have defined mysql grammar. And editing the following sentence,
where
'|'
represents caret position and it will get nothing by callingcollectCandidates
. Well, I can still do a little work to make it work. But It is also reasonable the walker keep walking if there is potential road to current request position. And I believe this is achievable by search algorithm like A-star. When walker walked toselect
and find no bridge tofrom
, it search all neighbor rules until it finally reachfrom
. And this search should be constrained because it maybe very time-consuming.Is it make sense? Thanks!
The text was updated successfully, but these errors were encountered: