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

Unified Diff: pkg/analysis_server/lib/src/computer/computer_highlights.dart

Issue 668943004: Semantic highlight async/await/sync/yield. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/notification_highlights_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/computer/computer_highlights.dart
diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights.dart b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
index 7e9eed87be263ea65888e4d243b3a6f6f3941928..50c51711b0860038aa8af4238c2ab715f56238fe 100644
--- a/pkg/analysis_server/lib/src/computer/computer_highlights.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
@@ -371,6 +371,18 @@ class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor<Object> {
}
@override
+ Object visitAwaitExpression(AwaitExpression node) {
+ computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
+ return super.visitAwaitExpression(node);
+ }
+
+ @override
+ Object visitBlockFunctionBody(BlockFunctionBody node) {
+ _addRegions_functionBody(node);
+ return super.visitBlockFunctionBody(node);
+ }
+
+ @override
Object visitBooleanLiteral(BooleanLiteral node) {
computer._addRegion_node(node, HighlightRegionType.KEYWORD);
computer._addRegion_node(node, HighlightRegionType.LITERAL_BOOLEAN);
@@ -451,6 +463,12 @@ class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor<Object> {
}
@override
+ Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
+ _addRegions_functionBody(node);
+ return super.visitExpressionFunctionBody(node);
+ }
+
+ @override
Object visitFieldDeclaration(FieldDeclaration node) {
computer._addRegion_token(node.staticKeyword, HighlightRegionType.BUILT_IN);
return super.visitFieldDeclaration(node);
@@ -694,4 +712,24 @@ class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor<Object> {
computer._addRegion_token(node.withKeyword, HighlightRegionType.KEYWORD);
return super.visitWithClause(node);
}
+
+ @override
+ Object visitYieldStatement(YieldStatement node) {
+ Token keyword = node.yieldKeyword;
+ Token star = node.star;
+ int offset = keyword.offset;
+ int end = star != null ? star.end : keyword.end;
+ computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN);
+ return super.visitYieldStatement(node);
+ }
+
+ void _addRegions_functionBody(FunctionBody node) {
+ Token keyword = node.keyword;
+ if (keyword != null) {
+ Token star = node.star;
+ int offset = keyword.offset;
+ int end = star != null ? star.end : keyword.end;
+ computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN);
+ }
+ }
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/notification_highlights_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698