| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 analysis_server.src.services.search.search_engine_internal; | 5 library analysis_server.src.services.search.search_engine_internal; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/services/correction/source_range.dart'; | 9 import 'package:analysis_server/src/services/correction/source_range.dart'; |
| 10 import 'package:analysis_server/src/services/index/index.dart'; | 10 import 'package:analysis_server/src/services/index/index.dart'; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 return matches; | 258 return matches; |
| 259 } | 259 } |
| 260 | 260 |
| 261 Future<List<SearchMatch>> _searchReferences_Local( | 261 Future<List<SearchMatch>> _searchReferences_Local( |
| 262 Element element, bool isRootNode(AstNode n)) async { | 262 Element element, bool isRootNode(AstNode n)) async { |
| 263 _LocalReferencesVisitor visitor = new _LocalReferencesVisitor(element); | 263 _LocalReferencesVisitor visitor = new _LocalReferencesVisitor(element); |
| 264 AstProvider astProvider = _getAstProvider(element.source.fullName); | 264 AstProvider astProvider = _getAstProvider(element.source.fullName); |
| 265 AstNode node = await astProvider.getResolvedNodeForElement(element); | 265 AstNode name = await astProvider.getResolvedNameForElement(element); |
| 266 AstNode enclosingNode = node?.getAncestor(isRootNode); | 266 AstNode enclosingNode = name?.getAncestor(isRootNode); |
| 267 enclosingNode?.accept(visitor); | 267 enclosingNode?.accept(visitor); |
| 268 return visitor.matches; | 268 return visitor.matches; |
| 269 } | 269 } |
| 270 | 270 |
| 271 Future<List<SearchMatch>> _searchReferences_Parameter( | 271 Future<List<SearchMatch>> _searchReferences_Parameter( |
| 272 ParameterElement parameter) async { | 272 ParameterElement parameter) async { |
| 273 List<SearchMatch> matches = <SearchMatch>[]; | 273 List<SearchMatch> matches = <SearchMatch>[]; |
| 274 matches.addAll(await _searchReferences(parameter)); | 274 matches.addAll(await _searchReferences(parameter)); |
| 275 matches.addAll(await _searchReferences_Local(parameter, (AstNode node) { | 275 matches.addAll(await _searchReferences_Local(parameter, (AstNode node) { |
| 276 AstNode parent = node.parent; | 276 AstNode parent = node.parent; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 _addMatch(node, kind); | 583 _addMatch(node, kind); |
| 584 } | 584 } |
| 585 } | 585 } |
| 586 | 586 |
| 587 void _addMatch(AstNode node, MatchKind kind) { | 587 void _addMatch(AstNode node, MatchKind kind) { |
| 588 bool isQualified = node.parent is Label; | 588 bool isQualified = node.parent is Label; |
| 589 matches.add(new SearchMatchImpl(context, libraryUri, unitUri, kind, | 589 matches.add(new SearchMatchImpl(context, libraryUri, unitUri, kind, |
| 590 rangeNode(node), true, isQualified)); | 590 rangeNode(node), true, isQualified)); |
| 591 } | 591 } |
| 592 } | 592 } |
| OLD | NEW |