"No suggestions" for basic completion in custom language

I have a PsiReference implementation which returns an array of PsiClass
objects from getVariants(). However, invoking Basic Completion inside
the PsiReference just shows the "No suggestions" popup.

I've tried an implementation of getVariants() which uses
SearchHelper.processAllClasses() to get a list of the PsiClass elements
which match the reference's text (terminated at 'IntellijIdeaRulezzz').
I've also tried an implementation of getVariants() which just returns
the result of SearchHelper.findAllClasses(refElement.getResolveScope()).

Thanks,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

2 comments

Gordon Tyler wrote:

I have a PsiReference implementation which returns an array of PsiClass
objects from getVariants(). However, invoking Basic Completion inside
the PsiReference just shows the "No suggestions" popup.

I've tried an implementation of getVariants() which uses
SearchHelper.processAllClasses() to get a list of the PsiClass elements
which match the reference's text (terminated at 'IntellijIdeaRulezzz').
I've also tried an implementation of getVariants() which just returns
the result of SearchHelper.findAllClasses(refElement.getResolveScope()).

Thanks,
Gordon


The trick is, don't match the string at all. Return all resolvable classes. This
is how getVariants is intended to work.

0

Keith Lea wrote:

The trick is, don't match the string at all. Return all resolvable
classes. This is how getVariants is intended to work.


That's what my implementation using SearchHelper.findAllClasses() did (I
think). It didn't work either. Anyhow, now that I have confirmation of
how getVariants is supposed to work (the Javadoc could be a bit clearer
in this regard), I'll play around with it a bit more. Maybe
findAllClasses() is not working as I expect it to or something.

Thanks,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0

Please sign in to leave a comment.