Closed
Description
If I'm typing some QL, and the last characters I wrote were and
or or
, then the autocomplete pops up with a list of candidate predicates and classes containing the respective characters.
This is quite tiring. A few suggested fixes:
- Ensure that
and
oror
is the top autocomplete item - Suppress the autocomplete box if the token is
and
oror
(or indeed any other keyword?) - Make autocomplete context aware. For example,
- if the completion requires a logic operation, do not populate autocomplete with predicates or classes
- if the completion requires a predicate or variable, only populate autocomplete with variables and predicates
- if the completion requires a class name, only populate autocomplete with class names or types.
A few suggestions for making autocomplete context aware:
- Use the parse tree. This probably won't work since the QL parser is dreadful at error recovery.
- If the preceding token is a
(
or a,
, only populate type names - If the preceding token is
{
,|
,=
,and
oror
, only populate predicate names or quantifiers (exists
etc). - If the preceding token is a variable name, or a
)
, only populate logic keywords - If the preceding token is
.
, ideally use the type to guide autocomplete. If not, autocomplete using predicate names. - Otherwise, autocomplete using all things (predicates & types etc).
I'm sure these rules are incomplete, and will need further refinement, but I hope you get the idea.