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

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

Issue 1522193002: Issue 25251. Fix for extracting string literal part with zero length. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/edit/refactoring_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
index f238cd554e5b1e5a398adb4f340dd3d4185aa04b..53ea9848dd2513be7cff57994114670f34fac28c 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
@@ -281,7 +281,8 @@ class ExtractLocalRefactoringImpl extends RefactoringImpl
}
// part of string literal
if (coveringNode is StringLiteral) {
- if (selectionRange.offset > coveringNode.offset &&
+ if (selectionRange.length != 0 &&
+ selectionRange.offset > coveringNode.offset &&
selectionRange.end < coveringNode.end) {
stringLiteralPart = selectionStr;
return new RefactoringStatus();
« no previous file with comments | « no previous file | pkg/analysis_server/test/edit/refactoring_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698