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

Side by Side Diff: pkg/analysis_server/lib/src/services/refactoring/extract_local.dart

Issue 462403005: Move Location factories and RefactoringProblemSeverity.max into the generated classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 services.src.refactoring.extract_local; 5 library services.src.refactoring.extract_local;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol2.dart' show Location, SourceEdit; 9 import 'package:analysis_server/src/protocol2.dart' show Location, SourceEdit;
10 import 'package:analysis_server/src/services/correction/change.dart'; 10 import 'package:analysis_server/src/services/correction/change.dart';
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 _invalidSelection(message, null); 376 _invalidSelection(message, null);
377 } 377 }
378 378
379 @override 379 @override
380 Object visitAssignmentExpression(AssignmentExpression node) { 380 Object visitAssignmentExpression(AssignmentExpression node) {
381 super.visitAssignmentExpression(node); 381 super.visitAssignmentExpression(node);
382 Expression lhs = node.leftHandSide; 382 Expression lhs = node.leftHandSide;
383 if (_isFirstSelectedNode(lhs)) { 383 if (_isFirstSelectedNode(lhs)) {
384 _invalidSelection( 384 _invalidSelection(
385 'Cannot extract the left-hand side of an assignment.', 385 'Cannot extract the left-hand side of an assignment.',
386 createLocation_forNode(lhs)); 386 new Location.forNode(lhs));
387 } 387 }
388 return null; 388 return null;
389 } 389 }
390 390
391 @override 391 @override
392 Object visitSimpleIdentifier(SimpleIdentifier node) { 392 Object visitSimpleIdentifier(SimpleIdentifier node) {
393 super.visitSimpleIdentifier(node); 393 super.visitSimpleIdentifier(node);
394 if (_isFirstSelectedNode(node)) { 394 if (_isFirstSelectedNode(node)) {
395 // name of declaration 395 // name of declaration
396 if (node.inDeclarationContext()) { 396 if (node.inDeclarationContext()) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 Token startToken = nodeTokens[startTokenIndex]; 529 Token startToken = nodeTokens[startTokenIndex];
530 Token endToken = nodeTokens[endTokenIndex]; 530 Token endToken = nodeTokens[endTokenIndex];
531 // add occurrence range 531 // add occurrence range
532 int occuStart = nodeOffset + startToken.offset; 532 int occuStart = nodeOffset + startToken.offset;
533 int occuEnd = nodeOffset + endToken.end; 533 int occuEnd = nodeOffset + endToken.end;
534 SourceRange occuRange = rangeStartEnd(occuStart, occuEnd); 534 SourceRange occuRange = rangeStartEnd(occuStart, occuEnd);
535 _addOccurrence(occuRange); 535 _addOccurrence(occuRange);
536 } 536 }
537 } 537 }
538 } 538 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698