Autocomplete not working properly

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Autocomplete not working properly

Postby Luiz Fernando » Thu Jul 11, 2013 2:50 pm

Hi,we're using RSyntaxTextArea with Autocomplete on our application.
Some completions are not being shown properly.

For example, we add two variable completions: int foo, int fog.
When user types "f" and press Ctrl+Space, the autocomplete window is not shown.
However, if we remove one of the variables, the window appears normally.

We tought it was because both variables were starting with the same letters, but in some cases the completion works, for example:

int foo and int fog (don't work)
int counter and int columns (works)

So, the problem seems to be very random.
The same problem happens to the template and function completions.

We're following the samples/models on the RSyntaxTextArea source code.
I'll not post any code here for now, but you can take a look (if you want) at: ... ompletion/

Can you please help us?
Luiz Fernando

Re: Autocomplete not working properly

Postby Fillipi Pelz » Thu Jul 11, 2013 11:50 pm


I am a programmer of the same project,

Our language is a Portuguese dialect to use in algorithms courses at our University here in Brazil, and your component are awesome, it is helping us a lot, but we have this situation on the code complete.
The odd behavior are in some character when autocomplete are invoked.


we have some template completions, all are invoked except those that start with 'r' character.

the code below i.e.
Code: Select all
list.add(new TemplateCompletion(cp, "cadeia", "comando","cadeia ${cursor}","Tipo de dado",explicacaoTipoCadeia()));
list.add(new TemplateCompletion(cp, "caracter", "comando","caracter ${cursor}","Tipo de dado",explicacaoTipoCaracter()));
list.add(new TemplateCompletion(cp, "caso","comando","caso ${valor} :\n\t\t${cursor}\n\t\tpare","Instrucao caso",explicacaoComandoCaso()));
list.add(new TemplateCompletion(cp, "casocontrario","comando","caso contrario :\n\t\t${cursor}\n\t\tpare","Caminho alternativo do escolha",explicacaoEstadoContrario()));
list.add(new TemplateCompletion(cp, "const","comando","const ${cursor}","Torna um valor constante",explicacaoDeclaracaoConst()));
list.add(new TemplateCompletion(cp, "real", "comando","real ${cursor}","Tipo de dado",explicacaoTipoReal()));
list.add(new TemplateCompletion(cp, "retorne","comando","retorne ${expressao}","Retorno de funcao",explicacaoComandoRetorne()));

when in the RSyntaxTextArea I press "Ctrl" + "Space" all the completions are listed, and while I write these that start with 'c' the component works well.
but it doesn't work with the 'r' character.
the odd thing is... if I scroll and use the mouse to activate the templates that starts with 'r' it work, the template are write in the textArea.

An odd behavior like that occurs with Variable and Function complete.

when I hit the "Ctrl" + "Space" the variables and functions added dynamically are listed but as soon I start to write the name of the symbol the CodeComplete closes.

I don't have a clue what is happening.

We extended the LanguageAwareCompletionProvider like you did in the RSTALanguageSupport.

thanks for your help.

and sorry if there is grammatical errors, English is not my native language.

Fillipi Pelz
Fillipi Pelz

Re: Autocomplete not working properly

Postby robert » Fri Jul 12, 2013 1:17 pm

Hi guys,

I'm swamped today, but I'll see if I can take a look in a day or two.
User avatar
Posts: 852
Joined: Sat May 10, 2008 5:16 pm

Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest