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

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

Issue 628293004: Remove references to Engine classes from protocol.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/lib/src/computer/computer_occurrences.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.navigation; 5 library computer.navigation;
6 6
7 import 'package:analysis_server/src/protocol.dart' as protocol; 7 import 'package:analysis_server/src/protocol_server.dart' as protocol;
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';
11 11
12 12
13 /** 13 /**
14 * A computer for navigation regions in a Dart [CompilationUnit]. 14 * A computer for navigation regions in a Dart [CompilationUnit].
15 */ 15 */
16 class DartUnitNavigationComputer { 16 class DartUnitNavigationComputer {
17 final CompilationUnit _unit; 17 final CompilationUnit _unit;
(...skipping 11 matching lines...) Expand all
29 return new List.from(_regions); 29 return new List.from(_regions);
30 } 30 }
31 31
32 void _addRegion(int offset, int length, Element element) { 32 void _addRegion(int offset, int length, Element element) {
33 if (element is FieldFormalParameterElement) { 33 if (element is FieldFormalParameterElement) {
34 element = (element as FieldFormalParameterElement).field; 34 element = (element as FieldFormalParameterElement).field;
35 } 35 }
36 if (element == null || element == DynamicElementImpl.instance) { 36 if (element == null || element == DynamicElementImpl.instance) {
37 return; 37 return;
38 } 38 }
39 protocol.Element target = new protocol.Element.fromEngine(element); 39 protocol.Element target = protocol.newElement_fromEngine(element);
40 _regions.add(new protocol.NavigationRegion(offset, length, [target])); 40 _regions.add(new protocol.NavigationRegion(offset, length, [target]));
41 } 41 }
42 42
43 void _addRegionForNode(AstNode node, Element element) { 43 void _addRegionForNode(AstNode node, Element element) {
44 int offset = node.offset; 44 int offset = node.offset;
45 int length = node.length; 45 int length = node.length;
46 _addRegion(offset, length, element); 46 _addRegion(offset, length, element);
47 } 47 }
48 48
49 void _addRegionForToken(Token token, Element element) { 49 void _addRegionForToken(Token token, Element element) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 @override 199 @override
200 visitSimpleIdentifier(SimpleIdentifier node) { 200 visitSimpleIdentifier(SimpleIdentifier node) {
201 if (node.parent is ConstructorDeclaration) { 201 if (node.parent is ConstructorDeclaration) {
202 } else { 202 } else {
203 computer._addRegionForNode(node, node.bestElement); 203 computer._addRegionForNode(node, node.bestElement);
204 } 204 }
205 return super.visitSimpleIdentifier(node); 205 return super.visitSimpleIdentifier(node);
206 } 206 }
207 } 207 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/computer/computer_occurrences.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698