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

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

Issue 770253003: Update local functions methods/functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/protocol_server.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 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analysis_server/src/protocol_server.dart' as protocol; 9 import 'package:analysis_server/src/protocol_server.dart' as protocol;
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 26 matching lines...) Expand all
37 if (element is FieldFormalParameterElement) { 37 if (element is FieldFormalParameterElement) {
38 element = (element as FieldFormalParameterElement).field; 38 element = (element as FieldFormalParameterElement).field;
39 } 39 }
40 if (element == null || element == DynamicElementImpl.instance) { 40 if (element == null || element == DynamicElementImpl.instance) {
41 return; 41 return;
42 } 42 }
43 if (element.location == null) { 43 if (element.location == null) {
44 return; 44 return;
45 } 45 }
46 int targetIndex = _addTarget(element); 46 int targetIndex = _addTarget(element);
47 // TODO(scheglov) Fix the enclosing element problem in the incremental
48 // resolver and remove this.
49 if (targetIndex == null) {
50 return;
51 }
52 regions.add( 47 regions.add(
53 new protocol.NavigationRegion(offset, length, <int>[targetIndex])); 48 new protocol.NavigationRegion(offset, length, <int>[targetIndex]));
54 } 49 }
55 50
56 int _addTarget(Element element) { 51 int _addTarget(Element element) {
57 int index = targetMap[element]; 52 int index = targetMap[element];
58 if (index == null) { 53 if (index == null) {
59 index = targets.length; 54 index = targets.length;
60 protocol.NavigationTarget target = 55 protocol.NavigationTarget target =
61 protocol.newNavigationTarget_fromElement(element, _addFile); 56 protocol.newNavigationTarget_fromElement(element, _addFile);
62 // TODO(scheglov) Fix the enclosing element problem in the incremental
63 // resolver and remove this.
64 if (target == null) {
65 return null;
66 }
67 targets.add(target); 57 targets.add(target);
68 targetMap[element] = index; 58 targetMap[element] = index;
69 } 59 }
70 return index; 60 return index;
71 } 61 }
72 62
73 int _addFile(String file) { 63 int _addFile(String file) {
74 int index = fileMap[file]; 64 int index = fileMap[file];
75 if (index == null) { 65 if (index == null) {
76 index = files.length; 66 index = files.length;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 Element element = node.bestElement; 244 Element element = node.bestElement;
255 computer._addRegionForNode(node, element); 245 computer._addRegionForNode(node, element);
256 } 246 }
257 247
258 void _safelyVisit(AstNode node) { 248 void _safelyVisit(AstNode node) {
259 if (node != null) { 249 if (node != null) {
260 node.accept(this); 250 node.accept(this);
261 } 251 }
262 } 252 }
263 } 253 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/protocol_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698