[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
Re: codeComplete does nothing!
|
Are you sure that there are valid code completions from the point in the
file that matched offset? The completion engine will only return possible
completions visible in the context of "offset". So, for example,
xyz<offset> will only return completions begining with "xyz". Another
example is new <offset> does not provide any completions. You should find
the offset in the file and use normal code complete to see what "normally"
shows up.
-Andrew
"ben cowley" <ben.cowley@xxxxxxxxxx> wrote in message
news:ajvvf2$21v$1@xxxxxxxxxxxxxxxx
> Hi all,
> I'm trying to get context information from the compilation unit in my
> current editor, and I've done
> c.codeComplete(myCompletionRequestor, offset)
> and then tried to get info back from the CompletionRequestor that I
> instantiated. myCompletionRequestor extends CompletionRequestorAdapter and
> basically uses the code from the jdt.ui completion requestor class,
> ResultCollector.
> So I was able to call
> JavaCompletionProposal[] jprop = myCompletionRequestor.getResults()
> but jprop comes back with a length of 0.
> My problem is that Ive looked into getResults() and it is extracting
> information from an array of ArrayList's called fResults. I then went to
> look in codeComplete(), and its super declaration and the important
methods
> called therein, and I cant find where fResults might have been
initialised.
> So the fact that fResults is null for a valid CompilationUnit is what I
need
> to fix, but I need to know how to do that.
>
> Thanks a lot.
>
>