| 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 domain.context; | 5 library domain.context; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
| 8 import 'package:analysis_server/src/protocol.dart'; | 8 import 'package:analysis_server/src/protocol.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 }); | 258 }); |
| 259 return sources; | 259 return sources; |
| 260 } | 260 } |
| 261 | 261 |
| 262 /** | 262 /** |
| 263 * Return the analysis context specified by the given request, or throw a | 263 * Return the analysis context specified by the given request, or throw a |
| 264 * [RequestFailure] exception if either there is no specified context or if | 264 * [RequestFailure] exception if either there is no specified context or if |
| 265 * the specified context does not exist. | 265 * the specified context does not exist. |
| 266 */ | 266 */ |
| 267 AnalysisContext getAnalysisContext(Request request) { | 267 AnalysisContext getAnalysisContext(Request request) { |
| 268 String contextId = request.getRequiredParameter(CONTEXT_ID_PARAM).asString()
; | 268 // TODO(scheglov) remove it after migrating to the new API |
| 269 AnalysisContext context = server.contextMap[contextId]; | 269 return null; |
| 270 if (context == null) { | 270 // String contextId = request.getRequiredParameter(CONTEXT_ID_PARAM).asString
(); |
| 271 throw new RequestFailure(new Response.contextDoesNotExist(request)); | 271 // AnalysisContext context = server.contextMap[contextId]; |
| 272 } | 272 // if (context == null) { |
| 273 return context; | 273 // throw new RequestFailure(new Response.contextDoesNotExist(request)); |
| 274 // } |
| 275 // return context; |
| 274 } | 276 } |
| 275 } | 277 } |
| OLD | NEW |