@NotNull @Override protected PsiPackageReference createReference(TextRange range, int index) { // If the Gradle model specifies an application id, which does not rely on // the package in any way, then the package attribute in the manifest should // be taken to be a normal package reference, and should participate in normal // package rename refactoring AndroidFacet facet = AndroidFacet.getInstance(getElement()); if (facet != null) { IdeaAndroidProject project = facet.getIdeaAndroidProject(); if (project != null && project.overridesManifestPackage()) { return new PsiPackageReference(this, range, index); } } return new MyPsiPackageReference(this, range, index); }
public PsiReference[] getReferences(@NotNull HeaderValuePart headerValuePart) { if (headerValuePart.getParent() instanceof Clause) { PackageReferenceSet referenceSet = new PackageReferenceSet(headerValuePart.getUnwrappedText(), headerValuePart, 0); return referenceSet.getReferences().toArray(new PsiPackageReference[referenceSet.getReferences().size()]); } return PsiReference.EMPTY_ARRAY; }