improve and simplify "auto-import via existing import statement" logic

This commit is contained in:
Dmitry Jemerov
2012-08-16 12:06:42 +02:00
parent 51428d5299
commit 357de3d405
6 changed files with 80 additions and 111 deletions
@@ -27,10 +27,16 @@ public interface PyFile extends PyElement, PsiFile, PyDocStringOwner, ScopeOwner
LanguageLevel getLanguageLevel();
/**
* Return the list of all 'from ... import' statements in the top-level scope of the file.
*
* @return the list of 'from ... import' statements.
*/
@NotNull
List<PyFromImportStatement> getFromImports();
/**
* Returns the list of import elements in all 'import xxx' statements within the file.
* Returns the list of import elements in all 'import xxx' statements in the top-level scope of the file.
*
* @return the list of import targets.
*/
@@ -51,7 +57,7 @@ public interface PyFile extends PyElement, PsiFile, PyDocStringOwner, ScopeOwner
boolean hasImportFromFuture(FutureFeature feature);
/**
* If the function raises a DeprecationWarning or a PendingDeprecationWarning, returns the explanation text provided for the warning..
* If the function raises a DeprecationWarning or a PendingDeprecationWarning, returns the explanation text provided for the warning.
*
* @return the deprecation message or null if the function is not deprecated.
*/