Autocompletion list - keyword and parameters

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Autocompletion list - keyword and parameters

Postby Kuriel » Tue Mar 04, 2014 2:46 pm

Hi Robert,

It's been a while :)

I've gotten things pretty much where I want it to be, but I was wondering how you got entries on the auto-complete list to look like this:

Image

I'm using the DefaultCompletionProvider, passing an .xml file (following the prescribed dtd, of course) for my language. But when I try to change the keyword to include it's parameters (e.g. fabs(double x)), it writes the whole thing into the editor, and parametric auto-completion still triggers properly, although it looks something like function(parameters)(actual parameters).

I have a lot of overloaded methods, and seeing just the keyword on the list isn't too pretty :lol:

Thanks for the help!
Kuriel
 
Posts: 14
Joined: Thu Nov 29, 2012 6:24 am

Re: Autocompletion list - keyword and parameters

Postby Kuriel » Tue Mar 11, 2014 1:13 pm

Edit: It turns out that I seem to need to create a ListCellRenderer for my custom language. I'll dig around for it and come back if I couldn't find anything.

Edit #2: Wow, that was simpler than I thought. Instantiating a new DefaultListCellRenderer is sufficient, for those who want to know what I did.

(Great work as always, Robert!)
Kuriel
 
Posts: 14
Joined: Thu Nov 29, 2012 6:24 am

Re: Autocompletion list - keyword and parameters

Postby robert » Wed Mar 12, 2014 1:30 pm

Hi Kuriel,

Sorry, I somehow missed this topic. Are you saying you had to install a custom renderer to get parameterized completions, such as functions, to work properly? If so, then that bit sounds like a bug.
User avatar
robert
 
Posts: 797
Joined: Sat May 10, 2008 5:16 pm

Re: Autocompletion list - keyword and parameters

Postby Guest » Thu Mar 13, 2014 2:54 pm

Hi Robert,

That's okay, not a problem :)

No, everything worked fine, it's just that the auto completion list's default cell renderer only did function.toString() (I think I read it on something you wrote). When I set the cell renderer to a new DefaultListCellRenderer (kind of ironic :lol:) , it came out the way I wanted it.
Guest
 


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 5 guests

cron