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

Side by Side Diff: pkg/analysis_server/lib/src/computer/computer_highlights.dart

Issue 835953002: Fix for 'await' highlighting in for-each. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/notification_highlights_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library computer.highlights; 5 library computer.highlights;
6 6
7 import 'package:analysis_server/src/protocol.dart' hide Element; 7 import 'package:analysis_server/src/protocol.dart' hide Element;
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/element.dart'; 9 import 'package:analyzer/src/generated/element.dart';
10 import 'package:analyzer/src/generated/scanner.dart'; 10 import 'package:analyzer/src/generated/scanner.dart';
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 469 }
470 470
471 @override 471 @override
472 Object visitFieldDeclaration(FieldDeclaration node) { 472 Object visitFieldDeclaration(FieldDeclaration node) {
473 computer._addRegion_token(node.staticKeyword, HighlightRegionType.BUILT_IN); 473 computer._addRegion_token(node.staticKeyword, HighlightRegionType.BUILT_IN);
474 return super.visitFieldDeclaration(node); 474 return super.visitFieldDeclaration(node);
475 } 475 }
476 476
477 @override 477 @override
478 Object visitForEachStatement(ForEachStatement node) { 478 Object visitForEachStatement(ForEachStatement node) {
479 computer._addRegion_token(node.awaitKeyword, HighlightRegionType.BUILT_IN);
479 computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD); 480 computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
480 computer._addRegion_token(node.inKeyword, HighlightRegionType.KEYWORD); 481 computer._addRegion_token(node.inKeyword, HighlightRegionType.KEYWORD);
481 return super.visitForEachStatement(node); 482 return super.visitForEachStatement(node);
482 } 483 }
483 484
484 @override 485 @override
485 Object visitForStatement(ForStatement node) { 486 Object visitForStatement(ForStatement node) {
486 computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD); 487 computer._addRegion_token(node.forKeyword, HighlightRegionType.KEYWORD);
487 return super.visitForStatement(node); 488 return super.visitForStatement(node);
488 } 489 }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 void _addRegions_functionBody(FunctionBody node) { 727 void _addRegions_functionBody(FunctionBody node) {
727 Token keyword = node.keyword; 728 Token keyword = node.keyword;
728 if (keyword != null) { 729 if (keyword != null) {
729 Token star = node.star; 730 Token star = node.star;
730 int offset = keyword.offset; 731 int offset = keyword.offset;
731 int end = star != null ? star.end : keyword.end; 732 int end = star != null ? star.end : keyword.end;
732 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); 733 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN);
733 } 734 }
734 } 735 }
735 } 736 }
OLDNEW
« 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