Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tasks start and exit with code 0 notifications #8331

Merged
merged 1 commit into from
Aug 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions packages/task/src/browser/task-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { ApplicationShell, FrontendApplication, WidgetManager, WidgetOpenMode } from '@theia/core/lib/browser';
import { open, OpenerService } from '@theia/core/lib/browser/opener-service';
import { ILogger, CommandService } from '@theia/core/lib/common';
import { CommandService, ILogger } from '@theia/core/lib/common';
import { MessageService } from '@theia/core/lib/common/message-service';
import { Deferred } from '@theia/core/lib/common/promise-util';
import { QuickPickItem, QuickPickService } from '@theia/core/lib/common/quick-pick-service';
Expand All @@ -32,24 +32,24 @@ import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service
import { inject, injectable, named, postConstruct } from 'inversify';
import { DiagnosticSeverity, Range } from 'vscode-languageserver-types';
import {
ApplyToKind,
BackgroundTaskEndedEvent,
DependsOrder,
NamedProblemMatcher,
ProblemMatchData,
ProblemMatcher,
RevealKind,
RunTaskOption,
TaskConfiguration,
TaskConfigurationScope,
TaskCustomization,
TaskExitedEvent,
TaskInfo,
TaskOutputProcessedEvent,
BackgroundTaskEndedEvent,
TaskDefinition,
TaskServer,
TaskExitedEvent,
TaskIdentifier,
DependsOrder,
RevealKind,
ApplyToKind,
TaskInfo,
TaskOutputPresentation,
TaskConfigurationScope
TaskOutputProcessedEvent,
TaskServer
} from '../common';
import { TaskWatcher } from '../common/task-watcher';
import { ProvidedTaskConfigurations } from './provided-task-configurations';
Expand Down Expand Up @@ -203,9 +203,6 @@ export class TaskService implements TaskConfigurationClient {
terminateSignal: new Deferred<string | undefined>(),
isBackgroundTaskEnded: new Deferred<boolean | undefined>()
});
const taskConfig = event.config;
const taskIdentifier = taskConfig ? this.getTaskIdentifier(taskConfig) : event.taskId.toString();
this.messageService.info(`Task '${taskIdentifier}' has been started.`);
});

this.taskWatcher.onOutputProcessed(async (event: TaskOutputProcessedEvent) => {
Expand Down Expand Up @@ -300,10 +297,7 @@ export class TaskService implements TaskConfigurationClient {
const taskConfig = event.config;
const taskIdentifier = taskConfig ? this.getTaskIdentifier(taskConfig) : event.taskId.toString();
if (event.code !== undefined) {
const message = `Task '${taskIdentifier}' has exited with code ${event.code}.`;
if (event.code === 0) {
this.messageService.info(message);
} else {
if (event.code !== 0) {
const eventTaskConfig = event.config;
if (eventTaskConfig && eventTaskConfig.presentation && eventTaskConfig.presentation.reveal === RevealKind.Silent && event.terminalId) {
const terminal = this.terminalService.getByTerminalId(event.terminalId);
Expand All @@ -316,7 +310,7 @@ export class TaskService implements TaskConfigurationClient {
}
}
}
this.messageService.error(message);
this.messageService.error(`Task '${taskIdentifier}' has exited with code ${event.code}.`);
}
} else if (event.signal !== undefined) {
this.messageService.info(`Task '${taskIdentifier}' was terminated by signal ${event.signal}.`);
Expand Down