private void highlightNotUsedAnymore( GenericAttributeValue attributeValue, DomElementAnnotationHolder holder) { if (!DomUtil.hasXml(attributeValue)) { return; } final Annotation annotation = holder.createAnnotation( attributeValue, HighlightSeverity.WARNING, "Not used anymore"); annotation.setHighlightType(ProblemHighlightType.LIKE_DEPRECATED); }
@Nullable public static MavenDomProjectModel findParent( @NotNull MavenDomParent mavenDomParent, Project project) { if (!DomUtil.hasXml(mavenDomParent)) return null; MavenId id = new MavenId( mavenDomParent.getGroupId().getStringValue(), mavenDomParent.getArtifactId().getStringValue(), mavenDomParent.getVersion().getStringValue()); MavenProject mavenProject = MavenProjectsManager.getInstance(project).findProject(id); return mavenProject != null ? MavenDomUtil.getMavenDomProjectModel(project, mavenProject.getFile()) : null; }
private void annotateExtension(Extension extension, DomElementAnnotationHolder holder) { final ExtensionPoint extensionPoint = extension.getExtensionPoint(); if (extensionPoint == null) { return; } final GenericAttributeValue<PsiClass> interfaceAttribute = extensionPoint.getInterface(); if (!DomUtil.hasXml(interfaceAttribute)) { return; } final PsiClass value = interfaceAttribute.getValue(); if (value != null && value.isDeprecated()) { final Annotation annotation = holder.createAnnotation(extension, HighlightSeverity.WARNING, "Deprecated EP"); annotation.setHighlightType(ProblemHighlightType.LIKE_DEPRECATED); } }
@Nullable public T process(@NotNull MavenDomProjectModel projectDom) { MavenDomParent parent = projectDom.getMavenParent(); MavenParentDesc parentDesc = null; if (DomUtil.hasXml(parent)) { String parentGroupId = parent.getGroupId().getStringValue(); String parentArtifactId = parent.getArtifactId().getStringValue(); String parentVersion = parent.getVersion().getStringValue(); String parentRelativePath = parent.getRelativePath().getStringValue(); if (StringUtil.isEmptyOrSpaces(parentRelativePath)) parentRelativePath = "../pom.xml"; MavenId parentId = new MavenId(parentGroupId, parentArtifactId, parentVersion); parentDesc = new MavenParentDesc(parentId, parentRelativePath); } return process( myManager.getGeneralSettings(), MavenDomUtil.getVirtualFile(projectDom), parentDesc); }