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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 1751163002: Fix @override quick-fix to respect doc comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_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/correction/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 78fb2c427ed67076278948f3d86ddb0c338a513a..dc66c4507cf10a21a13bc34615905fef6e3bb430 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -2213,9 +2213,18 @@ class FixProcessor {
if (member == null) {
return;
}
- exitPosition = new Position(file, member.offset - 1);
+
+ //TODO(pq): migrate annotation edit building to change_builder
+
+ // Handle doc comments.
+ Token token = member.beginToken;
+ if (token is CommentToken) {
+ token = (token as CommentToken).parent;
+ }
+
+ exitPosition = new Position(file, token.offset - 1);
String indent = utils.getIndent(1);
- _addReplaceEdit(rf.rangeStartLength(member, 0), '@override$eol$indent');
+ _addReplaceEdit(rf.rangeStartLength(token, 0), '@override$eol$indent');
_addFix(DartFixKind.LINT_ADD_OVERRIDE, []);
}
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698