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

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

Issue 2879273002: Make server use the common protocol classes (Closed)
Patch Set: Created 3 years, 7 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
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.highlights2;
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/standard_resolution_map.dart'; 6 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 7 import 'package:analyzer/dart/ast/token.dart';
11 import 'package:analyzer/dart/ast/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
12 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
13 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
11 import 'package:analyzer_plugin/protocol/protocol_common.dart' hide Element;
14 12
15 /** 13 /**
16 * A computer for [HighlightRegion]s in a Dart [CompilationUnit]. 14 * A computer for [HighlightRegion]s in a Dart [CompilationUnit].
17 */ 15 */
18 class DartUnitHighlightsComputer2 { 16 class DartUnitHighlightsComputer2 {
19 final CompilationUnit _unit; 17 final CompilationUnit _unit;
20 18
21 final List<HighlightRegion> _regions = <HighlightRegion>[]; 19 final List<HighlightRegion> _regions = <HighlightRegion>[];
22 20
23 DartUnitHighlightsComputer2(this._unit); 21 DartUnitHighlightsComputer2(this._unit);
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 void _addRegions_functionBody(FunctionBody node) { 825 void _addRegions_functionBody(FunctionBody node) {
828 Token keyword = node.keyword; 826 Token keyword = node.keyword;
829 if (keyword != null) { 827 if (keyword != null) {
830 Token star = node.star; 828 Token star = node.star;
831 int offset = keyword.offset; 829 int offset = keyword.offset;
832 int end = star != null ? star.end : keyword.end; 830 int end = star != null ? star.end : keyword.end;
833 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); 831 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN);
834 } 832 }
835 } 833 }
836 } 834 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698