Skip to content

Commit 8b98f2b

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Fix messages.yaml parameter documentation.
Fixes the documentatino in messages.yaml to account for the fact that: - A `parameters:` entry is now required. - At the time an error is reported, arguments can be supplied using a `withArguments` method. This approach allows for compile-time checking of the type and number of arguments. Change-Id: I6a6a69649e765d9894bb78456f53506c0570e1e6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448238 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 7edd29a commit 8b98f2b

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

pkg/analyzer/messages.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,21 @@
4444
# parameter. Placeholders in the `problemMessage` and `correctionMessage`
4545
# strings take the form `#NAME`.
4646
#
47-
# If a diagnostic takes no parameters, it should have an entry of the
47+
# If a diagnostic takes no parameters, it must have an entry of the
4848
# form `parameters: none`.
4949
#
50-
# At the time the analyzer reports the error, it supplies
51-
# substitutions to take the place of the `#NAME` placeholders in the
52-
# form of a list whose order matches the order of the key/value pairs
53-
# in the `parameters` map. In the future, a new mechanism will be
54-
# introduced to allow the substitutions to be supplied using named
55-
# arguments, and statically type checked using the specified
56-
# TYPEs. For now, the TYPEs are unused.
50+
# Errors can be reported in two ways:
51+
#
52+
# - The old way (deprecated): at the time the analyzer reports the
53+
# error, it supplies substitutions to take the place of the `#NAME`
54+
# placeholders in the form of a list whose order matches the order
55+
# of the key/value pairs in the `parameters` map. The number and
56+
# types of the supplied values are checked at runtime.
57+
#
58+
# - The new way: at the time the analyzer reports the error, it calls
59+
# the error code's `withArguments` method, supplying the
60+
# substitutions in the form of named parameters. The number and
61+
# types of the supplied values are checked at compile time.
5762

5863
AnalysisOptionsErrorCode:
5964
INCLUDED_FILE_PARSE_ERROR:

0 commit comments

Comments
 (0)