mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-20610 Fix function annotation highlighting
Fix PyTypeCheckerInspection so it doesn't highlight arrow in python 3 type annotations.
This commit is contained in:
@@ -126,7 +126,7 @@ public class PyTypeCheckerInspection extends PyInspection {
|
||||
final PyType expected = myTypeEvalContext.getReturnType(node);
|
||||
final String expectedName = PythonDocumentationProvider.getTypeName(expected, myTypeEvalContext);
|
||||
if (expected != null && !(expected instanceof PyNoneType)) {
|
||||
registerProblem(annotation != null ? annotation : node.getTypeComment(),
|
||||
registerProblem(annotation != null ? annotation.getValue() : node.getTypeComment(),
|
||||
String.format("Expected to return '%s', got no return", expectedName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ def h(x) -> int:
|
||||
def i() -> Union[int, str]:
|
||||
pass
|
||||
|
||||
def j(x) <warning descr="Expected to return 'Union[int, str]', got no return">-> Union[int, str]</warning>:
|
||||
def j(x) -> <warning descr="Expected to return 'Union[int, str]', got no return">Union[int, str]</warning>:
|
||||
x = 42
|
||||
|
||||
def k() -> None:
|
||||
|
||||
Reference in New Issue
Block a user