| OLD | NEW |
| 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 services.src.search.search_engine; | 5 library services.src.search.search_engine; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/services/index/index.dart'; | 9 import 'package:analysis_server/src/services/index/index.dart'; |
| 10 import 'package:analysis_server/src/services/search/search_engine.dart'; | 10 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 return requestor.merge(); | 134 return requestor.merge(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 Future<List<SearchMatch>> | 137 Future<List<SearchMatch>> |
| 138 _searchReferences_Field(PropertyInducingElement field) { | 138 _searchReferences_Field(PropertyInducingElement field) { |
| 139 PropertyAccessorElement getter = field.getter; | 139 PropertyAccessorElement getter = field.getter; |
| 140 PropertyAccessorElement setter = field.setter; | 140 PropertyAccessorElement setter = field.setter; |
| 141 _Requestor requestor = new _Requestor(_index); | 141 _Requestor requestor = new _Requestor(_index); |
| 142 // field itself | 142 // field itself |
| 143 requestor.add(field, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE); | 143 requestor.add(field, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE); |
| 144 requestor.add(field, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE); |
| 144 // getter | 145 // getter |
| 145 if (getter != null) { | 146 if (getter != null) { |
| 146 requestor.add(getter, IndexConstants.IS_REFERENCED_BY, MatchKind.READ); | 147 requestor.add(getter, IndexConstants.IS_REFERENCED_BY, MatchKind.READ); |
| 147 requestor.add(getter, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION); | 148 requestor.add(getter, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION); |
| 148 } | 149 } |
| 149 // setter | 150 // setter |
| 150 if (setter != null) { | 151 if (setter != null) { |
| 151 requestor.add(setter, IndexConstants.IS_REFERENCED_BY, MatchKind.WRITE); | 152 requestor.add(setter, IndexConstants.IS_REFERENCED_BY, MatchKind.WRITE); |
| 152 } | 153 } |
| 153 // done | 154 // done |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 }); | 234 }); |
| 234 futures.add(matchesFuture); | 235 futures.add(matchesFuture); |
| 235 } | 236 } |
| 236 | 237 |
| 237 Future<List<SearchMatch>> merge() { | 238 Future<List<SearchMatch>> merge() { |
| 238 return Future.wait(futures).then((List<List<SearchMatch>> matchesList) { | 239 return Future.wait(futures).then((List<List<SearchMatch>> matchesList) { |
| 239 return matchesList.expand((matches) => matches).toList(); | 240 return matchesList.expand((matches) => matches).toList(); |
| 240 }); | 241 }); |
| 241 } | 242 } |
| 242 } | 243 } |
| OLD | NEW |