PsiAnnotation (@NotNull PsiAnnotation annotation) { annotation.putUserData(EXTERNAL_ANNO_MARKER, Boolean.TRUE); ((LightVirtualFile)annotation.getContainingFile().getViewProvider().getVirtualFile()).setWritable(false); return annotation; }