getVariants() -- how are the matching candidates found

I got this working most time by return PsiElement or Strings.
But still the internal matchign algorithm is hidden.
Having an reference I return both, a member field and a constant.
public String field1;
public static final String constant1="";
in getVariants() I return both fields.
But the popup for auto-completion only shows the members. So the
static stuff is somehow filtered out.
Same applies to static methods.

So how do I get this working?

6 comments
Comment actions Permalink

What is the prefix for the completion?

Sven Steiniger wrote:

I got this working most time by return PsiElement or Strings.
But still the internal matchign algorithm is hidden.
Having an reference I return both, a member field and a constant.
public String field1;
public static final String constant1="";
in getVariants() I return both fields.
But the popup for auto-completion only shows the members. So the
static stuff is somehow filtered out.
Same applies to static methods.

So how do I get this working?



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Empty string.

Maxim Mossienko schrieb:

What is the prefix for the completion?

Sven Steiniger wrote:

>> I got this working most time by return PsiElement or Strings.
>> But still the internal matchign algorithm is hidden.
>> Having an reference I return both, a member field and a constant.
>> public String field1;
>> public static final String constant1="";
>> in getVariants() I return both fields.
>> But the popup for auto-completion only shows the members. So the
>> static stuff is somehow filtered out.
>> Same applies to static methods.
>>
>> So how do I get this working?


0
Comment actions Permalink

Any comments?
I have installed an own CompletionData which derives from
HtmlCompletionData. So from debugging I know that
findPrefix() returns "".

Sven Steiniger schrieb:

Empty string.

Maxim Mossienko schrieb:

>> What is the prefix for the completion?
>>
>> Sven Steiniger wrote:
>>
>>> I got this working most time by return PsiElement or Strings.
>>> But still the internal matchign algorithm is hidden.
>>> Having an reference I return both, a member field and a constant.
>>> public String field1;
>>> public static final String constant1="";
>>> in getVariants() I return both fields.
>>> But the popup for auto-completion only shows the members. So the
>>> static stuff is somehow filtered out.
>>> Same applies to static methods.
>>>
>>> So how do I get this working?
>>
>>
>>
>>

0
Comment actions Permalink

Hi,

Maybe your settings have not set 'Show statics after instance'
completion option and completion filters it out then (pretty weird side
effect for custom completion data).

Sven Steiniger wrote:

Any comments?
I have installed an own CompletionData which derives from
HtmlCompletionData. So from debugging I know that
findPrefix() returns "".

Sven Steiniger schrieb:

>> Empty string.
>>
>> Maxim Mossienko schrieb:
>>
>>> What is the prefix for the completion?
>>>
>>> Sven Steiniger wrote:
>>>
>>>> I got this working most time by return PsiElement or Strings.
>>>> But still the internal matchign algorithm is hidden.
>>>> Having an reference I return both, a member field and a constant.
>>>> public String field1;
>>>> public static final String constant1="";
>>>> in getVariants() I return both fields.
>>>> But the popup for auto-completion only shows the members. So the
>>>> static stuff is somehow filtered out.
>>>> Same applies to static methods.
>>>>
>>>> So how do I get this working?
>>>
>>>
>>>
>>>
>>>


--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Yes, that's it. But why is it applied? It always occurs, no matter
if there is a dot in front of it or if the previous expression just
resolves to PsiClass.
How can I change this behaviour?
I remember having seen some event somewhere. But don't remember where
and don't know how to fire.

Maxim Mossienko schrieb:

Hi,

Maybe your settings have not set 'Show statics after instance'
completion option and completion filters it out then (pretty weird side
effect for custom completion data).

Sven Steiniger wrote:

>> Any comments?
>> I have installed an own CompletionData which derives from
>> HtmlCompletionData. So from debugging I know that
>> findPrefix() returns "".
>>
>> Sven Steiniger schrieb:
>>
>>> Empty string.
>>>
>>> Maxim Mossienko schrieb:
>>>
>>>> What is the prefix for the completion?
>>>>
>>>> Sven Steiniger wrote:
>>>>
>>>>> I got this working most time by return PsiElement or Strings.
>>>>> But still the internal matchign algorithm is hidden.
>>>>> Having an reference I return both, a member field and a constant.
>>>>> public String field1;
>>>>> public static final String constant1="";
>>>>> in getVariants() I return both fields.
>>>>> But the popup for auto-completion only shows the members. So the
>>>>> static stuff is somehow filtered out.
>>>>> Same applies to static methods.
>>>>>
>>>>> So how do I get this working?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>


0
Comment actions Permalink

Field http://www.jetbrains.net/jira/browse/IDEA-5554

Sven Steiniger schrieb:

Yes, that's it. But why is it applied? It always occurs, no matter
if there is a dot in front of it or if the previous expression just
resolves to PsiClass.
How can I change this behaviour?
I remember having seen some event somewhere. But don't remember where
and don't know how to fire.

Maxim Mossienko schrieb:

>> Hi,
>>
>> Maybe your settings have not set 'Show statics after instance'
>> completion option and completion filters it out then (pretty weird
>> side effect for custom completion data).

0

Please sign in to leave a comment.