Introduced shortcut properties + getArrowNode -> getArrow

This commit is contained in:
Valentin Kipyatkov
2015-05-11 19:48:01 +03:00
parent d86e142366
commit a3bd6ca017
39 changed files with 129 additions and 88 deletions
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.idea.highlighter;
import com.intellij.lang.ASTNode;
import com.intellij.lang.annotation.AnnotationHolder;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.colors.TextAttributesKey;
@@ -59,9 +58,9 @@ class SoftKeywordsHighlightingVisitor extends HighlightingVisitor {
if (closingBrace != null) {
holder.createInfoAnnotation(closingBrace, null).setTextAttributes(JetHighlightingColors.FUNCTION_LITERAL_BRACES_AND_ARROW);
}
ASTNode arrowNode = functionLiteral.getArrowNode();
if (arrowNode != null) {
holder.createInfoAnnotation(arrowNode, null).setTextAttributes(JetHighlightingColors.FUNCTION_LITERAL_BRACES_AND_ARROW);
PsiElement arrow = functionLiteral.getArrow();
if (arrow != null) {
holder.createInfoAnnotation(arrow, null).setTextAttributes(JetHighlightingColors.FUNCTION_LITERAL_BRACES_AND_ARROW);
}
}
}
@@ -63,7 +63,7 @@ public class JetSimpleNameReference(
override fun getRangeInElement(): TextRange {
val element = getElement().getReferencedNameElement()
val startOffset = getElement().getTextRange().getStartOffset()
val startOffset = getElement().startOffset
return element.getTextRange().shiftRight(-startOffset)
}