Skip to content

Commit 648b5e9

Browse files
srawlinscommit-bot@chromium.org
authored andcommitted
Use ///-style doc comments in analyzer/lib
Bug: #33892 Change-Id: I573cb81dca6462c571bd6bf7bf309a46fd628967 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152610 Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent 04dd5ed commit 648b5e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1200
-2224
lines changed

pkg/analyzer/lib/error/error.dart

Lines changed: 36 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -844,16 +844,12 @@ const List<ErrorCode> errorCodeValues = [
844844
TodoCode.TODO,
845845
];
846846

847-
/**
848-
* The lazy initialized map from [ErrorCode.uniqueName] to the [ErrorCode]
849-
* instance.
850-
*/
847+
/// The lazy initialized map from [ErrorCode.uniqueName] to the [ErrorCode]
848+
/// instance.
851849
HashMap<String, ErrorCode> _uniqueNameToCodeMap;
852850

853-
/**
854-
* Return the [ErrorCode] with the given [uniqueName], or `null` if not
855-
* found.
856-
*/
851+
/// Return the [ErrorCode] with the given [uniqueName], or `null` if not
852+
/// found.
857853
ErrorCode errorCodeByUniqueName(String uniqueName) {
858854
if (_uniqueNameToCodeMap == null) {
859855
_uniqueNameToCodeMap = HashMap<String, ErrorCode>();
@@ -864,29 +860,21 @@ ErrorCode errorCodeByUniqueName(String uniqueName) {
864860
return _uniqueNameToCodeMap[uniqueName];
865861
}
866862

867-
/**
868-
* An error discovered during the analysis of some Dart code.
869-
*
870-
* See [AnalysisErrorListener].
871-
*/
863+
/// An error discovered during the analysis of some Dart code.
864+
///
865+
/// See [AnalysisErrorListener].
872866
class AnalysisError implements Diagnostic {
873-
/**
874-
* An empty array of errors used when no errors are expected.
875-
*/
867+
/// An empty array of errors used when no errors are expected.
876868
static const List<AnalysisError> NO_ERRORS = <AnalysisError>[];
877869

878-
/**
879-
* A [Comparator] that sorts by the name of the file that the [AnalysisError]
880-
* was found.
881-
*/
870+
/// A [Comparator] that sorts by the name of the file that the [AnalysisError]
871+
/// was found.
882872
static Comparator<AnalysisError> FILE_COMPARATOR =
883873
(AnalysisError o1, AnalysisError o2) =>
884874
o1.source.shortName.compareTo(o2.source.shortName);
885875

886-
/**
887-
* A [Comparator] that sorts error codes first by their severity (errors
888-
* first, warnings second), and then by the error code type.
889-
*/
876+
/// A [Comparator] that sorts error codes first by their severity (errors
877+
/// first, warnings second), and then by the error code type.
890878
static Comparator<AnalysisError> ERROR_CODE_COMPARATOR =
891879
(AnalysisError o1, AnalysisError o2) {
892880
ErrorCode errorCode1 = o1.errorCode;
@@ -902,40 +890,28 @@ class AnalysisError implements Diagnostic {
902890
}
903891
};
904892

905-
/**
906-
* The error code associated with the error.
907-
*/
893+
/// The error code associated with the error.
908894
final ErrorCode errorCode;
909895

910-
/**
911-
* The message describing the problem.
912-
*/
896+
/// The message describing the problem.
913897
DiagnosticMessage _problemMessage;
914898

915-
/**
916-
* The context messages associated with the problem. This list will be empty
917-
* if there are no context messages.
918-
*/
899+
/// The context messages associated with the problem. This list will be empty
900+
/// if there are no context messages.
919901
List<DiagnosticMessage> _contextMessages;
920902

921-
/**
922-
* The correction to be displayed for this error, or `null` if there is no
923-
* correction information for this error.
924-
*/
903+
/// The correction to be displayed for this error, or `null` if there is no
904+
/// correction information for this error.
925905
String _correction;
926906

927-
/**
928-
* The source in which the error occurred, or `null` if unknown.
929-
*/
907+
/// The source in which the error occurred, or `null` if unknown.
930908
final Source source;
931909

932-
/**
933-
* Initialize a newly created analysis error. The error is associated with the
934-
* given [source] and is located at the given [offset] with the given
935-
* [length]. The error will have the given [errorCode] and the list of
936-
* [arguments] will be used to complete the message and correction. If any
937-
* [contextMessages] are provided, they will be recorded with the error.
938-
*/
910+
/// Initialize a newly created analysis error. The error is associated with
911+
/// the given [source] and is located at the given [offset] with the given
912+
/// [length]. The error will have the given [errorCode] and the list of
913+
/// [arguments] will be used to complete the message and correction. If any
914+
/// [contextMessages] are provided, they will be recorded with the error.
939915
AnalysisError(this.source, int offset, int length, this.errorCode,
940916
[List<Object> arguments,
941917
List<DiagnosticMessage> contextMessages = const []]) {
@@ -952,9 +928,7 @@ class AnalysisError implements Diagnostic {
952928
_contextMessages = contextMessages;
953929
}
954930

955-
/**
956-
* Initialize a newly created analysis error with given values.
957-
*/
931+
/// Initialize a newly created analysis error with given values.
958932
AnalysisError.forValues(this.source, int offset, int length, this.errorCode,
959933
String message, this._correction,
960934
{List<DiagnosticMessage> contextMessages = const []}) {
@@ -969,11 +943,9 @@ class AnalysisError implements Diagnostic {
969943
@override
970944
List<DiagnosticMessage> get contextMessages => _contextMessages;
971945

972-
/**
973-
* Return the template used to create the correction to be displayed for this
974-
* error, or `null` if there is no correction information for this error. The
975-
* correction should indicate how the user can fix the error.
976-
*/
946+
/// Return the template used to create the correction to be displayed for this
947+
/// error, or `null` if there is no correction information for this error. The
948+
/// correction should indicate how the user can fix the error.
977949
String get correction => _correction;
978950

979951
@override
@@ -987,22 +959,16 @@ class AnalysisError implements Diagnostic {
987959
return hashCode;
988960
}
989961

990-
/**
991-
* The number of characters from the offset to the end of the source which
992-
* encompasses the compilation error.
993-
*/
962+
/// The number of characters from the offset to the end of the source which
963+
/// encompasses the compilation error.
994964
int get length => _problemMessage.length;
995965

996-
/**
997-
* Return the message to be displayed for this error. The message should
998-
* indicate what is wrong and why it is wrong.
999-
*/
966+
/// Return the message to be displayed for this error. The message should
967+
/// indicate what is wrong and why it is wrong.
1000968
String get message => _problemMessage.message;
1001969

1002-
/**
1003-
* The character offset from the beginning of the source (zero based) where
1004-
* the error occurred.
1005-
*/
970+
/// The character offset from the beginning of the source (zero based) where
971+
/// the error occurred.
1006972
int get offset => _problemMessage.offset;
1007973

1008974
@override
@@ -1063,10 +1029,8 @@ class AnalysisError implements Diagnostic {
10631029
return buffer.toString();
10641030
}
10651031

1066-
/**
1067-
* Merge all of the errors in the lists in the given list of [errorLists] into
1068-
* a single list of errors.
1069-
*/
1032+
/// Merge all of the errors in the lists in the given list of [errorLists]
1033+
/// into a single list of errors.
10701034
static List<AnalysisError> mergeLists(List<List<AnalysisError>> errorLists) {
10711035
Set<AnalysisError> errors = HashSet<AnalysisError>();
10721036
for (List<AnalysisError> errorList in errorLists) {

0 commit comments

Comments
 (0)