| 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; | |
| 6 | |
| 7 import 'package:analysis_server/protocol/protocol_generated.dart' hide Element; | |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 5 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/ast/token.dart'; | 6 import 'package:analyzer/dart/ast/token.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 7 import 'package:analyzer/dart/ast/visitor.dart'; |
| 11 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 12 import 'package:analyzer/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
| 10 import 'package:analyzer_plugin/protocol/protocol_common.dart' hide Element; |
| 13 | 11 |
| 14 /** | 12 /** |
| 15 * A computer for [HighlightRegion]s in a Dart [CompilationUnit]. | 13 * A computer for [HighlightRegion]s in a Dart [CompilationUnit]. |
| 16 */ | 14 */ |
| 17 class DartUnitHighlightsComputer { | 15 class DartUnitHighlightsComputer { |
| 18 final CompilationUnit _unit; | 16 final CompilationUnit _unit; |
| 19 | 17 |
| 20 final List<HighlightRegion> _regions = <HighlightRegion>[]; | 18 final List<HighlightRegion> _regions = <HighlightRegion>[]; |
| 21 | 19 |
| 22 DartUnitHighlightsComputer(this._unit); | 20 DartUnitHighlightsComputer(this._unit); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 void _addRegions_functionBody(FunctionBody node) { | 728 void _addRegions_functionBody(FunctionBody node) { |
| 731 Token keyword = node.keyword; | 729 Token keyword = node.keyword; |
| 732 if (keyword != null) { | 730 if (keyword != null) { |
| 733 Token star = node.star; | 731 Token star = node.star; |
| 734 int offset = keyword.offset; | 732 int offset = keyword.offset; |
| 735 int end = star != null ? star.end : keyword.end; | 733 int end = star != null ? star.end : keyword.end; |
| 736 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); | 734 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); |
| 737 } | 735 } |
| 738 } | 736 } |
| 739 } | 737 } |
| OLD | NEW |