show progress while running the analysis server (#4525)
This commit is contained in:
parent
484c36f145
commit
1ff3a2a039
@ -10,6 +10,7 @@ import 'dart:io';
|
|||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
import 'package:yaml/yaml.dart' as yaml;
|
import 'package:yaml/yaml.dart' as yaml;
|
||||||
|
|
||||||
|
import '../base/logger.dart';
|
||||||
import '../base/utils.dart';
|
import '../base/utils.dart';
|
||||||
import '../cache.dart';
|
import '../cache.dart';
|
||||||
import '../dart/analysis.dart';
|
import '../dart/analysis.dart';
|
||||||
@ -299,18 +300,22 @@ class AnalyzeCommand extends FlutterCommand {
|
|||||||
Map<String, List<AnalysisError>> analysisErrors = <String, List<AnalysisError>>{};
|
Map<String, List<AnalysisError>> analysisErrors = <String, List<AnalysisError>>{};
|
||||||
Stopwatch analysisTimer;
|
Stopwatch analysisTimer;
|
||||||
int lastErrorCount = 0;
|
int lastErrorCount = 0;
|
||||||
|
Status analysisStatus;
|
||||||
|
|
||||||
void _handleAnalysisStatus(AnalysisServer server, bool isAnalyzing) {
|
void _handleAnalysisStatus(AnalysisServer server, bool isAnalyzing) {
|
||||||
if (isAnalyzing) {
|
if (isAnalyzing) {
|
||||||
|
analysisStatus?.cancel();
|
||||||
|
|
||||||
if (firstAnalysis) {
|
if (firstAnalysis) {
|
||||||
printStatus('Analyzing ${path.basename(Directory.current.path)}...');
|
analysisStatus = logger.startProgress('Analyzing ${path.basename(Directory.current.path)}...');
|
||||||
} else {
|
} else {
|
||||||
printStatus('');
|
analysisStatus = logger.startProgress('\nAnalyzing...');
|
||||||
}
|
}
|
||||||
|
|
||||||
analyzedPaths.clear();
|
analyzedPaths.clear();
|
||||||
analysisTimer = new Stopwatch()..start();
|
analysisTimer = new Stopwatch()..start();
|
||||||
} else {
|
} else {
|
||||||
|
analysisStatus?.stop(showElapsedTime: true);
|
||||||
analysisTimer.stop();
|
analysisTimer.stop();
|
||||||
|
|
||||||
// Sort and print errors.
|
// Sort and print errors.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user