mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
PY-25491 Use AST-based search to find 'as' target expression
We don't store stubs for 'as' targets of type PyTargetExpression in PyImportElements. We store the 'as' name in the stubs for PyImportElements instead. The getAsName() checks if the element has a stub, and if it hasn't, then asks its AST about the name. It used to access AST via getStubOrPsiChild() and it was always AST because it happened after a 'getStub() == null' check. But now we have green stubs so getStubOrPsiChild() accesses the green stub via getGreenStub() even though we have AST.
This commit is contained in:
@@ -72,7 +72,7 @@ public class PyImportElementImpl extends PyBaseElementImpl<PyImportElementStub>
|
||||
}
|
||||
|
||||
public PyTargetExpression getAsNameElement() {
|
||||
return getStubOrPsiChild(PyElementTypes.TARGET_EXPRESSION);
|
||||
return findChildByType(PyElementTypes.TARGET_EXPRESSION);
|
||||
}
|
||||
|
||||
public String getAsName() {
|
||||
|
||||
Reference in New Issue
Block a user