@NotNull public static PsiAnchor wrapperOrHardReference(@NotNull PsiElement element) { for (SmartPointerAnchorProvider provider : SmartPointerAnchorProvider.EP_NAME.getExtensions()) { PsiElement anchorElement = provider.getAnchor(element); if (anchorElement != null && anchorElement != element) { PsiAnchor wrappedAnchor = create(anchorElement); if (!(wrappedAnchor instanceof HardReference)) { return new WrappedElementAnchor(provider, wrappedAnchor); } } } return new HardReference(element); }
@Nonnull private static PsiAnchor wrapperOrHardReference(@Nonnull PsiElement element) { for (SmartPointerAnchorProvider provider : SmartPointerAnchorProvider.EP_NAME.getExtensions()) { PsiElement anchorElement = provider.getAnchor(element); if (anchorElement != null && anchorElement != element) { PsiAnchor wrappedAnchor = create(anchorElement); if (!(wrappedAnchor instanceof HardReference)) { return new WrappedElementAnchor(provider, wrappedAnchor); } } } return new HardReference(element); }
public WrappedElementAnchor(@NotNull SmartPointerAnchorProvider provider, @NotNull PsiAnchor anchor) { myAnchorProvider = provider; myBaseAnchor = anchor; }
public WrappedElementAnchor(@Nonnull SmartPointerAnchorProvider provider, @Nonnull PsiAnchor anchor) { myAnchorProvider = provider; myBaseAnchor = anchor; }