@@ -844,16 +844,12 @@ const List<ErrorCode> errorCodeValues = [
844
844
TodoCode .TODO ,
845
845
];
846
846
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.
851
849
HashMap <String , ErrorCode > _uniqueNameToCodeMap;
852
850
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.
857
853
ErrorCode errorCodeByUniqueName (String uniqueName) {
858
854
if (_uniqueNameToCodeMap == null ) {
859
855
_uniqueNameToCodeMap = HashMap <String , ErrorCode >();
@@ -864,29 +860,21 @@ ErrorCode errorCodeByUniqueName(String uniqueName) {
864
860
return _uniqueNameToCodeMap[uniqueName];
865
861
}
866
862
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] .
872
866
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.
876
868
static const List <AnalysisError > NO_ERRORS = < AnalysisError > [];
877
869
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.
882
872
static Comparator <AnalysisError > FILE_COMPARATOR =
883
873
(AnalysisError o1, AnalysisError o2) =>
884
874
o1.source.shortName.compareTo (o2.source.shortName);
885
875
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.
890
878
static Comparator <AnalysisError > ERROR_CODE_COMPARATOR =
891
879
(AnalysisError o1, AnalysisError o2) {
892
880
ErrorCode errorCode1 = o1.errorCode;
@@ -902,40 +890,28 @@ class AnalysisError implements Diagnostic {
902
890
}
903
891
};
904
892
905
- /**
906
- * The error code associated with the error.
907
- */
893
+ /// The error code associated with the error.
908
894
final ErrorCode errorCode;
909
895
910
- /**
911
- * The message describing the problem.
912
- */
896
+ /// The message describing the problem.
913
897
DiagnosticMessage _problemMessage;
914
898
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.
919
901
List <DiagnosticMessage > _contextMessages;
920
902
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.
925
905
String _correction;
926
906
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.
930
908
final Source source;
931
909
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.
939
915
AnalysisError (this .source, int offset, int length, this .errorCode,
940
916
[List <Object > arguments,
941
917
List <DiagnosticMessage > contextMessages = const []]) {
@@ -952,9 +928,7 @@ class AnalysisError implements Diagnostic {
952
928
_contextMessages = contextMessages;
953
929
}
954
930
955
- /**
956
- * Initialize a newly created analysis error with given values.
957
- */
931
+ /// Initialize a newly created analysis error with given values.
958
932
AnalysisError .forValues (this .source, int offset, int length, this .errorCode,
959
933
String message, this ._correction,
960
934
{List <DiagnosticMessage > contextMessages = const []}) {
@@ -969,11 +943,9 @@ class AnalysisError implements Diagnostic {
969
943
@override
970
944
List <DiagnosticMessage > get contextMessages => _contextMessages;
971
945
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.
977
949
String get correction => _correction;
978
950
979
951
@override
@@ -987,22 +959,16 @@ class AnalysisError implements Diagnostic {
987
959
return hashCode;
988
960
}
989
961
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.
994
964
int get length => _problemMessage.length;
995
965
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.
1000
968
String get message => _problemMessage.message;
1001
969
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.
1006
972
int get offset => _problemMessage.offset;
1007
973
1008
974
@override
@@ -1063,10 +1029,8 @@ class AnalysisError implements Diagnostic {
1063
1029
return buffer.toString ();
1064
1030
}
1065
1031
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.
1070
1034
static List <AnalysisError > mergeLists (List <List <AnalysisError >> errorLists) {
1071
1035
Set <AnalysisError > errors = HashSet <AnalysisError >();
1072
1036
for (List <AnalysisError > errorList in errorLists) {
0 commit comments