OLD | NEW |
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.highlights2; | 5 library computer.highlights2; |
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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 } | 591 } |
592 | 592 |
593 @override | 593 @override |
594 Object visitLibraryDirective(LibraryDirective node) { | 594 Object visitLibraryDirective(LibraryDirective node) { |
595 computer._addRegion_node(node, HighlightRegionType.DIRECTIVE); | 595 computer._addRegion_node(node, HighlightRegionType.DIRECTIVE); |
596 computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN); | 596 computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN); |
597 return super.visitLibraryDirective(node); | 597 return super.visitLibraryDirective(node); |
598 } | 598 } |
599 | 599 |
600 @override | 600 @override |
| 601 Object visitLibraryIdentifier(LibraryIdentifier node) { |
| 602 computer._addRegion_node(node, HighlightRegionType.LIBRARY_NAME); |
| 603 return null; |
| 604 } |
| 605 |
| 606 @override |
601 Object visitListLiteral(ListLiteral node) { | 607 Object visitListLiteral(ListLiteral node) { |
602 computer._addRegion_node(node, HighlightRegionType.LITERAL_LIST); | 608 computer._addRegion_node(node, HighlightRegionType.LITERAL_LIST); |
603 computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD); | 609 computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD); |
604 return super.visitListLiteral(node); | 610 return super.visitListLiteral(node); |
605 } | 611 } |
606 | 612 |
607 @override | 613 @override |
608 Object visitMapLiteral(MapLiteral node) { | 614 Object visitMapLiteral(MapLiteral node) { |
609 computer._addRegion_node(node, HighlightRegionType.LITERAL_MAP); | 615 computer._addRegion_node(node, HighlightRegionType.LITERAL_MAP); |
610 computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD); | 616 computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 void _addRegions_functionBody(FunctionBody node) { | 767 void _addRegions_functionBody(FunctionBody node) { |
762 Token keyword = node.keyword; | 768 Token keyword = node.keyword; |
763 if (keyword != null) { | 769 if (keyword != null) { |
764 Token star = node.star; | 770 Token star = node.star; |
765 int offset = keyword.offset; | 771 int offset = keyword.offset; |
766 int end = star != null ? star.end : keyword.end; | 772 int end = star != null ? star.end : keyword.end; |
767 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); | 773 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); |
768 } | 774 } |
769 } | 775 } |
770 } | 776 } |
OLD | NEW |