Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: pkg/analysis_server/lib/plugin/edit/assist/assist_dart.dart

Issue 1582613010: Use getResolvedCompilationUnit2() instead of resolveCompilationUnit2() in QuickAssist and QuickFix … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698