How to provide a custom AutoComplete backend?

Questions on using RText should go here.

Moderator: robert

How to provide a custom AutoComplete backend?

Postby oskar » Wed Sep 11, 2013 3:51 pm

I'm interested in using the AutoComplete library, but I do not want to provide it with a static list of completions like the example shows. Instead, I would like to use my own custom function that takes the input text and returns a list of completions.

I tried subclassing DefaultCompletionProvider, overriding the getCompletionByInputText method, but it doesn't appear to be called when Ctrl+Space is hit. Is there another way to override the backend in this manner?
oskar
 

Re: How to provide a custom AutoComplete backend?

Postby oskar » Wed Sep 11, 2013 4:35 pm

Looks like I figured it out. I subclassed DefaultCompletionProvider and overrode the getCompletions method.
oskar
 

Re: How to provide a custom AutoComplete backend?

Postby robert » Sat Sep 14, 2013 2:38 am

Glad you're up and running! Another solution is to subclass AbstractCompletionProvider and override getCompletionsImpl() (which you could override when extending DefaultCompletionProvider as well).
User avatar
robert
 
Posts: 760
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron