[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pdt-dev] Re: phar files

hi,roy and everybody

i want to ask if other classes can show in the code assist list in the following condition:

<?php

$a = new My|


it does not work for me.i mean no classes will be popuped!

i debug in the class GlobalTypesStrategy#getTypes


the code many days ago is


ÂÂÂ protected IType[] getTypes(AbstractCompletionContext context) throws BadLocationException {
ÂÂÂ ÂÂÂ int mask = 0;
ÂÂÂ ÂÂÂ if (context.getCompletionRequestor().isContextInformationMode()) {
ÂÂÂ ÂÂÂ ÂÂÂ mask |= CodeAssistUtils.EXACT_NAME;
ÂÂÂ ÂÂÂ }
ÂÂÂ ÂÂÂ String prefix = context.getPrefix();
ÂÂÂ ÂÂÂ if (prefix.startsWith("$")) {
ÂÂÂ ÂÂÂ ÂÂÂ return new IType[0];
ÂÂÂ ÂÂÂ }
ÂÂÂ ÂÂÂ return CodeAssistUtils.getGlobalTypes(context.getSourceModule(), prefix, mask);
ÂÂÂ }



and now


ÂÂÂ protected IType[] getTypes(AbstractCompletionContext context)
ÂÂÂ ÂÂÂ ÂÂÂ throws BadLocationException {

ÂÂÂ ÂÂÂ String prefix = context.getPrefix();
ÂÂÂ ÂÂÂ if (prefix.startsWith("$")) {
ÂÂÂ ÂÂÂ ÂÂÂ return EMPTY;
ÂÂÂ ÂÂÂ }

ÂÂÂ ÂÂÂ IDLTKSearchScope scope = createSearchScope();
ÂÂÂ ÂÂÂ if (context.getCompletionRequestor().isContextInformationMode()) {
ÂÂÂ ÂÂÂ ÂÂÂ return PhpModelAccess.getDefault().findTypes(prefix,
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ MatchRule.EXACT, trueFlag,
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ falseFlag | IPHPModifiers.Internal, scope, null);
ÂÂÂ ÂÂÂ }

ÂÂÂ ÂÂÂ List<IType> result = new LinkedList<IType>();
ÂÂÂ ÂÂÂ if (prefix.length() > 1 && prefix.toUpperCase().equals(prefix)) {
ÂÂÂ ÂÂÂ ÂÂÂ // Search by camel-case
ÂÂÂ ÂÂÂ ÂÂÂ IType[] types = PhpModelAccess.getDefault().findTypes(prefix,
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ MatchRule.CAMEL_CASE, trueFlag,
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ falseFlag | IPHPModifiers.Internal, scope, null);
ÂÂÂ ÂÂÂ ÂÂÂ result.addAll(Arrays.asList(types));
ÂÂÂ ÂÂÂ }
ÂÂÂ ÂÂÂ IType[] types = PhpModelAccess.getDefault().findTypes(prefix,
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ MatchRule.PREFIX, trueFlag, falseFlag | IPHPModifiers.Internal,
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ scope, null);

ÂÂÂ ÂÂÂ result.addAll(Arrays.asList(types));

ÂÂÂ ÂÂÂ return (IType[]) result.toArray(new IType[result.size()]);
ÂÂÂ }

and in the new version code there is always a NullPointerException on the line
result.addAll(Arrays.asList(types));
because
varible types is always null.
IndexerManager.getIndexer()
is always null,because there is no one single extension for org.eclipse.dltk.core.indexer,and there are also no subclass for the abstract class AbstractIndexer no implemention for the interface ISearchEngine.



i want to know if you got the same condition.



or do i miss something?

thanks in advanced.

best regards