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

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

Issue 2842013003: Add support for watch events and error notifications (Closed)
Patch Set: fix comment Created 3 years, 7 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 int length = params.length; 148 int length = params.length;
149 149
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 = 158 Map<PluginInfo, Future<plugin.Response>> pluginFutures = server
159 server.pluginManager.broadcast(driver.contextRoot, requestParams); 159 .pluginManager
160 .broadcastRequest(driver.contextRoot, requestParams);
160 // 161 //
161 // Compute fixes associated with server-generated errors. 162 // Compute fixes associated with server-generated errors.
162 // 163 //
163 AnalysisResult result = await server.getAnalysisResult(file); 164 AnalysisResult result = await server.getAnalysisResult(file);
164 if (result != null) { 165 if (result != null) {
165 CompilationUnit unit = result.unit; 166 CompilationUnit unit = result.unit;
166 CompilationUnitElement compilationUnitElement = 167 CompilationUnitElement compilationUnitElement =
167 resolutionMap.elementDeclaredByCompilationUnit(unit); 168 resolutionMap.elementDeclaredByCompilationUnit(unit);
168 DartAssistContext dartAssistContext = new _DartAssistContextForValues( 169 DartAssistContext dartAssistContext = new _DartAssistContextForValues(
169 compilationUnitElement.source, 170 compilationUnitElement.source,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 int offset = params.offset; 222 int offset = params.offset;
222 223
223 List<AnalysisErrorFixes> errorFixesList = <AnalysisErrorFixes>[]; 224 List<AnalysisErrorFixes> errorFixesList = <AnalysisErrorFixes>[];
224 if (server.options.enableNewAnalysisDriver) { 225 if (server.options.enableNewAnalysisDriver) {
225 // 226 //
226 // Allow plugins to start computing fixes. 227 // Allow plugins to start computing fixes.
227 // 228 //
228 AnalysisDriver driver = server.getAnalysisDriver(file); 229 AnalysisDriver driver = server.getAnalysisDriver(file);
229 plugin.EditGetFixesParams requestParams = 230 plugin.EditGetFixesParams requestParams =
230 new plugin.EditGetFixesParams(file, offset); 231 new plugin.EditGetFixesParams(file, offset);
231 Map<PluginInfo, Future<plugin.Response>> pluginFutures = 232 Map<PluginInfo, Future<plugin.Response>> pluginFutures = server
232 server.pluginManager.broadcast(driver.contextRoot, requestParams); 233 .pluginManager
234 .broadcastRequest(driver.contextRoot, requestParams);
233 // 235 //
234 // Compute fixes associated with server-generated errors. 236 // Compute fixes associated with server-generated errors.
235 // 237 //
236 AnalysisResult result = await server.getAnalysisResult(file); 238 AnalysisResult result = await server.getAnalysisResult(file);
237 if (result != null) { 239 if (result != null) {
238 CompilationUnit unit = result.unit; 240 CompilationUnit unit = result.unit;
239 LineInfo lineInfo = result.lineInfo; 241 LineInfo lineInfo = result.lineInfo;
240 int requestLine = lineInfo.getLocation(offset).lineNumber; 242 int requestLine = lineInfo.getLocation(offset).lineNumber;
241 for (engine.AnalysisError error in result.errors) { 243 for (engine.AnalysisError error in result.errors) {
242 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
1068 } 1070 }
1069 return new RefactoringStatus(); 1071 return new RefactoringStatus();
1070 } 1072 }
1071 } 1073 }
1072 1074
1073 /** 1075 /**
1074 * [_RefactoringManager] throws instances of this class internally to stop 1076 * [_RefactoringManager] throws instances of this class internally to stop
1075 * processing in a manager that was reset. 1077 * processing in a manager that was reset.
1076 */ 1078 */
1077 class _ResetError {} 1079 class _ResetError {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698