void (Editor editor, PyFunction function) { if (!FileModificationService.getInstance().preparePsiElementForWrite(function)) return; WriteAction.run(() -> { if (isPy3k(function.getContainingFile())) { generatePy3kTypeAnnotations(function.getProject(), editor, function); } else { generateTypeCommentAnnotations(function.getProject(), function); } }); }