}
@Override
public List<GoToItem> getSmart() {
FileObject currentFile = getCurrentFile();
FuelPhpModule fuelModule = FuelPhpModule.forPhpModule(getPhpModule());
DIR_TYPE dirType = fuelModule.getDirType(currentFile);
String dirName = ""; // NOI18N
if (dirType == DIR_TYPE.MODULES) {
dirName = fuelModule.getModuleName(currentFile);
} else if (dirType == DIR_TYPE.PACKAGES) {
dirName = fuelModule.getPackageName(currentFile);
}
String path = currentFile.getPath();
String relativePath = ""; // NOI18N
int index;
List<String> dirNames = Arrays.asList("/controller/", "/model/", "/view/"); // NOI18N
for (String name : dirNames) {
index = path.indexOf(name); // NOI18N
if (index > 0) {
relativePath = "classes/" + path.substring(index); // NOI18N
break;
}
}
FileObject baseDirectory = fuelModule.getDirectory(dirType, FILE_TYPE.NONE, dirName);
if (baseDirectory == null) {
return Collections.emptyList();
}
FileObject target = baseDirectory.getFileObject(relativePath);
if (target == null) {