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.highlights; | 5 library computer.highlights; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element; |
| 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/dart/element/type.dart'; |
8 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/element.dart'; | |
10 import 'package:analyzer/src/generated/scanner.dart'; | 11 import 'package:analyzer/src/generated/scanner.dart'; |
11 | 12 |
12 /** | 13 /** |
13 * A computer for [HighlightRegion]s in a Dart [CompilationUnit]. | 14 * A computer for [HighlightRegion]s in a Dart [CompilationUnit]. |
14 */ | 15 */ |
15 class DartUnitHighlightsComputer { | 16 class DartUnitHighlightsComputer { |
16 final CompilationUnit _unit; | 17 final CompilationUnit _unit; |
17 | 18 |
18 final List<HighlightRegion> _regions = <HighlightRegion>[]; | 19 final List<HighlightRegion> _regions = <HighlightRegion>[]; |
19 | 20 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 void _addRegions_functionBody(FunctionBody node) { | 716 void _addRegions_functionBody(FunctionBody node) { |
716 Token keyword = node.keyword; | 717 Token keyword = node.keyword; |
717 if (keyword != null) { | 718 if (keyword != null) { |
718 Token star = node.star; | 719 Token star = node.star; |
719 int offset = keyword.offset; | 720 int offset = keyword.offset; |
720 int end = star != null ? star.end : keyword.end; | 721 int end = star != null ? star.end : keyword.end; |
721 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); | 722 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); |
722 } | 723 } |
723 } | 724 } |
724 } | 725 } |
OLD | NEW |