private List<GoToItem> createGoToItems(PhpModule phpModule, Document doc, int offset) {
List<GoToItem> items = new ArrayList<GoToItem>();
// check whether target is class name
FileObject classFile = getClassFileObject(phpModule, target);
if (classFile != null) {
items.add(new GoToDefaultItem(classFile, DEFAULT_OFFSET));
return items;
}
// get method name
TokenSequence<PHPTokenId> ts = YiiDocUtils.getTokenSequence(doc);
ts.move(offset);
ts.moveNext();
String methodName = getMethodName(ts);
if (!methods.contains(methodName)) {
return items;
}
// for i18n
if (methodName.equals("t")) { // NOI18N
return createGoToTItems(phpModule, ts, offset);
}
// for absolute view path
FileObject file = null;
if (YiiViewPathSupport.isAbsoluteViewPath(target)) {
// for application's view path
FileObject currentFile = NbEditorUtilities.getFileObject(doc);
file = YiiViewPathSupport.getAbsoluteViewFile(target, currentFile);
}
// for path alias
if (file == null) {
file = YiiPathAliasSupport.getFileObject(phpModule, target);
}
if (file != null && file.isData()) {
items.add(new GoToDefaultItem(file, DEFAULT_OFFSET));
}
return items;
}