elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.69k stars 8.12k forks source link

[ES|QL] improve support for "invoke" autocomplete triggers #188677

Closed drewdaemon closed 1 month ago

drewdaemon commented 1 month ago

Describe the feature: In some cases, our autocomplete refuses to produce suggestions when a user starts or continues typing a word. It can also appear not to take into account the characters that have already been typed in the current word. A user must often delete one or more characters and press the space bar to get the suggestions menu open again.

https://github.com/user-attachments/assets/f12ff0ae-6b2f-47f5-9fc1-37555308ab95

This is confusing behavior and often leaves the user without good suggestions.

Why this happens

Monaco produces suggestions based on various events. Two kinds of events are "Invoke" and "Trigger character" (ref). "Trigger character" means the user enters one of a set of special characters we have configured to pop the suggestions menu open (e.g. ' '). "Invoke" means the user simply starts typing a word.

The inconsistencies in our autocomplete behavior are largely symptomatic of spotty support for "Invoke" style events.

Invoke (0) Trigger character (1)
Source command
Pipe command
Function argument
FROM source
FROM source METADATA
FROM source METADATA field ❌ (for _)
EVAL argument
DISSECT field
DISSECT field pattern
DROP (first field)
DROP (subsequent fields)
ENRICH policy
ENRICH policy ON
ENRICH policy ON field
ENRICH policy WITH
ENRICH policy WITH field
GROK field
GROK field pattern
KEEP field
KEEP field1, field2
LIMIT number
MV_EXPAND field
RENAME field
RENAME field AS
RENAME field AS var0
SORT field
SORT field order
SORT field order nulls-order
STATS argument
STATS argument BY
STATS argument BY expression
WHERE argument
WHERE argument comparison ✅ (partial, not with special characters)
elasticmachine commented 1 month ago

Pinging @elastic/kibana-esql (Team:ESQL)