Got rid of returning empty range list in position strategies (in places where they depend on syntax errors).

This commit is contained in:
Evgeny Gerashchenko
2012-04-29 13:48:58 +04:00
parent abdf34418a
commit eeafd06cd8
2 changed files with 1 additions and 5 deletions
@@ -288,7 +288,6 @@ public interface Errors {
@NotNull
@Override
public List<TextRange> mark(@NotNull JetWhenExpression element) {
if (hasSyntaxError(element)) return Collections.emptyList();
return markElement(element.getWhenKeywordElement());
}
});
@@ -74,14 +74,11 @@ public class PositioningStrategies {
@NotNull
@Override
public List<TextRange> mark(@NotNull PsiNameIdentifierOwner element) {
if (element.getLastChild() instanceof PsiErrorElement) {
return Collections.emptyList();
}
PsiElement nameIdentifier = element.getNameIdentifier();
if (nameIdentifier != null) {
return markElement(nameIdentifier);
}
return Collections.emptyList();
return markElement(element);
}
};