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

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

Issue 793373004: Don't send a refactoring feedback in case of a fatal initial problem. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/statement_analyzer.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) 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 edit.domain; 5 library edit.domain;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/collections.dart'; 10 import 'package:analysis_server/src/collections.dart';
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // prepare for processing the request 247 // prepare for processing the request
248 requestId = request.id; 248 requestId = request.id;
249 result = new EditGetRefactoringResult( 249 result = new EditGetRefactoringResult(
250 EMPTY_PROBLEM_LIST, 250 EMPTY_PROBLEM_LIST,
251 EMPTY_PROBLEM_LIST, 251 EMPTY_PROBLEM_LIST,
252 EMPTY_PROBLEM_LIST); 252 EMPTY_PROBLEM_LIST);
253 // process the request 253 // process the request
254 var params = new EditGetRefactoringParams.fromRequest(request); 254 var params = new EditGetRefactoringParams.fromRequest(request);
255 _init(params.kind, params.file, params.offset, params.length).then((_) { 255 _init(params.kind, params.file, params.offset, params.length).then((_) {
256 if (initStatus.hasFatalError) { 256 if (initStatus.hasFatalError) {
257 feedback = null;
257 return _sendResultResponse(); 258 return _sendResultResponse();
258 } 259 }
259 // set options 260 // set options
260 if (_requiresOptions) { 261 if (_requiresOptions) {
261 if (params.options == null) { 262 if (params.options == null) {
262 optionsStatus = new RefactoringStatus(); 263 optionsStatus = new RefactoringStatus();
263 return _sendResultResponse(); 264 return _sendResultResponse();
264 } 265 }
265 optionsStatus = _setOptions(params); 266 optionsStatus = _setOptions(params);
266 if (_hasFatalError) { 267 if (_hasFatalError) {
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 offset = null; 447 offset = null;
447 length = null; 448 length = null;
448 refactoring = null; 449 refactoring = null;
449 feedback = null; 450 feedback = null;
450 initStatus = new RefactoringStatus(); 451 initStatus = new RefactoringStatus();
451 optionsStatus = new RefactoringStatus(); 452 optionsStatus = new RefactoringStatus();
452 finalStatus = new RefactoringStatus(); 453 finalStatus = new RefactoringStatus();
453 } 454 }
454 455
455 void _sendResultResponse() { 456 void _sendResultResponse() {
456 if (feedback != null) { 457 result.feedback = feedback;
457 result.feedback = feedback;
458 }
459 // set problems 458 // set problems
460 result.initialProblems = initStatus.problems; 459 result.initialProblems = initStatus.problems;
461 result.optionsProblems = optionsStatus.problems; 460 result.optionsProblems = optionsStatus.problems;
462 result.finalProblems = finalStatus.problems; 461 result.finalProblems = finalStatus.problems;
463 // send the response 462 // send the response
464 server.sendResponse(result.toResponse(requestId)); 463 server.sendResponse(result.toResponse(requestId));
465 // done with this request 464 // done with this request
466 requestId = null; 465 requestId = null;
467 result = null; 466 result = null;
468 } 467 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 } 501 }
503 if (refactoring is RenameRefactoring) { 502 if (refactoring is RenameRefactoring) {
504 RenameRefactoring renameRefactoring = refactoring; 503 RenameRefactoring renameRefactoring = refactoring;
505 RenameOptions renameOptions = params.options; 504 RenameOptions renameOptions = params.options;
506 renameRefactoring.newName = renameOptions.newName; 505 renameRefactoring.newName = renameOptions.newName;
507 return renameRefactoring.checkNewName(); 506 return renameRefactoring.checkNewName();
508 } 507 }
509 return new RefactoringStatus(); 508 return new RefactoringStatus();
510 } 509 }
511 } 510 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698