PHP: context for completion when document is invalid

David nolden david.nolden.kdevelop at art-master.de
Thu Feb 5 21:36:01 UTC 2009


Am Donnerstag 05 Februar 2009 22:23:54 schrieb Milian Wolff:
> So the main issue: Why is top->findContextAt not finding a proper context?
> This is only happening if the document could not be parsed due to errors.
> So is the PHP language plugin doing something wrong? The Cpp plugin works
> fine without overloading completionInvokedInternal - what does it do
> differently?
>
> And: could we not fallback to the top-context if findContextAt cannot get a
> proper context? Otoh: shouldn't it at least return the top context?
Looking at the code of findContextAt, it only returns zero if the top-context 
does not contain the position.

So the question is why this happens. Maybe you're making the range of the top-
context too small.

But I think I will add a workaround to completionInvokedInternal for this, 
since this also is a problem in C++ when the cursor is in exactly the last 
position of the document.

Greetings, David





More information about the KDevelop-devel mailing list