| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.plugin.edit.assist.assist_dart; | 5 library analysis_server.plugin.edit.assist.assist_dart; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; | 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 AnalysisContext analysisContext = context.analysisContext; | 54 AnalysisContext analysisContext = context.analysisContext; |
| 55 Source source = context.source; | 55 Source source = context.source; |
| 56 if (!AnalysisEngine.isDartFileName(source.fullName)) { | 56 if (!AnalysisEngine.isDartFileName(source.fullName)) { |
| 57 return Assist.EMPTY_LIST; | 57 return Assist.EMPTY_LIST; |
| 58 } | 58 } |
| 59 List<Source> libraries = analysisContext.getLibrariesContaining(source); | 59 List<Source> libraries = analysisContext.getLibrariesContaining(source); |
| 60 if (libraries.isEmpty) { | 60 if (libraries.isEmpty) { |
| 61 return Assist.EMPTY_LIST; | 61 return Assist.EMPTY_LIST; |
| 62 } | 62 } |
| 63 CompilationUnit unit = | 63 CompilationUnit unit = |
| 64 analysisContext.resolveCompilationUnit2(source, libraries[0]); | 64 analysisContext.getResolvedCompilationUnit2(source, libraries[0]); |
| 65 if (unit == null) { | 65 if (unit == null) { |
| 66 return Assist.EMPTY_LIST; | 66 return Assist.EMPTY_LIST; |
| 67 } | 67 } |
| 68 DartAssistContext dartContext = new _DartAssistContextImpl(context, unit); | 68 DartAssistContext dartContext = new _DartAssistContextImpl(context, unit); |
| 69 return internalComputeAssists(dartContext); | 69 return internalComputeAssists(dartContext); |
| 70 } | 70 } |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * Completes with a list of assists for the given [context]. | 73 * Completes with a list of assists for the given [context]. |
| 74 */ | 74 */ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 103 /** | 103 /** |
| 104 * The start of the selection. | 104 * The start of the selection. |
| 105 */ | 105 */ |
| 106 int get selectionOffset => _context.selectionOffset; | 106 int get selectionOffset => _context.selectionOffset; |
| 107 | 107 |
| 108 /** | 108 /** |
| 109 * The source to get assists in. | 109 * The source to get assists in. |
| 110 */ | 110 */ |
| 111 Source get source => _context.source; | 111 Source get source => _context.source; |
| 112 } | 112 } |
| OLD | NEW |