Skip to content

Commit f69d5dc

Browse files
danrubelcommit-bot@chromium.org
authored andcommitted
show analyzer details in dartfix
This updates dartfix to display details about the analysis process if the analysis server provides them. Change-Id: I0b2a7e8267b92e1eefd1ce90aa53a85cc91c48d1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105549 Commit-Queue: Dan Rubel <[email protected]> Auto-Submit: Dan Rubel <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent a3348ab commit f69d5dc

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

pkg/dartfix/lib/src/driver.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class Driver {
3535
showDescriptions('Recommended changes', result.suggestions);
3636
showDescriptions('Recommended changes that cannot be automatically applied',
3737
result.otherSuggestions);
38+
showDetails(result.details);
3839
if (result.suggestions.isEmpty) {
3940
logger.stdout('');
4041
logger.stdout(result.otherSuggestions.isNotEmpty
@@ -150,10 +151,25 @@ class Driver {
150151
}
151152
}
152153

154+
void showDetails(List<String> details) {
155+
if (details == null || details.isEmpty) {
156+
return;
157+
}
158+
logger.stdout('''
159+
160+
Analysis Details:
161+
''');
162+
for (String detail in details) {
163+
logger.stdout('''
164+
• $detail
165+
''');
166+
}
167+
}
168+
153169
void showFix(DartFix fix) {
154170
logger.stdout('''
155171
156-
* ${fix.name}''');
172+
${fix.name}''');
157173
if (fix.description != null) {
158174
for (String line in _indentAndWrapDescription(fix.description)) {
159175
logger.stdout(line);

0 commit comments

Comments
 (0)