(no message)

This commit is contained in:
Alexey Kudravtsev
2005-02-09 17:43:33 +03:00
parent 8d79fbdab8
commit 306da78cc2
3 changed files with 13 additions and 12 deletions
@@ -139,8 +139,8 @@ public class CodeInsightUtil {
if (root instanceof TranslatingChangesDummyHolder) {
root.accept(new PsiRecursiveElementVisitor(){
public void visitElement(PsiElement element) {
list.add(element);
super.visitElement(element);
list.add(element);
}
});
return list.toArray(new PsiElement[list.size()]);
@@ -167,7 +167,7 @@ public class HighlightVisitorImpl extends PsiElementVisitor implements Highlight
}
}
private HighlightInfo convertToHighlightInfo(final Annotation annotation) {
private static HighlightInfo convertToHighlightInfo(final Annotation annotation) {
final HighlightInfo info = new HighlightInfo(annotation.getTextAttributes(), convertType(annotation), annotation.getStartOffset(), annotation.getEndOffset(),
annotation.getMessage(), annotation.getTooltip(), annotation.getSeverity(), annotation.isAfterEndOfLine(), annotation.needsUpdateOnTyping());
final List<Pair<IntentionAction, TextRange>> fixes = annotation.getQuickFixes();
@@ -180,7 +180,7 @@ public class HighlightVisitorImpl extends PsiElementVisitor implements Highlight
return info;
}
private HighlightInfoType convertType(Annotation annotation) {
private static HighlightInfoType convertType(Annotation annotation) {
final ProblemHighlightType type = annotation.getHighlightType();
if (type == ProblemHighlightType.LIKE_UNUSED_SYMBOL) return HighlightInfoType.UNUSED_SYMBOL;
if (type == ProblemHighlightType.LIKE_UNKNOWN_SYMBOL) return HighlightInfoType.WRONG_REF;
@@ -729,9 +729,8 @@ public class HighlightVisitorImpl extends PsiElementVisitor implements Highlight
myHolder.add(GenericsHighlightUtil.checkParameterizedReferenceTypeArguments(resolved, ref, result.getSubstitutor()));
}
PsiElement refParent = parent;
if (resolved instanceof PsiClass && refParent instanceof PsiReferenceList) {
myHolder.add(HighlightUtil.checkReferenceList(ref, (PsiReferenceList)refParent, result));
if (resolved instanceof PsiClass && parent instanceof PsiReferenceList) {
myHolder.add(HighlightUtil.checkReferenceList(ref, (PsiReferenceList)parent, result));
}
if (!myHolder.hasErrorResults()) {
@@ -898,7 +897,7 @@ public class HighlightVisitorImpl extends PsiElementVisitor implements Highlight
}
public void visitVariable(PsiVariable variable) {
myHolder.add(HighlightUtil.checkVariableInitializerType(variable));
if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkVariableInitializerType(variable));
myHolder.add(HighlightNamesUtil.highlightVariable(variable, variable.getNameIdentifier()));
}
@@ -4,19 +4,17 @@ package com.intellij.psi.impl;
import com.intellij.ide.util.EditSourceUtil;
import com.intellij.lang.Language;
import com.intellij.navigation.ItemPresentation;
import com.intellij.navigation.NavigationItem;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiReference;
import com.intellij.psi.PsiSubstitutor;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.resolve.ResolveUtil;
import com.intellij.psi.scope.PsiScopeProcessor;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.SearchScope;
import com.intellij.util.IncorrectOperationException;
public abstract class PsiElementBase extends ElementBase implements PsiElement {
public abstract class PsiElementBase extends ElementBase implements PsiElement,NavigationItem {
public PsiElement getFirstChild() {
PsiElement[] children = getChildren();
if (children.length == 0) return null;
@@ -122,6 +120,10 @@ public abstract class PsiElementBase extends ElementBase implements PsiElement {
return FileStatus.NOT_CHANGED;
}
public String getName() {
return this instanceof PsiNamedElement ? ((PsiNamedElement)this).getName() : null;
}
public Project getProject() {
return getManager().getProject();
}