mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PyiTypeProvider doesn't escalate TypeEvalContext rights to access type hints
It's no longer necessary since PY-18816 has been implemented
This commit is contained in:
@@ -134,10 +134,7 @@ public class PyiTypeProvider extends PyTypeProviderBase {
|
||||
if (target instanceof PyTargetExpression) {
|
||||
final PsiElement pythonStub = PyiUtil.getPythonStub((PyTargetExpression)target);
|
||||
if (pythonStub instanceof PyTypedElement) {
|
||||
// XXX: Force the switch to AST for getting the type out of the hint in the comment
|
||||
final TypeEvalContext effectiveContext = context.maySwitchToAST(pythonStub) ?
|
||||
context : TypeEvalContext.deepCodeInsight(target.getProject());
|
||||
return effectiveContext.getType((PyTypedElement)pythonStub);
|
||||
return context.getType((PyTypedElement)pythonStub);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -91,6 +91,7 @@ public class PyiTypeTest extends PyTestCase {
|
||||
final Project project = element.getProject();
|
||||
final PsiFile containingFile = element.getContainingFile();
|
||||
assertType(expectedType, typedElement, TypeEvalContext.codeAnalysis(project, containingFile));
|
||||
assertProjectFilesNotParsed(myFixture.getFile());
|
||||
assertType(expectedType, typedElement, TypeEvalContext.userInitiated(project, containingFile));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user