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

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

Issue 367973006: Implementation for 'analysis.occurrences' notification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
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/constants.dart'; 7 import 'package:analysis_server/src/constants.dart';
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 void _addRegion_tokenStart_nodeEnd(Token a, AstNode b, Element element) { 72 void _addRegion_tokenStart_nodeEnd(Token a, AstNode b, Element element) {
73 int offset = a.offset; 73 int offset = a.offset;
74 int length = b.end - offset; 74 int length = b.end - offset;
75 _addRegion(offset, length, element); 75 _addRegion(offset, length, element);
76 } 76 }
77 } 77 }
78 78
79 79
80
81 class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor { 80 class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor {
82 final DartUnitNavigationComputer computer; 81 final DartUnitNavigationComputer computer;
83 82
84 _DartUnitNavigationComputerVisitor(this.computer); 83 _DartUnitNavigationComputerVisitor(this.computer);
85 84
86 @override 85 @override
87 visitAssignmentExpression(AssignmentExpression node) { 86 visitAssignmentExpression(AssignmentExpression node) {
88 computer._addRegionForToken(node.operator, node.bestElement); 87 computer._addRegionForToken(node.operator, node.bestElement);
89 return super.visitAssignmentExpression(node); 88 return super.visitAssignmentExpression(node);
90 } 89 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 175
177 @override 176 @override
178 visitSimpleIdentifier(SimpleIdentifier node) { 177 visitSimpleIdentifier(SimpleIdentifier node) {
179 if (node.parent is ConstructorDeclaration) { 178 if (node.parent is ConstructorDeclaration) {
180 } else { 179 } else {
181 computer._addRegionForNode(node, node.bestElement); 180 computer._addRegionForNode(node, node.bestElement);
182 } 181 }
183 return super.visitSimpleIdentifier(node); 182 return super.visitSimpleIdentifier(node);
184 } 183 }
185 } 184 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/computer/computer_occurrences.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698