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

Side by Side Diff: pkg/analysis_server/lib/src/edit/edit_domain.dart

Issue 2843093002: Send re-analyze requests to plugins (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; 7 import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
8 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; 8 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart';
9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; 10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart';
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 List<SourceChange> changes = <SourceChange>[]; 150 List<SourceChange> changes = <SourceChange>[];
151 if (server.options.enableNewAnalysisDriver) { 151 if (server.options.enableNewAnalysisDriver) {
152 // 152 //
153 // Allow plugins to start computing assists. 153 // Allow plugins to start computing assists.
154 // 154 //
155 AnalysisDriver driver = server.getAnalysisDriver(file); 155 AnalysisDriver driver = server.getAnalysisDriver(file);
156 plugin.EditGetAssistsParams requestParams = 156 plugin.EditGetAssistsParams requestParams =
157 new plugin.EditGetAssistsParams(file, offset, length); 157 new plugin.EditGetAssistsParams(file, offset, length);
158 Map<PluginInfo, Future<plugin.Response>> pluginFutures = server 158 Map<PluginInfo, Future<plugin.Response>> pluginFutures = server
159 .pluginManager 159 .pluginManager
160 .broadcastRequest(driver.contextRoot, requestParams); 160 .broadcastRequest(requestParams, contextRoot: driver.contextRoot);
161 // 161 //
162 // Compute fixes associated with server-generated errors. 162 // Compute fixes associated with server-generated errors.
163 // 163 //
164 AnalysisResult result = await server.getAnalysisResult(file); 164 AnalysisResult result = await server.getAnalysisResult(file);
165 if (result != null) { 165 if (result != null) {
166 CompilationUnit unit = result.unit; 166 CompilationUnit unit = result.unit;
167 CompilationUnitElement compilationUnitElement = 167 CompilationUnitElement compilationUnitElement =
168 resolutionMap.elementDeclaredByCompilationUnit(unit); 168 resolutionMap.elementDeclaredByCompilationUnit(unit);
169 DartAssistContext dartAssistContext = new _DartAssistContextForValues( 169 DartAssistContext dartAssistContext = new _DartAssistContextForValues(
170 compilationUnitElement.source, 170 compilationUnitElement.source,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 List<AnalysisErrorFixes> errorFixesList = <AnalysisErrorFixes>[]; 224 List<AnalysisErrorFixes> errorFixesList = <AnalysisErrorFixes>[];
225 if (server.options.enableNewAnalysisDriver) { 225 if (server.options.enableNewAnalysisDriver) {
226 // 226 //
227 // Allow plugins to start computing fixes. 227 // Allow plugins to start computing fixes.
228 // 228 //
229 AnalysisDriver driver = server.getAnalysisDriver(file); 229 AnalysisDriver driver = server.getAnalysisDriver(file);
230 plugin.EditGetFixesParams requestParams = 230 plugin.EditGetFixesParams requestParams =
231 new plugin.EditGetFixesParams(file, offset); 231 new plugin.EditGetFixesParams(file, offset);
232 Map<PluginInfo, Future<plugin.Response>> pluginFutures = server 232 Map<PluginInfo, Future<plugin.Response>> pluginFutures = server
233 .pluginManager 233 .pluginManager
234 .broadcastRequest(driver.contextRoot, requestParams); 234 .broadcastRequest(requestParams, contextRoot: driver.contextRoot);
235 // 235 //
236 // Compute fixes associated with server-generated errors. 236 // Compute fixes associated with server-generated errors.
237 // 237 //
238 AnalysisResult result = await server.getAnalysisResult(file); 238 AnalysisResult result = await server.getAnalysisResult(file);
239 if (result != null) { 239 if (result != null) {
240 CompilationUnit unit = result.unit; 240 CompilationUnit unit = result.unit;
241 LineInfo lineInfo = result.lineInfo; 241 LineInfo lineInfo = result.lineInfo;
242 int requestLine = lineInfo.getLocation(offset).lineNumber; 242 int requestLine = lineInfo.getLocation(offset).lineNumber;
243 for (engine.AnalysisError error in result.errors) { 243 for (engine.AnalysisError error in result.errors) {
244 int errorLine = lineInfo.getLocation(error.offset).lineNumber; 244 int errorLine = lineInfo.getLocation(error.offset).lineNumber;
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 } 1070 }
1071 return new RefactoringStatus(); 1071 return new RefactoringStatus();
1072 } 1072 }
1073 } 1073 }
1074 1074
1075 /** 1075 /**
1076 * [_RefactoringManager] throws instances of this class internally to stop 1076 * [_RefactoringManager] throws instances of this class internally to stop
1077 * processing in a manager that was reset. 1077 * processing in a manager that was reset.
1078 */ 1078 */
1079 class _ResetError {} 1079 class _ResetError {}
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/domain_analysis.dart ('k') | pkg/analysis_server/lib/src/plugin/plugin_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698