void (@NotNull PyFunction node) { if (node.isAsyncAllowed()) { highlightKeyword(node, PyTokenTypes.ASYNC_KEYWORD); } else { Optional .ofNullable(node.getNode()) .map(astNode -> astNode.findChildByType(PyTokenTypes.ASYNC_KEYWORD)) .ifPresent(asyncNode -> getHolder().newAnnotation(HighlightSeverity.ERROR, PyPsiBundle.message("ANN.function.cannot.be.async", node.getName())).range(asyncNode).create()); } }