Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Refactor Timelion expression suggestion logic for clarity. #11285
Extracts some work from #11164.
The current version of this logic involves DOM manipulation from within a directive. We can simplify this by leveraging Angular's directives.
This comment isn't a review of this pull, just a good place to leave some notes about suggestions.
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
referenced this pull request
Apr 17, 2017
@ppisljar Thanks for the review! I addressed your comments. Which browser did you use when you found that select bug? I can't repro in Chrome on OS X. Would you mind checking out 3e53525 and letting me know if the select bug exists in that commit? If so, then it's a pre-existing bug and I think we should mark it in an issue and address it in another PR.