mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-28 16:39:00 +01:00
create problem collector when no problem matchers, but don't process lines (#176818)
This commit is contained in:
@@ -51,6 +51,7 @@ import { IOutputService } from 'vs/workbench/services/output/common/output';
|
||||
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
|
||||
import { IPathService } from 'vs/workbench/services/path/common/pathService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable } from 'xterm';
|
||||
|
||||
interface ITerminalData {
|
||||
terminal: ITerminalInstance;
|
||||
@@ -838,8 +839,8 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
|
||||
let terminal: ITerminalInstance | undefined = undefined;
|
||||
let error: TaskError | undefined = undefined;
|
||||
let promise: Promise<ITaskSummary> | undefined = undefined;
|
||||
const problemMatchers = await this._resolveMatchers(resolver, task.configurationProperties.problemMatchers);
|
||||
if (task.configurationProperties.isBackground && problemMatchers.length) {
|
||||
if (task.configurationProperties.isBackground) {
|
||||
const problemMatchers = await this._resolveMatchers(resolver, task.configurationProperties.problemMatchers);
|
||||
const watchingProblemMatcher = new WatchingProblemCollector(problemMatchers, this._markerService, this._modelService, this._fileService);
|
||||
if ((problemMatchers.length > 0) && !watchingProblemMatcher.isWatching()) {
|
||||
this._appendOutput(nls.localize('TerminalTaskSystem.nonWatchingMatcher', 'Task {0} is a background task but uses a problem matcher without a background pattern', task._label));
|
||||
@@ -896,20 +897,25 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
|
||||
this._logService.error('Task terminal process never got ready');
|
||||
});
|
||||
this._fireTaskEvent(TaskEvent.create(TaskEventKind.Start, task, terminal.instanceId, resolver.values));
|
||||
const onData = terminal.onLineData((line) => {
|
||||
watchingProblemMatcher.processLine(line);
|
||||
if (!delayer) {
|
||||
delayer = new Async.Delayer(3000);
|
||||
}
|
||||
delayer.trigger(() => {
|
||||
watchingProblemMatcher.forceDelivery();
|
||||
delayer = undefined;
|
||||
let onData: IDisposable | undefined;
|
||||
if (problemMatchers.length) {
|
||||
// prevent https://github.com/microsoft/vscode/issues/174511 from happening
|
||||
onData = terminal.onLineData((line) => {
|
||||
watchingProblemMatcher.processLine(line);
|
||||
if (!delayer) {
|
||||
delayer = new Async.Delayer(3000);
|
||||
}
|
||||
delayer.trigger(() => {
|
||||
watchingProblemMatcher.forceDelivery();
|
||||
delayer = undefined;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
promise = new Promise<ITaskSummary>((resolve, reject) => {
|
||||
const onExit = terminal!.onExit((terminalLaunchResult) => {
|
||||
const exitCode = typeof terminalLaunchResult === 'number' ? terminalLaunchResult : terminalLaunchResult?.code;
|
||||
onData.dispose();
|
||||
onData?.dispose();
|
||||
onExit.dispose();
|
||||
const key = task.getMapKey();
|
||||
if (this._busyTasks[mapKey]) {
|
||||
|
||||
Reference in New Issue
Block a user