|
| 1 | +package net.neoforged.jst.cli.intellij; |
| 2 | + |
| 3 | +import com.intellij.codeInsight.ExternalAnnotationsManager; |
| 4 | +import com.intellij.openapi.vfs.VirtualFile; |
| 5 | +import com.intellij.psi.PsiAnnotation; |
| 6 | +import com.intellij.psi.PsiClass; |
| 7 | +import com.intellij.psi.PsiElement; |
| 8 | +import com.intellij.psi.PsiFile; |
| 9 | +import com.intellij.psi.PsiModifierListOwner; |
| 10 | +import com.intellij.psi.PsiNameValuePair; |
| 11 | +import org.jetbrains.annotations.NotNull; |
| 12 | +import org.jetbrains.annotations.Nullable; |
| 13 | + |
| 14 | +import java.util.List; |
| 15 | + |
| 16 | +public class MockExternalAnnotationsManager extends ExternalAnnotationsManager { |
| 17 | + @Override |
| 18 | + public boolean hasAnnotationRootsForFile(@NotNull VirtualFile file) { |
| 19 | + return false; |
| 20 | + } |
| 21 | + |
| 22 | + @Override |
| 23 | + public boolean isExternalAnnotation(@NotNull PsiAnnotation annotation) { |
| 24 | + return false; |
| 25 | + } |
| 26 | + |
| 27 | + @Override |
| 28 | + public @Nullable PsiAnnotation findExternalAnnotation(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) { |
| 29 | + return null; |
| 30 | + } |
| 31 | + |
| 32 | + @Override |
| 33 | + public @NotNull List<PsiAnnotation> findExternalAnnotations(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) { |
| 34 | + return List.of(); |
| 35 | + } |
| 36 | + |
| 37 | + @Override |
| 38 | + public boolean isExternalAnnotationWritable(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) { |
| 39 | + return false; |
| 40 | + } |
| 41 | + |
| 42 | + @Override |
| 43 | + public @NotNull PsiAnnotation @NotNull [] findExternalAnnotations(@NotNull PsiModifierListOwner listOwner) { |
| 44 | + return new PsiAnnotation[0]; |
| 45 | + } |
| 46 | + |
| 47 | + @Override |
| 48 | + public @Nullable List<PsiAnnotation> findDefaultConstructorExternalAnnotations(@NotNull PsiClass aClass) { |
| 49 | + return List.of(); |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public @Nullable List<PsiAnnotation> findDefaultConstructorExternalAnnotations(@NotNull PsiClass aClass, @NotNull String annotationFQN) { |
| 54 | + return List.of(); |
| 55 | + } |
| 56 | + |
| 57 | + @Override |
| 58 | + public void annotateExternally(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQName, @NotNull PsiFile fromFile, PsiNameValuePair @Nullable [] value) throws CanceledConfigurationException { |
| 59 | + |
| 60 | + } |
| 61 | + |
| 62 | + @Override |
| 63 | + public boolean deannotate(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) { |
| 64 | + return false; |
| 65 | + } |
| 66 | + |
| 67 | + @Override |
| 68 | + public boolean editExternalAnnotation(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN, PsiNameValuePair @Nullable [] value) { |
| 69 | + return false; |
| 70 | + } |
| 71 | + |
| 72 | + @Override |
| 73 | + public @NotNull AnnotationPlace chooseAnnotationsPlaceNoUi(@NotNull PsiElement element) { |
| 74 | + return AnnotationPlace.NOWHERE; |
| 75 | + } |
| 76 | + |
| 77 | + @Override |
| 78 | + public @NotNull AnnotationPlace chooseAnnotationsPlace(@NotNull PsiElement element) { |
| 79 | + return AnnotationPlace.NOWHERE; |
| 80 | + } |
| 81 | + |
| 82 | + @Override |
| 83 | + public @Nullable List<PsiFile> findExternalAnnotationsFiles(@NotNull PsiModifierListOwner listOwner) { |
| 84 | + return List.of(); |
| 85 | + } |
| 86 | + |
| 87 | + @Override |
| 88 | + public boolean hasConfiguredAnnotationRoot(@NotNull PsiModifierListOwner owner) { |
| 89 | + return false; |
| 90 | + } |
| 91 | +} |
0 commit comments