[analysis_server] Fix location of ignore comments on getters with dartdocs
Fixes https://github.com/Dart-Code/Dart-Code/issues/4775 Change-Id: I7fd049f2f58ed677c5c4a8e5ab7450e54ae61c9c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329740 Reviewed-by: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
committed by
Brian Wilkerson
parent
feb486fdd4
commit
260b9b18f5
@@ -97,8 +97,9 @@ class IgnoreDiagnosticOnLine extends AbstractIgnoreDiagnostic {
|
||||
Future<void> compute(ChangeBuilder builder) async {
|
||||
if (_isCodeUnignorable()) return;
|
||||
|
||||
final diagnostic = this.diagnostic!; // Enforced by _isCodeUnignorable
|
||||
final insertDesc = CorrectionUtils_InsertDesc();
|
||||
insertDesc.offset = node.offset;
|
||||
insertDesc.offset = diagnostic.problemMessage.offset;
|
||||
await _computeEdit(
|
||||
builder,
|
||||
insertDesc,
|
||||
|
||||
@@ -148,6 +148,18 @@ void f() {
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> test_dartdoc_getter() async {
|
||||
await resolveTestCode('''
|
||||
/// AA
|
||||
String get _AA => '';
|
||||
''');
|
||||
await assertHasFix('''
|
||||
/// AA
|
||||
// ignore: unused_element
|
||||
String get _AA => '';
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> test_existingIgnore() async {
|
||||
await resolveTestCode('''
|
||||
void f() {
|
||||
|
||||
Reference in New Issue
Block a user