mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
tests for forthcoming functionality, cleanup and refactoring
This commit is contained in:
@@ -36,5 +36,8 @@ public interface PyFile extends PyElement, PsiFile, PyDocStringOwner {
|
||||
@return an URL of file, maybe bogus if virtual file is not present.
|
||||
*/
|
||||
@NotNull
|
||||
String getUrl();
|
||||
String getUrl();
|
||||
|
||||
@Nullable
|
||||
PyFunction findTopLevelFunction(String name);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,16 @@ public class PyFileImpl extends PsiFileBase implements PyFile, PyExpression {
|
||||
return fname;
|
||||
}
|
||||
|
||||
public PyFunction findTopLevelFunction(String name) {
|
||||
final List<PyFunction> functions = getTopLevelFunctions();
|
||||
for (PyFunction function : functions) {
|
||||
if (name.equals(function.getName())) {
|
||||
return function;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Icon getIcon(int flags) {
|
||||
return PythonFileType.INSTANCE.getIcon();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user