Autocomplete sublist of provider

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Autocomplete sublist of provider

Postby John Lindsay » Sun Aug 18, 2013 6:46 pm

Hello,

I'm just started playing around with the rsyntaxtextarea and autocompletion libraries in order to add IDE-like functionality to the scripting that I have incorporate into my desktop application. First, thank you very much for creating these extremely useful libraries. I feel like I am perhaps missing something in my implementation. I would like it so that when the user types in a partial word (variable name, import statement, etc.) only the subset of the completions in the provider that could possibly satisfy the partially typed portion are shown. I've seen the getAlreadyEnteredText method, which makes me feel like the functionality is there, but I'm just missing whatever it is that performs this sub-selection based on the already entered text. Can you help please?

Regards,

John
John Lindsay
 

Re: Autocomplete sublist of provider

Postby John Lindsay » Sun Aug 18, 2013 7:21 pm

Silly me, I've figured it out. I just needed to subclass the DefaultCompletionProvider and override the isValid method to accept '.' characters. That way as you type in a package name the part of the text before the '.' is recognized.
John Lindsay
 


Return to Help

Who is online

Users browsing this forum: No registered users and 3 guests