I'm looking to have filters implemented in a completion session by separating items into 'Suggested' and 'All'. My scenario is a SQL editor, and, for example, after the keyword SELECT I want to pop up a suggested list of tables/views, with other things such as built-in functions on the 'All' tab. It's important to me that people can use camelhumps as well as substring matches - so being able to type 'tilc' for TransactionItemLookupCodes or 'LookupCodes' for the same result. So I enabled both UseAcronyms and UseShorthand in the MatchOptions for the completion session.
Currently, if I type 'DATEADD' then I get 'database_audit_specification_details' - and what I wanted was the 'DATEADD' entry on the 'All' list.
So - a couple of specific questions:
1) Does it match that entry because shorthand translates to a regex like '.*h.*e.*l.*l.*o.*' for the text 'hello' rather than '.*hello.*'? If so I am guessing I can just implement a custom filter that allows substring matches without allowing characters in between.
2) Is there any way that I can switch between tabs at runtime so that if a user begins typing something that is on the 'all' list then the UI changes and an item from the 'all' list is selected? I thought maybe the right way to go about that would be inheriting from CompletionSession, checking if there is a match in the 'suggested' list currently, and flipping to the 'all' list if any of the matchers would match an item in there.
3) In the above scenario - when I have typed 'DATEADD' and then manually click on 'All' - the list is scrolled so that the currently selected item isn't visible - and it becomes visible after a keypress. Is there anything I can do about that?
Thanks in advance, and please let me know if I haven't explained anything clearly enough...
Matt