Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java

Issue 11418186: Issue 5359. Highlight 'on' in try-catch statement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
index a8237c85205516450984caaee0001f583743cd7e..4dc3cf1627e5af14ebd0f24cb182c5e42f8fe99d 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
@@ -16,6 +16,7 @@ package com.google.dart.tools.ui.internal.text.editor;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.dart.compiler.ast.DartBinaryExpression;
+import com.google.dart.compiler.ast.DartCatchBlock;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartDoubleLiteral;
import com.google.dart.compiler.ast.DartExportDirective;
@@ -32,6 +33,7 @@ import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartPartOfDirective;
import com.google.dart.compiler.ast.DartSourceDirective;
import com.google.dart.compiler.ast.DartStringLiteral;
+import com.google.dart.compiler.ast.DartTryStatement;
import com.google.dart.compiler.ast.DartTypeNode;
import com.google.dart.compiler.ast.DartVariable;
import com.google.dart.compiler.ast.ImportCombinator;
@@ -144,6 +146,18 @@ public class SemanticHighlightings {
implementsOffset,
"implements".length()));
}
+ // try {} on
+ if (node instanceof DartTryStatement) {
+ List<SourceRange> onTokens = Lists.newArrayList();
+ DartTryStatement onStatement = (DartTryStatement) node;
+ for (DartCatchBlock catchBlock : onStatement.getCatchBlocks()) {
+ int onOffset = catchBlock.getOnTokenOffset();
+ if (onOffset != -1) {
+ onTokens.add(SourceRangeFactory.forStartLength(onOffset, "on".length()));
+ }
+ }
+ return onTokens;
+ }
// done
return result;
}

Powered by Google App Engine
This is Rietveld 408576698