Merge pull request #201064 from jeanp413/fix-200430

Fix task progress indicator does not appear after the first time
This commit is contained in:
Megan Rogge 2023-12-18 11:01:32 -06:00 committed by GitHub
commit 5ce6349ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -960,6 +960,15 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
return Promise.reject(new Error(`Failed to create terminal for task ${task._label}`));
}
this._fireTaskEvent(TaskEvent.start(task, terminal.instanceId, resolver.values));
const mapKey = task.getMapKey();
this._busyTasks[mapKey] = task;
this._fireTaskEvent(TaskEvent.general(TaskEventKind.Active, task, terminal.instanceId));
const problemMatchers = await this._resolveMatchers(resolver, task.configurationProperties.problemMatchers);
const startStopProblemMatcher = new StartStopProblemCollector(problemMatchers, this._markerService, this._modelService, ProblemHandlingStrategy.Clean, this._fileService);
this._terminalStatusManager.addTerminal(task, terminal, startStopProblemMatcher);
let processStartedSignaled = false;
terminal.processReady.then(() => {
if (!processStartedSignaled) {
@ -969,13 +978,7 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
}, (_error) => {
// The process never got ready. Need to think how to handle this.
});
this._fireTaskEvent(TaskEvent.start(task, terminal.instanceId, resolver.values));
const mapKey = task.getMapKey();
this._busyTasks[mapKey] = task;
this._fireTaskEvent(TaskEvent.general(TaskEventKind.Active, task, terminal.instanceId));
const problemMatchers = await this._resolveMatchers(resolver, task.configurationProperties.problemMatchers);
const startStopProblemMatcher = new StartStopProblemCollector(problemMatchers, this._markerService, this._modelService, ProblemHandlingStrategy.Clean, this._fileService);
this._terminalStatusManager.addTerminal(task, terminal, startStopProblemMatcher);
const onData = terminal.onLineData((line) => {
startStopProblemMatcher.processLine(line);
});