Skip to content

Commit f624b0e

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Use type names from messages.yaml when documenting diagnostic params.
Changes the code generator for analyzer diagnostic messages so that when generating documentation for diagnostic message parameters, it uses the shared type names (those used in `messages.yaml`) rather than the analyzer-specific ones. In practice the only difference right now is that `Type` will be used instead of `DartType`. This paves the way for future CLs which will unify some of the analyzer and front_end logic for generating code from the `messages.yaml` files. Once that code is unified, there will be diagnostic messages with parameter types that the analyzer doesn't yet support. This change ensures that it will still be able to generate documentation for those messages. Change-Id: I6a6a696471f530aa1f8ddb6f8f73beba6a0c70b7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448229 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 07a9ac7 commit f624b0e

File tree

3 files changed

+124
-126
lines changed

3 files changed

+124
-126
lines changed

pkg/analyzer/lib/src/dart/error/ffi_code.g.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class FfiCode extends DiagnosticCodeWithExpectedTypes {
349349
);
350350

351351
/// Parameters:
352-
/// DartType p0: the type that is missing a native type annotation
352+
/// Type p0: the type that is missing a native type annotation
353353
/// String p1: the superclass which is extended by this field's class
354354
static const FfiTemplate<
355355
LocatableDiagnostic Function({required DartType p0, required String p1})
@@ -420,8 +420,8 @@ class FfiCode extends DiagnosticCodeWithExpectedTypes {
420420
);
421421

422422
/// Parameters:
423-
/// DartType p0: the type that should be a subtype
424-
/// DartType p1: the supertype that the subtype is compared to
423+
/// Type p0: the type that should be a subtype
424+
/// Type p1: the supertype that the subtype is compared to
425425
/// String p2: the name of the function whose invocation depends on this
426426
/// relationship
427427
static const FfiTemplate<
@@ -441,7 +441,7 @@ class FfiCode extends DiagnosticCodeWithExpectedTypes {
441441
);
442442

443443
/// Parameters:
444-
/// DartType p0: the return type that should be 'void'.
444+
/// Type p0: the return type that should be 'void'.
445445
static const FfiTemplate<LocatableDiagnostic Function({required DartType p0})>
446446
mustReturnVoid = FfiTemplate(
447447
'MUST_RETURN_VOID',
@@ -454,7 +454,7 @@ class FfiCode extends DiagnosticCodeWithExpectedTypes {
454454
);
455455

456456
/// Parameters:
457-
/// DartType p0: The invalid type.
457+
/// Type p0: The invalid type.
458458
static const FfiTemplate<LocatableDiagnostic Function({required DartType p0})>
459459
nativeFieldInvalidType = FfiTemplate(
460460
'NATIVE_FIELD_INVALID_TYPE',
@@ -527,7 +527,7 @@ class FfiCode extends DiagnosticCodeWithExpectedTypes {
527527
);
528528

529529
/// Parameters:
530-
/// DartType p0: the type that should be a valid dart:ffi native type.
530+
/// Type p0: the type that should be a valid dart:ffi native type.
531531
static const FfiTemplate<LocatableDiagnostic Function({required DartType p0})>
532532
nonNativeFunctionTypeArgumentToPointer = FfiTemplate(
533533
'NON_NATIVE_FUNCTION_TYPE_ARGUMENT_TO_POINTER',
@@ -553,7 +553,7 @@ class FfiCode extends DiagnosticCodeWithExpectedTypes {
553553

554554
/// Parameters:
555555
/// String p0: the name of the field
556-
/// DartType p1: the type of the field
556+
/// Type p1: the type of the field
557557
static const FfiTemplate<
558558
LocatableDiagnostic Function({required String p0, required DartType p1})
559559
>

0 commit comments

Comments
 (0)