Chromium Code Reviews| 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 analysis.server; | 5 library analysis.server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/analysis_logger.dart'; | 10 import 'package:analysis_server/src/analysis_logger.dart'; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 return getAnalysisContextForSource(getSource(path)); | 290 return getAnalysisContextForSource(getSource(path)); |
| 291 } | 291 } |
| 292 | 292 |
| 293 /** | 293 /** |
| 294 * Return the [AnalysisContext] that is used to analyze the given [source]. | 294 * Return the [AnalysisContext] that is used to analyze the given [source]. |
| 295 * Return `null` if there is no such context. | 295 * Return `null` if there is no such context. |
| 296 */ | 296 */ |
| 297 AnalysisContext getAnalysisContextForSource(Source source) { | 297 AnalysisContext getAnalysisContextForSource(Source source) { |
| 298 for (AnalysisContext context in folderMap.values) { | 298 for (AnalysisContext context in folderMap.values) { |
| 299 SourceKind kind = context.getKindOf(source); | 299 SourceKind kind = context.getKindOf(source); |
| 300 if (kind != null) { | 300 if (kind != SourceKind.UNKNOWN) { |
|
Brian Wilkerson
2014/12/15 20:26:53
I don't think this is adequate. Let's discuss.
Al
| |
| 301 return context; | 301 return context; |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 return null; | 304 return null; |
| 305 } | 305 } |
| 306 | 306 |
| 307 /** | 307 /** |
| 308 * Return the [AnalysisContext]s that are being used to analyze the analysis | 308 * Return the [AnalysisContext]s that are being used to analyze the analysis |
| 309 * roots. | 309 * roots. |
| 310 */ | 310 */ |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1067 * [packageUriResolver]. | 1067 * [packageUriResolver]. |
| 1068 */ | 1068 */ |
| 1069 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { | 1069 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { |
| 1070 List<UriResolver> resolvers = <UriResolver>[ | 1070 List<UriResolver> resolvers = <UriResolver>[ |
| 1071 new DartUriResolver(analysisServer.defaultSdk), | 1071 new DartUriResolver(analysisServer.defaultSdk), |
| 1072 new ResourceUriResolver(resourceProvider), | 1072 new ResourceUriResolver(resourceProvider), |
| 1073 packageUriResolver]; | 1073 packageUriResolver]; |
| 1074 return new SourceFactory(resolvers); | 1074 return new SourceFactory(resolvers); |
| 1075 } | 1075 } |
| 1076 } | 1076 } |
| OLD | NEW |