@theia/task 1.65.0-next.47 → 1.65.0-next.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/quick-open-task.d.ts +2 -1
- package/lib/browser/quick-open-task.d.ts.map +1 -1
- package/lib/browser/quick-open-task.js +34 -23
- package/lib/browser/quick-open-task.js.map +1 -1
- package/lib/browser/task-configuration-manager.d.ts.map +1 -1
- package/lib/browser/task-configuration-manager.js +1 -1
- package/lib/browser/task-configuration-manager.js.map +1 -1
- package/lib/browser/task-problem-matcher-registry.d.ts.map +1 -1
- package/lib/browser/task-problem-matcher-registry.js +8 -8
- package/lib/browser/task-problem-matcher-registry.js.map +1 -1
- package/lib/browser/task-service.d.ts.map +1 -1
- package/lib/browser/task-service.js +20 -21
- package/lib/browser/task-service.js.map +1 -1
- package/lib/browser/task-templates.d.ts.map +1 -1
- package/lib/browser/task-templates.js +5 -4
- package/lib/browser/task-templates.js.map +1 -1
- package/lib/browser/task-terminal-widget-manager.d.ts.map +1 -1
- package/lib/browser/task-terminal-widget-manager.js +3 -2
- package/lib/browser/task-terminal-widget-manager.js.map +1 -1
- package/package.json +12 -12
- package/src/browser/quick-open-task.ts +33 -22
- package/src/browser/task-configuration-manager.ts +2 -2
- package/src/browser/task-problem-matcher-registry.ts +9 -9
- package/src/browser/task-service.ts +21 -22
- package/src/browser/task-templates.ts +5 -4
- package/src/browser/task-terminal-widget-manager.ts +3 -2
|
@@ -34,7 +34,7 @@ import { TriggerAction } from '@theia/monaco-editor-core/esm/vs/platform/quickin
|
|
|
34
34
|
|
|
35
35
|
export namespace ConfigureTaskAction {
|
|
36
36
|
export const ID = 'workbench.action.tasks.configureTaskRunner';
|
|
37
|
-
export const TEXT = 'Configure Task';
|
|
37
|
+
export const TEXT = nls.localizeByDefault('Configure Task');
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export type TaskEntry = QuickPickItemOrSeparator | QuickPickValue<string>;
|
|
@@ -47,12 +47,13 @@ export namespace TaskEntry {
|
|
|
47
47
|
export const CHOOSE_TASK = nls.localizeByDefault('Select the task to run');
|
|
48
48
|
export const CONFIGURE_A_TASK = nls.localizeByDefault('Configure a Task');
|
|
49
49
|
export const NO_TASK_TO_RUN = nls.localize('theia/task/noTaskToRun', 'No task to run found. Configure Tasks...');
|
|
50
|
+
export const NO_TASKS_FOUND = nls.localize('theia/task/noTasksFound', 'No tasks found');
|
|
50
51
|
export const SHOW_ALL = nls.localizeByDefault('Show All Tasks...');
|
|
51
52
|
|
|
52
53
|
@injectable()
|
|
53
54
|
export class QuickOpenTask implements QuickAccessProvider {
|
|
54
55
|
static readonly PREFIX = 'task ';
|
|
55
|
-
readonly description: string = 'Run Task';
|
|
56
|
+
readonly description: string = nls.localizeByDefault('Run Task');
|
|
56
57
|
protected items: Array<TaskEntry> = [];
|
|
57
58
|
|
|
58
59
|
@inject(TaskService)
|
|
@@ -98,8 +99,8 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
98
99
|
const isMulti: boolean = this.workspaceService.isMultiRootWorkspaceOpened;
|
|
99
100
|
this.items = [];
|
|
100
101
|
|
|
101
|
-
const filteredRecentTasksItems = this.getItems(filteredRecentTasks, 'recently used tasks', token, isMulti);
|
|
102
|
-
const filteredConfiguredTasksItems = this.getItems(filteredConfiguredTasks, 'configured tasks', token, isMulti, {
|
|
102
|
+
const filteredRecentTasksItems = this.getItems(filteredRecentTasks, nls.localizeByDefault('recently used tasks'), token, isMulti);
|
|
103
|
+
const filteredConfiguredTasksItems = this.getItems(filteredConfiguredTasks, nls.localizeByDefault('configured tasks'), token, isMulti, {
|
|
103
104
|
label: `$(plus) ${CONFIGURE_A_TASK}`,
|
|
104
105
|
execute: () => this.configure()
|
|
105
106
|
});
|
|
@@ -238,7 +239,7 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
238
239
|
this.taskService.getRunningTasks().then(tasks => {
|
|
239
240
|
if (!tasks.length) {
|
|
240
241
|
this.items.push({
|
|
241
|
-
label:
|
|
242
|
+
label: NO_TASKS_FOUND,
|
|
242
243
|
});
|
|
243
244
|
} else {
|
|
244
245
|
tasks.forEach((task: TaskInfo) => {
|
|
@@ -259,7 +260,7 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
259
260
|
}
|
|
260
261
|
if (this.items.length === 0) {
|
|
261
262
|
this.items.push(({
|
|
262
|
-
label:
|
|
263
|
+
label: NO_TASKS_FOUND
|
|
263
264
|
}));
|
|
264
265
|
}
|
|
265
266
|
this.quickInputService?.showQuickPick(this.items, { placeholder: CHOOSE_TASK });
|
|
@@ -306,7 +307,7 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
306
307
|
const { configUri } = this.preferences.resolve('tasks', [], rootFolder);
|
|
307
308
|
const existTaskConfigFile = !!configUri;
|
|
308
309
|
items.push(({
|
|
309
|
-
label: existTaskConfigFile ? 'Open tasks.json file' : 'Create tasks.json file from template',
|
|
310
|
+
label: existTaskConfigFile ? nls.localizeByDefault('Open tasks.json file') : nls.localizeByDefault('Create tasks.json file from template'),
|
|
310
311
|
execute: () => {
|
|
311
312
|
setTimeout(() => this.taskConfigurationManager.openConfiguration(rootFolder));
|
|
312
313
|
}
|
|
@@ -322,7 +323,7 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
322
323
|
|
|
323
324
|
if (items.length === 0) {
|
|
324
325
|
items.push(({
|
|
325
|
-
label:
|
|
326
|
+
label: NO_TASKS_FOUND
|
|
326
327
|
}));
|
|
327
328
|
}
|
|
328
329
|
|
|
@@ -385,7 +386,9 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
385
386
|
this.items = buildOrTestTasks;
|
|
386
387
|
} else { // no build / test tasks, display an action item to configure the build / test task
|
|
387
388
|
this.items = [({
|
|
388
|
-
label:
|
|
389
|
+
label: shouldRunBuildTask
|
|
390
|
+
? nls.localizeByDefault('No build task to run found. Configure Build Task...')
|
|
391
|
+
: nls.localizeByDefault('No test task to run found. Configure Tasks...'),
|
|
389
392
|
execute: () => {
|
|
390
393
|
this.doInit(token).then(() => {
|
|
391
394
|
// update the `tasks.json` file, instead of running the task itself
|
|
@@ -400,20 +403,28 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
400
403
|
this.taskDefinitionRegistry,
|
|
401
404
|
this.taskSourceResolver
|
|
402
405
|
));
|
|
403
|
-
this.quickInputService?.showQuickPick(this.items, {
|
|
406
|
+
this.quickInputService?.showQuickPick(this.items, {
|
|
407
|
+
placeholder: shouldRunBuildTask
|
|
408
|
+
? nls.localizeByDefault('Select the task to be used as the default build task')
|
|
409
|
+
: nls.localizeByDefault('Select the task to be used as the default test task')
|
|
410
|
+
});
|
|
404
411
|
});
|
|
405
412
|
}
|
|
406
413
|
})];
|
|
407
414
|
}
|
|
408
415
|
} else { // no tasks are currently present, prompt users if they'd like to configure a task.
|
|
409
416
|
this.items = [{
|
|
410
|
-
label:
|
|
417
|
+
label: shouldRunBuildTask
|
|
418
|
+
? nls.localizeByDefault('No build task to run found. Configure Build Task...')
|
|
419
|
+
: nls.localizeByDefault('No test task to run found. Configure Tasks...'),
|
|
411
420
|
execute: () => this.configure()
|
|
412
421
|
}];
|
|
413
422
|
}
|
|
414
423
|
|
|
415
424
|
this.quickInputService?.showQuickPick(this.items, {
|
|
416
|
-
placeholder:
|
|
425
|
+
placeholder: shouldRunBuildTask
|
|
426
|
+
? nls.localizeByDefault('Select the build task to run')
|
|
427
|
+
: nls.localizeByDefault('Select the test task to run'),
|
|
417
428
|
onDidTriggerItemButton: ({ item }) => this.onDidTriggerGearIcon(item)
|
|
418
429
|
});
|
|
419
430
|
}
|
|
@@ -427,8 +438,8 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
427
438
|
this.quickAccessRegistry.registerQuickAccessProvider({
|
|
428
439
|
getInstance: () => this,
|
|
429
440
|
prefix: QuickOpenTask.PREFIX,
|
|
430
|
-
placeholder: 'Select the task to run',
|
|
431
|
-
helpEntries: [{ description: 'Run Task', needsEditor: false }]
|
|
441
|
+
placeholder: nls.localizeByDefault('Select the task to run'),
|
|
442
|
+
helpEntries: [{ description: nls.localizeByDefault('Run Task'), needsEditor: false }]
|
|
432
443
|
});
|
|
433
444
|
}
|
|
434
445
|
|
|
@@ -442,7 +453,7 @@ export class QuickOpenTask implements QuickAccessProvider {
|
|
|
442
453
|
new TaskRunQuickOpenItem(token, task, this.taskService, isMulti, this.taskDefinitionRegistry, this.taskNameResolver,
|
|
443
454
|
this.taskSourceResolver, this.taskConfigurationManager, [{
|
|
444
455
|
iconClass: 'codicon-gear',
|
|
445
|
-
tooltip: 'Configure Task',
|
|
456
|
+
tooltip: nls.localizeByDefault('Configure Task'),
|
|
446
457
|
}])
|
|
447
458
|
).sort((t1, t2) => {
|
|
448
459
|
let result = (t1.description ?? '').localeCompare(t2.description ?? '');
|
|
@@ -652,7 +663,7 @@ export class TaskTerminateQuickOpen {
|
|
|
652
663
|
const isMulti: boolean = this.workspaceService.isMultiRootWorkspaceOpened;
|
|
653
664
|
if (runningTasks.length <= 0) {
|
|
654
665
|
items.push(({
|
|
655
|
-
label: 'No task is currently running',
|
|
666
|
+
label: nls.localizeByDefault('No task is currently running'),
|
|
656
667
|
}));
|
|
657
668
|
} else {
|
|
658
669
|
runningTasks.forEach((task: TaskInfo) => {
|
|
@@ -669,7 +680,7 @@ export class TaskTerminateQuickOpen {
|
|
|
669
680
|
});
|
|
670
681
|
if (runningTasks.length > 1) {
|
|
671
682
|
items.push(({
|
|
672
|
-
label: 'All
|
|
683
|
+
label: nls.localizeByDefault('All Running Tasks'),
|
|
673
684
|
execute: () => {
|
|
674
685
|
runningTasks.forEach((t: TaskInfo) => {
|
|
675
686
|
this.taskService.kill(t.taskId);
|
|
@@ -683,7 +694,7 @@ export class TaskTerminateQuickOpen {
|
|
|
683
694
|
|
|
684
695
|
async open(): Promise<void> {
|
|
685
696
|
const items = await this.getItems();
|
|
686
|
-
this.quickInputService?.showQuickPick(items, { placeholder: 'Select task to terminate' });
|
|
697
|
+
this.quickInputService?.showQuickPick(items, { placeholder: nls.localizeByDefault('Select a task to terminate') });
|
|
687
698
|
}
|
|
688
699
|
}
|
|
689
700
|
|
|
@@ -719,7 +730,7 @@ export class TaskRunningQuickOpen {
|
|
|
719
730
|
const isMulti: boolean = this.workspaceService.isMultiRootWorkspaceOpened;
|
|
720
731
|
if (runningTasks.length <= 0) {
|
|
721
732
|
items.push(({
|
|
722
|
-
label: 'No task is currently running',
|
|
733
|
+
label: nls.localizeByDefault('No task is currently running'),
|
|
723
734
|
}));
|
|
724
735
|
} else {
|
|
725
736
|
runningTasks.forEach((task: TaskInfo) => {
|
|
@@ -747,7 +758,7 @@ export class TaskRunningQuickOpen {
|
|
|
747
758
|
|
|
748
759
|
async open(): Promise<void> {
|
|
749
760
|
const items = await this.getItems();
|
|
750
|
-
this.quickInputService?.showQuickPick(items, { placeholder: 'Select the task to show its output' });
|
|
761
|
+
this.quickInputService?.showQuickPick(items, { placeholder: nls.localizeByDefault('Select the task to show its output') });
|
|
751
762
|
}
|
|
752
763
|
}
|
|
753
764
|
|
|
@@ -805,7 +816,7 @@ export class TaskRestartRunningQuickOpen {
|
|
|
805
816
|
const isMulti: boolean = this.workspaceService.isMultiRootWorkspaceOpened;
|
|
806
817
|
if (runningTasks.length <= 0) {
|
|
807
818
|
items.push({
|
|
808
|
-
label: 'No task to restart'
|
|
819
|
+
label: nls.localizeByDefault('No task to restart')
|
|
809
820
|
});
|
|
810
821
|
} else {
|
|
811
822
|
runningTasks.forEach((task: TaskInfo) => {
|
|
@@ -826,6 +837,6 @@ export class TaskRestartRunningQuickOpen {
|
|
|
826
837
|
|
|
827
838
|
async open(): Promise<void> {
|
|
828
839
|
const items = await this.getItems();
|
|
829
|
-
this.quickInputService?.showQuickPick(items, { placeholder: 'Select task to restart' });
|
|
840
|
+
this.quickInputService?.showQuickPick(items, { placeholder: nls.localizeByDefault('Select the task to restart') });
|
|
830
841
|
}
|
|
831
842
|
}
|
|
@@ -20,7 +20,7 @@ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify'
|
|
|
20
20
|
import URI from '@theia/core/lib/common/uri';
|
|
21
21
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
22
22
|
import { EditorManager, EditorWidget } from '@theia/editor/lib/browser';
|
|
23
|
-
import { PreferenceScope, PreferenceService, DisposableCollection, PreferenceProviderProvider } from '@theia/core/lib/common';
|
|
23
|
+
import { PreferenceScope, PreferenceService, DisposableCollection, PreferenceProviderProvider, nls } from '@theia/core/lib/common';
|
|
24
24
|
import { QuickPickService } from '@theia/core/lib/common/quick-pick-service';
|
|
25
25
|
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
26
26
|
import { TaskConfigurationModel } from './task-configuration-model';
|
|
@@ -211,7 +211,7 @@ export class TaskConfigurationManager {
|
|
|
211
211
|
|
|
212
212
|
protected async getInitialConfigurationContent(): Promise<string | undefined> {
|
|
213
213
|
const selected = await this.quickPickService.show(this.taskTemplateSelector.selectTemplates(), {
|
|
214
|
-
placeholder: 'Select a Task Template'
|
|
214
|
+
placeholder: nls.localizeByDefault('Select a Task Template')
|
|
215
215
|
});
|
|
216
216
|
if (selected) {
|
|
217
217
|
return selected.value?.content;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*--------------------------------------------------------------------------------------------*/
|
|
21
21
|
|
|
22
22
|
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
23
|
-
import { Event, Emitter } from '@theia/core/lib/common';
|
|
23
|
+
import { Event, Emitter, nls } from '@theia/core/lib/common';
|
|
24
24
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
25
25
|
import {
|
|
26
26
|
ApplyToKind, FileLocationKind, NamedProblemMatcher,
|
|
@@ -223,7 +223,7 @@ export class ProblemMatcherRegistry {
|
|
|
223
223
|
private fillDefaults(): void {
|
|
224
224
|
this.add({
|
|
225
225
|
name: 'msCompile',
|
|
226
|
-
label: 'Microsoft compiler problems',
|
|
226
|
+
label: nls.localizeByDefault('Microsoft compiler problems'),
|
|
227
227
|
owner: 'msCompile',
|
|
228
228
|
applyTo: ApplyToKind.allDocuments,
|
|
229
229
|
fileLocation: FileLocationKind.Absolute,
|
|
@@ -232,7 +232,7 @@ export class ProblemMatcherRegistry {
|
|
|
232
232
|
|
|
233
233
|
this.add({
|
|
234
234
|
name: 'lessCompile',
|
|
235
|
-
label: 'Less problems',
|
|
235
|
+
label: nls.localizeByDefault('Less problems'),
|
|
236
236
|
deprecated: true,
|
|
237
237
|
owner: 'lessCompile',
|
|
238
238
|
source: 'less',
|
|
@@ -244,7 +244,7 @@ export class ProblemMatcherRegistry {
|
|
|
244
244
|
|
|
245
245
|
this.add({
|
|
246
246
|
name: 'gulp-tsc',
|
|
247
|
-
label: 'Gulp TSC Problems',
|
|
247
|
+
label: nls.localizeByDefault('Gulp TSC Problems'),
|
|
248
248
|
owner: 'typescript',
|
|
249
249
|
source: 'ts',
|
|
250
250
|
applyTo: ApplyToKind.closedDocuments,
|
|
@@ -255,7 +255,7 @@ export class ProblemMatcherRegistry {
|
|
|
255
255
|
|
|
256
256
|
this.add({
|
|
257
257
|
name: 'jshint',
|
|
258
|
-
label: 'JSHint problems',
|
|
258
|
+
label: nls.localizeByDefault('JSHint problems'),
|
|
259
259
|
owner: 'jshint',
|
|
260
260
|
source: 'jshint',
|
|
261
261
|
applyTo: ApplyToKind.allDocuments,
|
|
@@ -265,7 +265,7 @@ export class ProblemMatcherRegistry {
|
|
|
265
265
|
|
|
266
266
|
this.add({
|
|
267
267
|
name: 'jshint-stylish',
|
|
268
|
-
label: 'JSHint stylish problems',
|
|
268
|
+
label: nls.localizeByDefault('JSHint stylish problems'),
|
|
269
269
|
owner: 'jshint',
|
|
270
270
|
source: 'jshint',
|
|
271
271
|
applyTo: ApplyToKind.allDocuments,
|
|
@@ -275,7 +275,7 @@ export class ProblemMatcherRegistry {
|
|
|
275
275
|
|
|
276
276
|
this.add({
|
|
277
277
|
name: 'eslint-compact',
|
|
278
|
-
label: 'ESLint compact problems',
|
|
278
|
+
label: nls.localizeByDefault('ESLint compact problems'),
|
|
279
279
|
owner: 'eslint',
|
|
280
280
|
source: 'eslint',
|
|
281
281
|
applyTo: ApplyToKind.allDocuments,
|
|
@@ -286,7 +286,7 @@ export class ProblemMatcherRegistry {
|
|
|
286
286
|
|
|
287
287
|
this.add({
|
|
288
288
|
name: 'eslint-stylish',
|
|
289
|
-
label: 'ESLint stylish problems',
|
|
289
|
+
label: nls.localizeByDefault('ESLint stylish problems'),
|
|
290
290
|
owner: 'eslint',
|
|
291
291
|
source: 'eslint',
|
|
292
292
|
applyTo: ApplyToKind.allDocuments,
|
|
@@ -296,7 +296,7 @@ export class ProblemMatcherRegistry {
|
|
|
296
296
|
|
|
297
297
|
this.add({
|
|
298
298
|
name: 'go',
|
|
299
|
-
label: 'Go problems',
|
|
299
|
+
label: nls.localizeByDefault('Go problems'),
|
|
300
300
|
owner: 'go',
|
|
301
301
|
source: 'go',
|
|
302
302
|
applyTo: ApplyToKind.allDocuments,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { ApplicationShell, FrontendApplication, QuickPickValue, WidgetManager, WidgetOpenMode } from '@theia/core/lib/browser';
|
|
18
18
|
import { open, OpenerService } from '@theia/core/lib/browser/opener-service';
|
|
19
|
-
import { CommandService, ILogger } from '@theia/core/lib/common';
|
|
19
|
+
import { CommandService, ILogger, nls } from '@theia/core/lib/common';
|
|
20
20
|
import { MessageService } from '@theia/core/lib/common/message-service';
|
|
21
21
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
22
22
|
import { QuickPickItemOrSeparator, QuickPickService } from '@theia/core/lib/common/quick-pick-service';
|
|
@@ -326,10 +326,10 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
this.messageService.error(
|
|
329
|
+
this.messageService.error(nls.localize('theia/task/taskExitedWithCode', "Task '{0}' has exited with code {1}.", taskIdentifier, event.code));
|
|
330
330
|
}
|
|
331
331
|
} else if (event.signal !== undefined) {
|
|
332
|
-
this.messageService.info(
|
|
332
|
+
this.messageService.info(nls.localize('theia/task/taskTerminatedBySignal', "Task '{0}' was terminated by signal {1}."), taskIdentifier, event.signal);
|
|
333
333
|
} else {
|
|
334
334
|
console.error('Invalid TaskExitedEvent received, neither code nor signal is set.');
|
|
335
335
|
}
|
|
@@ -386,9 +386,9 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
386
386
|
isInvalidTaskConfigFileOpen = true;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
const warningMessage = 'Invalid task configurations are found. Open tasks.json and find details in the Problems view.';
|
|
389
|
+
const warningMessage = nls.localize('theia/task/invalidTaskConfigs', 'Invalid task configurations are found. Open tasks.json and find details in the Problems view.');
|
|
390
390
|
if (!isProblemsWidgetVisible || !isInvalidTaskConfigFileOpen) {
|
|
391
|
-
this.messageService.warn(warningMessage, 'Open').then(actionOpen => {
|
|
391
|
+
this.messageService.warn(warningMessage, nls.localizeByDefault('Open')).then(actionOpen => {
|
|
392
392
|
if (actionOpen) {
|
|
393
393
|
if (invalidTaskConfig && invalidTaskConfig._scope) {
|
|
394
394
|
this.taskConfigurationManager.openConfiguration(invalidTaskConfig._scope);
|
|
@@ -546,7 +546,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
546
546
|
// ask the user what s/he wants to use to parse the task output
|
|
547
547
|
const items = this.getCustomizeProblemMatcherItems();
|
|
548
548
|
const selected = await this.quickPickService.show(items, {
|
|
549
|
-
placeholder: 'Select for which kind of errors and warnings to scan the task output'
|
|
549
|
+
placeholder: nls.localizeByDefault('Select for which kind of errors and warnings to scan the task output')
|
|
550
550
|
});
|
|
551
551
|
if (selected && ('value' in selected)) {
|
|
552
552
|
if (selected.value?.problemMatchers) {
|
|
@@ -697,7 +697,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
697
697
|
taskNode.parentsID.filter(t => this.taskDefinitionRegistry.compareTasks(childTaskConfiguration, t)).length > 0) {
|
|
698
698
|
const fromNode = task.label;
|
|
699
699
|
const toNode = childTaskConfiguration.label;
|
|
700
|
-
throw new Error('Circular reference detected:
|
|
700
|
+
throw new Error(nls.localize('theia/task/circularReferenceDetected', 'Circular reference detected: {0} --> {1}', fromNode, toNode));
|
|
701
701
|
}
|
|
702
702
|
const childNode = new TaskNode(childTaskConfiguration, [], Object.assign([], taskNode.parentsID));
|
|
703
703
|
childNode.addParentDependency(taskNode.taskId);
|
|
@@ -713,7 +713,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
713
713
|
* @returns the correct TaskConfiguration object which matches the taskIdentifier
|
|
714
714
|
*/
|
|
715
715
|
getDependentTask(taskIdentifier: string | TaskIdentifier, tasks: TaskConfiguration[]): TaskConfiguration {
|
|
716
|
-
const notEnoughDataError = 'The information provided in the "dependsOn" is not enough for matching the correct task
|
|
716
|
+
const notEnoughDataError = nls.localize('theia/task/notEnoughDataInDependsOn', 'The information provided in the "dependsOn" is not enough for matching the correct task!');
|
|
717
717
|
let currentTaskChildConfiguration: TaskConfiguration;
|
|
718
718
|
if (typeof (taskIdentifier) !== 'string') {
|
|
719
719
|
// TaskIdentifier object does not support tasks of type 'shell' (The same behavior as in VS Code).
|
|
@@ -783,10 +783,12 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
const
|
|
787
|
-
|
|
786
|
+
const terminateTaskAction = nls.localizeByDefault('Terminate Task');
|
|
787
|
+
const restartTaskAction = nls.localizeByDefault('Restart Task');
|
|
788
|
+
const selectedAction = await this.messageService.info(nls.localizeByDefault("The task '{0}' is already active.", taskName), terminateTaskAction, restartTaskAction);
|
|
789
|
+
if (selectedAction === terminateTaskAction) {
|
|
788
790
|
await this.terminateTask(matchedRunningTaskInfo);
|
|
789
|
-
} else if (selectedAction ===
|
|
791
|
+
} else if (selectedAction === restartTaskAction) {
|
|
790
792
|
return this.restartTask(matchedRunningTaskInfo, option);
|
|
791
793
|
}
|
|
792
794
|
} else { // run task as the task is not active
|
|
@@ -1012,9 +1014,8 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
1012
1014
|
}
|
|
1013
1015
|
return taskInfo;
|
|
1014
1016
|
} catch (error) {
|
|
1015
|
-
|
|
1016
|
-
this.
|
|
1017
|
-
this.messageService.error(errorStr);
|
|
1017
|
+
this.logger.error(`Error launching task '${taskLabel}': ${error.message}`);
|
|
1018
|
+
this.messageService.error(nls.localize('theia/task/errorLaunchingTask', "Error launching task '{0}': {1}", taskLabel, error.message));
|
|
1018
1019
|
if (taskInfo && typeof taskInfo.terminalId === 'number') {
|
|
1019
1020
|
this.shellTerminalServer.onAttachAttempted(taskInfo.terminalId);
|
|
1020
1021
|
}
|
|
@@ -1024,15 +1025,15 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
1024
1025
|
protected getCustomizeProblemMatcherItems(): Array<QuickPickValue<QuickPickProblemMatcherItem> | QuickPickItemOrSeparator> {
|
|
1025
1026
|
const items: Array<QuickPickValue<QuickPickProblemMatcherItem> | QuickPickItemOrSeparator> = [];
|
|
1026
1027
|
items.push({
|
|
1027
|
-
label: 'Continue without scanning the task output',
|
|
1028
|
+
label: nls.localizeByDefault('Continue without scanning the task output'),
|
|
1028
1029
|
value: { problemMatchers: undefined }
|
|
1029
1030
|
});
|
|
1030
1031
|
items.push({
|
|
1031
|
-
label: 'Never scan the task output',
|
|
1032
|
+
label: nls.localize('theia/task/neverScanTaskOutput', 'Never scan the task output'),
|
|
1032
1033
|
value: { problemMatchers: [] }
|
|
1033
1034
|
});
|
|
1034
1035
|
items.push({
|
|
1035
|
-
label: 'Learn more about scanning the task output',
|
|
1036
|
+
label: nls.localizeByDefault('Learn more about scanning the task output'),
|
|
1036
1037
|
value: { problemMatchers: undefined, learnMore: true }
|
|
1037
1038
|
});
|
|
1038
1039
|
items.push({ type: 'separator', label: 'registered parsers' });
|
|
@@ -1077,7 +1078,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
1077
1078
|
if (taskInfo) {
|
|
1078
1079
|
const terminalWidget = this.terminalService.getByTerminalId(terminalId);
|
|
1079
1080
|
if (terminalWidget) {
|
|
1080
|
-
this.messageService.error('Task is already running in terminal');
|
|
1081
|
+
this.messageService.error(nls.localize('theia/task/taskAlreadyRunningInTerminal', 'Task is already running in terminal'));
|
|
1081
1082
|
return this.terminalService.open(terminalWidget, { mode: 'activate' });
|
|
1082
1083
|
}
|
|
1083
1084
|
if (TaskOutputPresentation.shouldAlwaysRevealTerminal(taskInfo.config)) {
|
|
@@ -1093,9 +1094,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
1093
1094
|
const widget = await this.taskTerminalWidgetManager.open({
|
|
1094
1095
|
created: new Date().toString(),
|
|
1095
1096
|
id: this.getTerminalWidgetId(terminalId),
|
|
1096
|
-
title: taskInfo
|
|
1097
|
-
? `Task: ${taskInfo.config.label}`
|
|
1098
|
-
: `Task: #${taskId}`,
|
|
1097
|
+
title: nls.localize('theia/task/taskTerminalTitle', 'Task: {0}', taskInfo.config.label || nls.localize('theia/task/taskIdLabel', '#{0}', taskId)),
|
|
1099
1098
|
destroyTermOnClose: true,
|
|
1100
1099
|
useServerTitle: false
|
|
1101
1100
|
}, {
|
|
@@ -1145,7 +1144,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
1145
1144
|
await this.taskServer.kill(id);
|
|
1146
1145
|
} catch (error) {
|
|
1147
1146
|
this.logger.error(`Error killing task '${id}': ${error}`);
|
|
1148
|
-
this.messageService.error(
|
|
1147
|
+
this.messageService.error(nls.localize('theia/task/errorKillingTask', "Error killing task '{0}': {1}", id, error));
|
|
1149
1148
|
return;
|
|
1150
1149
|
}
|
|
1151
1150
|
this.logger.debug(`Task killed. Task id: ${id}`);
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
import { injectable } from '@theia/core/shared/inversify';
|
|
22
22
|
import { QuickPickValue } from '@theia/core/lib/browser';
|
|
23
|
+
import { nls } from '@theia/core';
|
|
23
24
|
|
|
24
25
|
/** The representation of a task template used in the auto-generation of `tasks.json` */
|
|
25
26
|
export interface TaskTemplateEntry {
|
|
@@ -36,7 +37,7 @@ const dotnetBuild: TaskTemplateEntry = {
|
|
|
36
37
|
label: '.NET Core',
|
|
37
38
|
sort: 'NET Core',
|
|
38
39
|
autoDetect: false, // not supported in Theia
|
|
39
|
-
description: 'Executes .NET Core build command',
|
|
40
|
+
description: nls.localizeByDefault('Executes .NET Core build command'),
|
|
40
41
|
content: [
|
|
41
42
|
'{',
|
|
42
43
|
'\t// See https://go.microsoft.com/fwlink/?LinkId=733558',
|
|
@@ -69,7 +70,7 @@ const msbuild: TaskTemplateEntry = {
|
|
|
69
70
|
id: 'msbuild',
|
|
70
71
|
label: 'MSBuild',
|
|
71
72
|
autoDetect: false, // not supported in Theia
|
|
72
|
-
description: 'Executes the build target',
|
|
73
|
+
description: nls.localizeByDefault('Executes the build target'),
|
|
73
74
|
content: [
|
|
74
75
|
'{',
|
|
75
76
|
'\t// See https://go.microsoft.com/fwlink/?LinkId=733558',
|
|
@@ -105,7 +106,7 @@ const maven: TaskTemplateEntry = {
|
|
|
105
106
|
label: 'maven',
|
|
106
107
|
sort: 'MVN',
|
|
107
108
|
autoDetect: false, // not supported in Theia
|
|
108
|
-
description: 'Executes common maven commands',
|
|
109
|
+
description: nls.localizeByDefault('Executes common maven commands'),
|
|
109
110
|
content: [
|
|
110
111
|
'{',
|
|
111
112
|
'\t// See https://go.microsoft.com/fwlink/?LinkId=733558',
|
|
@@ -133,7 +134,7 @@ const command: TaskTemplateEntry = {
|
|
|
133
134
|
id: 'externalCommand',
|
|
134
135
|
label: 'Others',
|
|
135
136
|
autoDetect: false, // not supported in Theia
|
|
136
|
-
description: 'Example to run an arbitrary external command',
|
|
137
|
+
description: nls.localizeByDefault('Example to run an arbitrary external command'),
|
|
137
138
|
content: [
|
|
138
139
|
'{',
|
|
139
140
|
'\t// See https://go.microsoft.com/fwlink/?LinkId=733558',
|
|
@@ -24,6 +24,7 @@ import { ProcessTaskInfo } from '../common/process/task-protocol';
|
|
|
24
24
|
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
25
25
|
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
26
26
|
import URI from '@theia/core/lib/common/uri';
|
|
27
|
+
import { nls } from '@theia/core';
|
|
27
28
|
|
|
28
29
|
export interface TaskTerminalWidget extends TerminalWidget {
|
|
29
30
|
readonly kind: 'task';
|
|
@@ -157,7 +158,7 @@ export class TaskTerminalWidgetManager {
|
|
|
157
158
|
if (TaskTerminalWidgetOpenerOptions.echoExecutedCommand(openerOptions) &&
|
|
158
159
|
taskInfo && ProcessTaskInfo.is(taskInfo) && taskInfo.command && taskInfo.command.length > 0
|
|
159
160
|
) {
|
|
160
|
-
widget.writeLine(
|
|
161
|
+
widget.writeLine('\x1b[1m> ' + nls.localizeByDefault('Executing task: {0}', taskInfo.command) + ' <\x1b[0m\n');
|
|
161
162
|
}
|
|
162
163
|
return widget;
|
|
163
164
|
}
|
|
@@ -218,7 +219,7 @@ export class TaskTerminalWidgetManager {
|
|
|
218
219
|
terminal.close();
|
|
219
220
|
} else if (showReuseMessage) {
|
|
220
221
|
terminal.scrollToBottom();
|
|
221
|
-
terminal.writeLine('\x1b[1m\n\
|
|
222
|
+
terminal.writeLine('\x1b[1m\n\r' + nls.localize('theia/task/terminalWillBeReusedByTasks', 'Terminal will be reused by tasks.') + '\x1b[0m\n');
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
}
|