foonathan / lexy

C++ parsing DSL
https://lexy.foonathan.net
Boost Software License 1.0
991 stars 66 forks source link

Autocomplete State #130

Open ruler501 opened 1 year ago

ruler501 commented 1 year ago

It would be useful to have a partially written block of text parsed as much as possible and provide information that can be used for autocomplete purposes. For my specific purposes I'm writing a query language that would want to be able to see name= and provide suggestions for the values of names that it sees are possible in the set of values to be searched.

It seems like there might be a way to do it between the tracing api and error recovery api(since the string will probably be only partially complete so invalid in most cases). Any pointers on how to start putting together a proof of concept for this?

foonathan commented 1 year ago

Hm, I'm not quite sure what you want - autocomplete usually requires semantic information, which lexy doesn't have as it's only during parsing.

Can you give a rough sketch of the sort of API you'd like to have?