use of com.goide.psi.GoFile in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoDeleteImportQuickFix method applyFix.
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
PsiElement element = PsiTreeUtil.getNonStrictParentOfType(descriptor.getPsiElement(), GoImportSpec.class);
PsiFile file = element != null ? element.getContainingFile() : null;
if (!(file instanceof GoFile))
return;
WriteCommandAction.runWriteCommandAction(project, () -> ((GoFile) file).deleteImport((GoImportSpec) element));
}
Aggregations