Skip to content

Commit 508ad13

Browse files
srawlinsCommit Queue
authored andcommitted
analysis_server_plugin: Use new DiagnosticCode name
Work towards #60635 Change-Id: Ia021bc5a80f1e53407393454ab058f6b7c8a633a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425460 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent 3a9f433 commit 508ad13

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

pkg/analysis_server_plugin/lib/src/correction/fix_generators.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,23 @@ class _RegisteredFixGenerators {
2828

2929
final Map<LintCode, List<MultiProducerGenerator>> lintMultiProducers = {};
3030

31-
/// A map from error codes to a list of generators used to create multiple
32-
/// correction producers used to build fixes for those diagnostics.
31+
/// A map from diagnostic codes to a list of generators used to create
32+
/// multiple correction producers used to build fixes for those diagnostics.
3333
///
3434
/// The generators used for lint rules are in the [lintMultiProducers].
35-
final Map<ErrorCode, List<MultiProducerGenerator>> nonLintMultiProducers = {};
35+
final Map<DiagnosticCode, List<MultiProducerGenerator>>
36+
nonLintMultiProducers = {};
3637

3738
/// A set of generators that are used to create correction producers that
3839
/// produce corrections that ignore diagnostics locally.
3940
final Set<ProducerGenerator> ignoreProducerGenerators = {};
4041

41-
/// A map from error codes to a list of the generators that are used to create
42-
/// correction producers.
42+
/// A map from diagnostic codes to a list of the generators that are used to
43+
/// create correction producers.
4344
///
4445
/// The generators are then used to build fixes for those diagnostics. The
4546
/// generators used for lint rules are in the [lintProducers].
46-
final Map<ErrorCode, List<ProducerGenerator>> nonLintProducers = {};
47+
final Map<DiagnosticCode, List<ProducerGenerator>> nonLintProducers = {};
4748

4849
/// A map from lint codes to a list of fix generators that work with only
4950
/// parsed results.

pkg/analysis_server_plugin/lib/src/correction/fix_in_file_processor.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ final class FixInFileProcessor {
124124
}
125125
}
126126

127-
List<ProducerGenerator> _getGenerators(ErrorCode errorCode) {
128-
if (errorCode is LintCode) {
129-
return registeredFixGenerators.lintProducers[errorCode] ?? [];
127+
List<ProducerGenerator> _getGenerators(DiagnosticCode diagnosticCode) {
128+
if (diagnosticCode is LintCode) {
129+
return registeredFixGenerators.lintProducers[diagnosticCode] ?? [];
130130
} else {
131131
// TODO(pq): consider support for multi-generators.
132-
return registeredFixGenerators.nonLintProducers[errorCode] ?? [];
132+
return registeredFixGenerators.nonLintProducers[diagnosticCode] ?? [];
133133
}
134134
}
135135
}

0 commit comments

Comments
 (0)