antlr4-c3 icon indicating copy to clipboard operation
antlr4-c3 copied to clipboard

No way to get starting candidates on empty input

Open unsupervisednn opened this issue 4 years ago • 2 comments

Without suppling input I would like to get valid candidates for completion. The current way with parser.collectCandidates(tokenIndex) requires that there be a token index which doesn't exist for the empty string.

unsupervisednn avatar Jan 27 '20 22:01 unsupervisednn

Can't you pass -1 as the token index?

alessiostalla avatar Feb 18 '21 16:02 alessiostalla

-1 will not work, but 0 should. There's always at least one token in the token stream (EOF).

mike-lischke avatar Feb 18 '21 16:02 mike-lischke