-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Timelion typeahead for argument names and values #9730
Comments
Copied from #11285 (comment). Timelion's autocomplete has always been one of those "Well, its better than nothing" sort of things. There's a quick digest of how I'd like to see autocompletion work here: https://github.com/cjcenizal/kibana/blob/ed3862e0abb35a2e7e69355d6993a0af166de3ea/src/core_plugins/timelion/public/directives/expression_directive.js#L14-L37 This pull should help with that process as it breaks out the logic for finding and inserting into the helpers file. Just needs someone to sit down and sort it out. Its probably not that hard to implement, the AST already has all of the lookup objects to make determining context for caret position simple.
Basically we just need to take the caret position and compare it to the |
As part of #11164, I'm planning on removing the code stub which partially implements this goal. The code might be useful for when we move forward with this issue, so here it is for future reference: https://github.com/elastic/kibana/blob/5.5/src/core_plugins/timelion/public/directives/expression_directive_helpers.js#L51 |
Additionally here's the original comment which outlined the desired autocomplete behavior: /*
Autocomplete proposal, this file doesn't actually work like this
function names
Do not auto complete .sometext(, rather insert a closing ) whenever a ( is typed.
.| (single dot)
.func|
argument names
We’ll need to sort out which function we’re inside, must be inside a function though
.function(|) // Suggest the first name aka most important arg, e.g. foo=
.function(fo|) // Suggest foo=
.function(foo=|) // Suggest [bar,baz]
.function(arg=bar, |) Suggest 2nd arg name, and so on
argument values
Only named arguments, necessarily provided optional by a plugin.
Must be inside a function, and start must be adjacent to the argument name
.function(arg=b|)
*/ |
Currently only function names are auto-completable, ideally argument name and argument values could be auto completed as well.
Migrated from elastic/timelion#130
The text was updated successfully, but these errors were encountered: