import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
/** Token determines last which declarations are allowed for proposal */
private int fLastSignificantToken;
+ private IProject fProject;
private IFile fFile;
- private String fFileName;
+// private String fFileName;
/**
* Creates the template engine for a particular context type.
* See <code>TemplateContext</code> for supported context types.
*/
- public DeclarationEngine(ContextType contextType, int lastSignificantToken, IFile file) {
+ public DeclarationEngine(IProject project, ContextType contextType, int lastSignificantToken, IFile file) {
// Assert.isNotNull(contextType);
+ fProject = project;
fContextType = contextType;
fLastSignificantToken = lastSignificantToken;
fFile = file;
- if (fFile != null) {
- fFileName = fFile.getFullPath().toString();
- } else {
- fFileName = "";
- }
+// if (fFile != null) {
+// fFileName = fFile.getFullPath().toString();
+// } else {
+// fFileName = "";
+// }
}
/**
if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) {
continue; // for loop
}
- if (!fFileName.equals(location.getFilename())) {
+ break;
+ case ITerminalSymbols.TokenNamethis_PHP_COMPLETION:
+ if (type != PHPIdentifierLocation.METHOD && type != PHPIdentifierLocation.VARIABLE) {
continue; // for loop
}
+ // check all filenames of the subclasses
+// if (!fFileName.equals(location.getFilename())) {
+// continue; // for loop
+// }
break;
case ITerminalSymbols.TokenNamenew :
if (type != PHPIdentifierLocation.CLASS && type != PHPIdentifierLocation.CONSTRUCTOR) {
if (maxProposals-- < 0) {
return;
}
- fProposals.add(new DeclarationProposal(identifier, location, context, region, viewer));
+ fProposals.add( new DeclarationProposal(fProject, identifier, location, context, region, viewer));
}
}
}