use of com.intellij.openapi.application.ReadAction in project intellij by bazelbuild.
the class TestFileSystem method getPsiFile.
/**
* Finds PsiFile, and asserts that it's not null.
*/
// #api203: remove "@SuppressWarnings({"rawtypes", "RedundantSuppression"})"
@SuppressWarnings({ "rawtypes", "RedundantSuppression" })
public PsiFile getPsiFile(VirtualFile file) {
return new ReadAction<PsiFile>() {
@Override
protected void run(// #api203 replace with "Result<? super PsiFile>"
Result result) {
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
assertThat(psiFile).isNotNull();
result.setResult(psiFile);
}
}.execute().getResultObject();
}
Aggregations