@theia/task 1.77.0-next.1 → 1.77.0-next.108
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/index.d.ts +6 -6
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +6 -9
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/process/process-task-contribution.d.ts +2 -2
- package/lib/browser/process/process-task-contribution.d.ts.map +1 -1
- package/lib/browser/process/process-task-contribution.js +8 -12
- package/lib/browser/process/process-task-contribution.js.map +1 -1
- package/lib/browser/process/process-task-frontend-module.js +7 -10
- package/lib/browser/process/process-task-frontend-module.js.map +1 -1
- package/lib/browser/process/process-task-resolver.d.ts +8 -4
- package/lib/browser/process/process-task-resolver.d.ts.map +1 -1
- package/lib/browser/process/process-task-resolver.js +50 -44
- package/lib/browser/process/process-task-resolver.js.map +1 -1
- package/lib/browser/process/process-task-resolver.spec.d.ts +2 -0
- package/lib/browser/process/process-task-resolver.spec.d.ts.map +1 -0
- package/lib/browser/process/process-task-resolver.spec.js +215 -0
- package/lib/browser/process/process-task-resolver.spec.js.map +1 -0
- package/lib/browser/provided-task-configurations.d.ts +3 -3
- package/lib/browser/provided-task-configurations.d.ts.map +1 -1
- package/lib/browser/provided-task-configurations.js +18 -23
- package/lib/browser/provided-task-configurations.js.map +1 -1
- package/lib/browser/provided-task-configurations.spec.js +14 -16
- package/lib/browser/provided-task-configurations.spec.js.map +1 -1
- package/lib/browser/quick-open-task.d.ts +7 -7
- package/lib/browser/quick-open-task.d.ts.map +1 -1
- package/lib/browser/quick-open-task.js +160 -199
- package/lib/browser/quick-open-task.js.map +1 -1
- package/lib/browser/task-configuration-manager.d.ts +4 -4
- package/lib/browser/task-configuration-manager.d.ts.map +1 -1
- package/lib/browser/task-configuration-manager.js +61 -77
- package/lib/browser/task-configuration-manager.js.map +1 -1
- package/lib/browser/task-configuration-model.d.ts +1 -1
- package/lib/browser/task-configuration-model.d.ts.map +1 -1
- package/lib/browser/task-configuration-model.js +8 -12
- package/lib/browser/task-configuration-model.js.map +1 -1
- package/lib/browser/task-configurations.d.ts +6 -6
- package/lib/browser/task-configurations.d.ts.map +1 -1
- package/lib/browser/task-configurations.js +41 -55
- package/lib/browser/task-configurations.js.map +1 -1
- package/lib/browser/task-context-key-service.js +13 -21
- package/lib/browser/task-context-key-service.js.map +1 -1
- package/lib/browser/task-contribution.d.ts +1 -1
- package/lib/browser/task-contribution.d.ts.map +1 -1
- package/lib/browser/task-contribution.js +20 -27
- package/lib/browser/task-contribution.js.map +1 -1
- package/lib/browser/task-definition-registry.d.ts +1 -1
- package/lib/browser/task-definition-registry.d.ts.map +1 -1
- package/lib/browser/task-definition-registry.js +12 -15
- package/lib/browser/task-definition-registry.js.map +1 -1
- package/lib/browser/task-definition-registry.spec.js +20 -22
- package/lib/browser/task-definition-registry.spec.js.map +1 -1
- package/lib/browser/task-frontend-contribution.d.ts +5 -5
- package/lib/browser/task-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/task-frontend-contribution.js +83 -106
- package/lib/browser/task-frontend-contribution.js.map +1 -1
- package/lib/browser/task-frontend-module.d.ts +1 -1
- package/lib/browser/task-frontend-module.d.ts.map +1 -1
- package/lib/browser/task-frontend-module.js +64 -66
- package/lib/browser/task-frontend-module.js.map +1 -1
- package/lib/browser/task-name-resolver.d.ts +3 -3
- package/lib/browser/task-name-resolver.d.ts.map +1 -1
- package/lib/browser/task-name-resolver.js +11 -16
- package/lib/browser/task-name-resolver.js.map +1 -1
- package/lib/browser/task-node.d.ts +1 -1
- package/lib/browser/task-node.d.ts.map +1 -1
- package/lib/browser/task-node.js +1 -5
- package/lib/browser/task-node.js.map +1 -1
- package/lib/browser/task-problem-matcher-registry.d.ts +2 -2
- package/lib/browser/task-problem-matcher-registry.d.ts.map +1 -1
- package/lib/browser/task-problem-matcher-registry.js +64 -72
- package/lib/browser/task-problem-matcher-registry.js.map +1 -1
- package/lib/browser/task-problem-pattern-registry.d.ts +1 -1
- package/lib/browser/task-problem-pattern-registry.d.ts.map +1 -1
- package/lib/browser/task-problem-pattern-registry.js +30 -37
- package/lib/browser/task-problem-pattern-registry.js.map +1 -1
- package/lib/browser/task-schema-updater.d.ts +4 -4
- package/lib/browser/task-schema-updater.d.ts.map +1 -1
- package/lib/browser/task-schema-updater.js +115 -126
- package/lib/browser/task-schema-updater.js.map +1 -1
- package/lib/browser/task-service.d.ts +14 -14
- package/lib/browser/task-service.d.ts.map +1 -1
- package/lib/browser/task-service.js +168 -202
- package/lib/browser/task-service.js.map +1 -1
- package/lib/browser/task-service.spec.d.ts +2 -0
- package/lib/browser/task-service.spec.d.ts.map +1 -0
- package/lib/browser/task-service.spec.js +91 -0
- package/lib/browser/task-service.spec.js.map +1 -0
- package/lib/browser/task-source-resolver.d.ts +2 -2
- package/lib/browser/task-source-resolver.d.ts.map +1 -1
- package/lib/browser/task-source-resolver.js +10 -14
- package/lib/browser/task-source-resolver.js.map +1 -1
- package/lib/browser/task-templates.js +10 -13
- package/lib/browser/task-templates.js.map +1 -1
- package/lib/browser/task-terminal-widget-manager.d.ts +2 -2
- package/lib/browser/task-terminal-widget-manager.d.ts.map +1 -1
- package/lib/browser/task-terminal-widget-manager.js +39 -50
- package/lib/browser/task-terminal-widget-manager.js.map +1 -1
- package/lib/browser/tasks-monaco-contribution.js +1 -3
- package/lib/browser/tasks-monaco-contribution.js.map +1 -1
- package/lib/common/index.d.ts +4 -4
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +4 -7
- package/lib/common/index.js.map +1 -1
- package/lib/common/problem-matcher-protocol.js +17 -20
- package/lib/common/problem-matcher-protocol.js.map +1 -1
- package/lib/common/process/task-protocol.d.ts +1 -1
- package/lib/common/process/task-protocol.d.ts.map +1 -1
- package/lib/common/process/task-protocol.js +6 -9
- package/lib/common/process/task-protocol.js.map +1 -1
- package/lib/common/task-common-module.js +3 -6
- package/lib/common/task-common-module.js.map +1 -1
- package/lib/common/task-preferences.js +10 -14
- package/lib/common/task-preferences.js.map +1 -1
- package/lib/common/task-protocol.d.ts +1 -1
- package/lib/common/task-protocol.d.ts.map +1 -1
- package/lib/common/task-protocol.js +15 -18
- package/lib/common/task-protocol.js.map +1 -1
- package/lib/common/task-util.js +2 -6
- package/lib/common/task-util.js.map +1 -1
- package/lib/common/task-watcher.d.ts +1 -1
- package/lib/common/task-watcher.d.ts.map +1 -1
- package/lib/common/task-watcher.js +12 -15
- package/lib/common/task-watcher.js.map +1 -1
- package/lib/node/custom/custom-task-runner-backend-module.js +14 -17
- package/lib/node/custom/custom-task-runner-backend-module.js.map +1 -1
- package/lib/node/custom/custom-task-runner-contribution.d.ts +2 -2
- package/lib/node/custom/custom-task-runner-contribution.d.ts.map +1 -1
- package/lib/node/custom/custom-task-runner-contribution.js +8 -12
- package/lib/node/custom/custom-task-runner-contribution.js.map +1 -1
- package/lib/node/custom/custom-task-runner.d.ts +4 -4
- package/lib/node/custom/custom-task-runner.d.ts.map +1 -1
- package/lib/node/custom/custom-task-runner.js +15 -21
- package/lib/node/custom/custom-task-runner.js.map +1 -1
- package/lib/node/custom/custom-task.d.ts +4 -4
- package/lib/node/custom/custom-task.d.ts.map +1 -1
- package/lib/node/custom/custom-task.js +15 -19
- package/lib/node/custom/custom-task.js.map +1 -1
- package/lib/node/index.d.ts +3 -3
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +3 -6
- package/lib/node/index.js.map +1 -1
- package/lib/node/process/process-task-runner-backend-module.js +14 -17
- package/lib/node/process/process-task-runner-backend-module.js.map +1 -1
- package/lib/node/process/process-task-runner-contribution.d.ts +2 -2
- package/lib/node/process/process-task-runner-contribution.d.ts.map +1 -1
- package/lib/node/process/process-task-runner-contribution.js +8 -12
- package/lib/node/process/process-task-runner-contribution.js.map +1 -1
- package/lib/node/process/process-task-runner.d.ts +5 -5
- package/lib/node/process/process-task-runner.d.ts.map +1 -1
- package/lib/node/process/process-task-runner.js +37 -44
- package/lib/node/process/process-task-runner.js.map +1 -1
- package/lib/node/process/process-task.d.ts +5 -5
- package/lib/node/process/process-task.d.ts.map +1 -1
- package/lib/node/process/process-task.js +16 -21
- package/lib/node/process/process-task.js.map +1 -1
- package/lib/node/process/process-task.spec.js +6 -8
- package/lib/node/process/process-task.spec.js.map +1 -1
- package/lib/node/task-abstract-line-matcher.d.ts +1 -1
- package/lib/node/task-abstract-line-matcher.d.ts.map +1 -1
- package/lib/node/task-abstract-line-matcher.js +28 -32
- package/lib/node/task-abstract-line-matcher.js.map +1 -1
- package/lib/node/task-backend-application-contribution.d.ts +1 -1
- package/lib/node/task-backend-application-contribution.d.ts.map +1 -1
- package/lib/node/task-backend-application-contribution.js +12 -17
- package/lib/node/task-backend-application-contribution.js.map +1 -1
- package/lib/node/task-backend-module.js +27 -29
- package/lib/node/task-backend-module.js.map +1 -1
- package/lib/node/task-line-matchers.d.ts +2 -2
- package/lib/node/task-line-matchers.d.ts.map +1 -1
- package/lib/node/task-line-matchers.js +3 -8
- package/lib/node/task-line-matchers.js.map +1 -1
- package/lib/node/task-manager.d.ts +2 -2
- package/lib/node/task-manager.d.ts.map +1 -1
- package/lib/node/task-manager.js +9 -13
- package/lib/node/task-manager.js.map +1 -1
- package/lib/node/task-problem-collector.d.ts +1 -1
- package/lib/node/task-problem-collector.d.ts.map +1 -1
- package/lib/node/task-problem-collector.js +9 -13
- package/lib/node/task-problem-collector.js.map +1 -1
- package/lib/node/task-problem-collector.spec.js +63 -65
- package/lib/node/task-problem-collector.spec.js.map +1 -1
- package/lib/node/task-runner-protocol.d.ts +2 -2
- package/lib/node/task-runner-protocol.d.ts.map +1 -1
- package/lib/node/task-runner-protocol.js +1 -4
- package/lib/node/task-runner-protocol.js.map +1 -1
- package/lib/node/task-runner.d.ts +2 -2
- package/lib/node/task-runner.d.ts.map +1 -1
- package/lib/node/task-runner.js +13 -20
- package/lib/node/task-runner.js.map +1 -1
- package/lib/node/task-server.d.ts +5 -5
- package/lib/node/task-server.d.ts.map +1 -1
- package/lib/node/task-server.js +21 -27
- package/lib/node/task-server.js.map +1 -1
- package/lib/node/task-server.slow-spec.d.ts.map +1 -1
- package/lib/node/task-server.slow-spec.js +58 -61
- package/lib/node/task-server.slow-spec.js.map +1 -1
- package/lib/node/task.d.ts +2 -2
- package/lib/node/task.d.ts.map +1 -1
- package/lib/node/task.js +12 -16
- package/lib/node/task.js.map +1 -1
- package/lib/node/test/task-test-container.js +28 -31
- package/lib/node/test/task-test-container.js.map +1 -1
- package/package.json +23 -12
- package/src/browser/index.ts +6 -6
- package/src/browser/process/process-task-contribution.ts +2 -2
- package/src/browser/process/process-task-frontend-module.ts +3 -3
- package/src/browser/process/process-task-resolver.spec.ts +247 -0
- package/src/browser/process/process-task-resolver.ts +44 -27
- package/src/browser/provided-task-configurations.spec.ts +4 -4
- package/src/browser/provided-task-configurations.ts +3 -3
- package/src/browser/quick-open-task.ts +8 -8
- package/src/browser/task-configuration-manager.ts +5 -5
- package/src/browser/task-configuration-model.ts +1 -1
- package/src/browser/task-configurations.ts +6 -6
- package/src/browser/task-contribution.ts +1 -1
- package/src/browser/task-definition-registry.spec.ts +2 -2
- package/src/browser/task-definition-registry.ts +1 -1
- package/src/browser/task-frontend-contribution.ts +5 -5
- package/src/browser/task-frontend-module.ts +22 -22
- package/src/browser/task-name-resolver.ts +3 -3
- package/src/browser/task-node.ts +1 -1
- package/src/browser/task-problem-matcher-registry.ts +2 -2
- package/src/browser/task-problem-pattern-registry.ts +1 -1
- package/src/browser/task-schema-updater.ts +6 -6
- package/src/browser/task-service.spec.ts +102 -0
- package/src/browser/task-service.ts +20 -17
- package/src/browser/task-source-resolver.ts +2 -2
- package/src/browser/task-terminal-widget-manager.ts +3 -3
- package/src/common/index.ts +4 -4
- package/src/common/process/task-protocol.ts +1 -1
- package/src/common/task-common-module.ts +1 -1
- package/src/common/task-protocol.ts +1 -1
- package/src/common/task-watcher.ts +1 -1
- package/src/node/custom/custom-task-runner-backend-module.ts +4 -4
- package/src/node/custom/custom-task-runner-contribution.ts +2 -2
- package/src/node/custom/custom-task-runner.ts +4 -4
- package/src/node/custom/custom-task.ts +4 -4
- package/src/node/index.ts +3 -3
- package/src/node/process/process-task-runner-backend-module.ts +4 -4
- package/src/node/process/process-task-runner-contribution.ts +2 -2
- package/src/node/process/process-task-runner.ts +5 -5
- package/src/node/process/process-task.spec.ts +1 -1
- package/src/node/process/process-task.ts +5 -5
- package/src/node/task-abstract-line-matcher.ts +1 -1
- package/src/node/task-backend-application-contribution.ts +1 -1
- package/src/node/task-backend-module.ts +9 -9
- package/src/node/task-line-matchers.ts +2 -2
- package/src/node/task-manager.ts +2 -2
- package/src/node/task-problem-collector.spec.ts +2 -2
- package/src/node/task-problem-collector.ts +3 -3
- package/src/node/task-runner-protocol.ts +2 -2
- package/src/node/task-runner.ts +2 -2
- package/src/node/task-server.slow-spec.ts +4 -5
- package/src/node/task-server.ts +8 -8
- package/src/node/task.ts +2 -2
- package/src/node/test/task-test-container.ts +1 -1
package/src/browser/index.ts
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
export * from './task-service';
|
|
18
|
-
export * from './task-contribution';
|
|
19
|
-
export * from './task-definition-registry';
|
|
20
|
-
export * from './task-problem-matcher-registry';
|
|
21
|
-
export * from './task-problem-pattern-registry';
|
|
22
|
-
export * from './task-schema-updater';
|
|
17
|
+
export * from './task-service.js';
|
|
18
|
+
export * from './task-contribution.js';
|
|
19
|
+
export * from './task-definition-registry.js';
|
|
20
|
+
export * from './task-problem-matcher-registry.js';
|
|
21
|
+
export * from './task-problem-pattern-registry.js';
|
|
22
|
+
export * from './task-schema-updater.js';
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import { ProcessTaskResolver } from './process-task-resolver';
|
|
19
|
-
import { TaskContribution, TaskResolverRegistry } from '../task-contribution';
|
|
18
|
+
import { ProcessTaskResolver } from './process-task-resolver.js';
|
|
19
|
+
import { TaskContribution, TaskResolverRegistry } from '../task-contribution.js';
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class ProcessTaskContribution implements TaskContribution {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
18
|
-
import { ProcessTaskContribution } from './process-task-contribution';
|
|
19
|
-
import { ProcessTaskResolver } from './process-task-resolver';
|
|
20
|
-
import { TaskContribution } from '../task-contribution';
|
|
18
|
+
import { ProcessTaskContribution } from './process-task-contribution.js';
|
|
19
|
+
import { ProcessTaskResolver } from './process-task-resolver.js';
|
|
20
|
+
import { TaskContribution } from '../task-contribution.js';
|
|
21
21
|
|
|
22
22
|
export function bindProcessTaskModule(bind: interfaces.Bind): void {
|
|
23
23
|
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 Md. Mehedi Hasan.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom';
|
|
18
|
+
|
|
19
|
+
let disableJSDOM = enableJSDOM();
|
|
20
|
+
|
|
21
|
+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
22
|
+
FrontendApplicationConfigProvider.set({});
|
|
23
|
+
|
|
24
|
+
import { cancelled, isCancelled } from '@theia/core/lib/common/cancellation';
|
|
25
|
+
import { ILogger } from '@theia/core/lib/common/logger';
|
|
26
|
+
import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
|
|
27
|
+
import { Container } from '@theia/core/shared/inversify';
|
|
28
|
+
import { expect } from 'chai';
|
|
29
|
+
import URI from '@theia/core/lib/common/uri';
|
|
30
|
+
import { Variable, VariableRegistry } from '@theia/variable-resolver/lib/browser/variable';
|
|
31
|
+
import { VariableResolverService } from '@theia/variable-resolver/lib/browser';
|
|
32
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
33
|
+
import { TaskDefinitionRegistry } from '../task-definition-registry.js';
|
|
34
|
+
import { TaskScope } from '../../common/task-protocol.js';
|
|
35
|
+
import { ProcessTaskConfiguration } from '../../common/process/task-protocol.js';
|
|
36
|
+
import { ProcessTaskResolver } from './process-task-resolver.js';
|
|
37
|
+
|
|
38
|
+
disableJSDOM();
|
|
39
|
+
|
|
40
|
+
describe('ProcessTaskResolver', () => {
|
|
41
|
+
|
|
42
|
+
before(() => {
|
|
43
|
+
disableJSDOM = enableJSDOM();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
after(() => {
|
|
47
|
+
disableJSDOM();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
function createTask(overrides: Partial<ProcessTaskConfiguration> = {}): ProcessTaskConfiguration {
|
|
51
|
+
return {
|
|
52
|
+
label: 'task with input variables',
|
|
53
|
+
type: 'shell',
|
|
54
|
+
command: 'node',
|
|
55
|
+
_scope: TaskScope.Workspace,
|
|
56
|
+
...overrides
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let requestedInputs: string[];
|
|
61
|
+
|
|
62
|
+
function createResolver(inputValue: string | undefined, workspaceRoot?: URI): ProcessTaskResolver {
|
|
63
|
+
requestedInputs = [];
|
|
64
|
+
const container = new Container();
|
|
65
|
+
container.bind(ILogger).to(MockLogger);
|
|
66
|
+
container.bind(VariableRegistry).toSelf().inSingletonScope();
|
|
67
|
+
container.bind(VariableResolverService).toSelf().inSingletonScope();
|
|
68
|
+
container.bind(TaskDefinitionRegistry).toSelf().inSingletonScope();
|
|
69
|
+
container.bind<Partial<WorkspaceService>>(WorkspaceService).toConstantValue({
|
|
70
|
+
getWorkspaceRootUri: () => workspaceRoot
|
|
71
|
+
});
|
|
72
|
+
container.bind(ProcessTaskResolver).toSelf();
|
|
73
|
+
|
|
74
|
+
const variableRegistry = container.get(VariableRegistry);
|
|
75
|
+
const input: Variable = {
|
|
76
|
+
name: 'input',
|
|
77
|
+
resolve: (_context, inputId) => {
|
|
78
|
+
requestedInputs.push(inputId!);
|
|
79
|
+
if (inputValue === undefined) {
|
|
80
|
+
throw cancelled();
|
|
81
|
+
}
|
|
82
|
+
return inputValue;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
variableRegistry.registerVariable(input);
|
|
86
|
+
|
|
87
|
+
return container.get(ProcessTaskResolver);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const cancellationCases: Array<{ name: string; task: ProcessTaskConfiguration }> = [
|
|
91
|
+
{
|
|
92
|
+
name: 'the command',
|
|
93
|
+
task: createTask({ command: '${input:value}' })
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'the arguments',
|
|
97
|
+
task: createTask({ args: ['before', '${input:value}', 'after'] })
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'the working directory',
|
|
101
|
+
task: createTask({ options: { cwd: '${input:value}' } })
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'an environment variable',
|
|
105
|
+
task: createTask({ options: { env: { BEFORE: 'unchanged', INPUT: '${input:value}', AFTER: 'unchanged' } } })
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'a platform-specific command',
|
|
109
|
+
task: createTask({ osx: { command: '${input:value}' } })
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'platform-specific arguments',
|
|
113
|
+
task: createTask({ windows: { args: ['${input:value}'] } })
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'a platform-specific working directory',
|
|
117
|
+
task: createTask({ windows: { options: { cwd: '${input:value}' } } })
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'a platform-specific environment variable',
|
|
121
|
+
task: createTask({ linux: { options: { env: { INPUT: '${input:value}' } } } })
|
|
122
|
+
}
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
for (const type of ['shell', 'process']) {
|
|
126
|
+
for (const cancellationCase of cancellationCases) {
|
|
127
|
+
it(`cancels ${type} task resolution when resolving ${cancellationCase.name} is cancelled`, async () => {
|
|
128
|
+
const resolver = createResolver(undefined);
|
|
129
|
+
|
|
130
|
+
let error: Error | undefined;
|
|
131
|
+
try {
|
|
132
|
+
await resolver.resolveTask({ ...cancellationCase.task, type });
|
|
133
|
+
} catch (e) {
|
|
134
|
+
error = e as Error;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
expect(isCancelled(error)).to.equal(true);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
it('does not request further inputs after an input is cancelled', async () => {
|
|
143
|
+
const resolver = createResolver(undefined);
|
|
144
|
+
|
|
145
|
+
let error: Error | undefined;
|
|
146
|
+
try {
|
|
147
|
+
await resolver.resolveTask(createTask({
|
|
148
|
+
args: ['${input:first}', '${input:second}'],
|
|
149
|
+
options: { cwd: '${input:cwd}', env: { INPUT: '${input:env}' } },
|
|
150
|
+
windows: { args: ['${input:windows}'] }
|
|
151
|
+
}));
|
|
152
|
+
} catch (e) {
|
|
153
|
+
error = e as Error;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
expect(isCancelled(error)).to.equal(true);
|
|
157
|
+
expect(requestedInputs).to.deep.equal(['first']);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('resolves command properties and preserves unrelated options', async () => {
|
|
161
|
+
const resolver = createResolver('resolved-value');
|
|
162
|
+
const task = createTask({
|
|
163
|
+
command: '${input:value}',
|
|
164
|
+
args: ['before', '${input:value}', 'after'],
|
|
165
|
+
options: {
|
|
166
|
+
cwd: '${input:value}',
|
|
167
|
+
env: { KEEP: 'unchanged', INPUT: '${input:value}' },
|
|
168
|
+
shell: { executable: 'bash', args: ['-c'] }
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const resolved = await resolver.resolveTask(task) as ProcessTaskConfiguration;
|
|
173
|
+
|
|
174
|
+
expect(resolved.command).to.equal('resolved-value');
|
|
175
|
+
expect(resolved.args).to.deep.equal(['before', 'resolved-value', 'after']);
|
|
176
|
+
expect(resolved.options).to.deep.equal({
|
|
177
|
+
cwd: 'resolved-value',
|
|
178
|
+
env: { KEEP: 'unchanged', INPUT: 'resolved-value' },
|
|
179
|
+
shell: { executable: 'bash', args: ['-c'] }
|
|
180
|
+
});
|
|
181
|
+
expect(task.command).to.equal('${input:value}');
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('preserves an accepted empty input in arguments and the environment', async () => {
|
|
185
|
+
const resolver = createResolver('');
|
|
186
|
+
const resolved = await resolver.resolveTask(createTask({
|
|
187
|
+
args: ['${input:value}'],
|
|
188
|
+
options: { env: { INPUT: '${input:value}' } }
|
|
189
|
+
})) as ProcessTaskConfiguration;
|
|
190
|
+
|
|
191
|
+
expect(resolved.args).to.deep.equal(['']);
|
|
192
|
+
expect(resolved.options?.env).to.deep.equal({ INPUT: '' });
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('uses the workspace root when no working directory is configured', async () => {
|
|
196
|
+
const workspaceRoot = new URI('file:///workspace');
|
|
197
|
+
const resolver = createResolver('resolved-value', workspaceRoot);
|
|
198
|
+
|
|
199
|
+
const resolved = await resolver.resolveTask(createTask()) as ProcessTaskConfiguration;
|
|
200
|
+
|
|
201
|
+
expect(resolved.options?.cwd).to.equal(workspaceRoot.toString());
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('does not treat absent optional properties as cancellation', async () => {
|
|
205
|
+
const resolver = createResolver(undefined);
|
|
206
|
+
|
|
207
|
+
const resolved = await resolver.resolveTask(createTask()) as ProcessTaskConfiguration;
|
|
208
|
+
|
|
209
|
+
expect(resolved.command).to.equal('node');
|
|
210
|
+
expect(resolved.args).to.equal(undefined);
|
|
211
|
+
expect(resolved.options?.cwd).to.equal(undefined);
|
|
212
|
+
expect(resolved.options?.env).to.equal(undefined);
|
|
213
|
+
expect(resolved.windows).to.equal(undefined);
|
|
214
|
+
expect(resolved.osx).to.equal(undefined);
|
|
215
|
+
expect(resolved.linux).to.equal(undefined);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
for (const platform of ['windows', 'osx', 'linux'] as const) {
|
|
219
|
+
it(`resolves ${platform} overrides without changing the original configuration`, async () => {
|
|
220
|
+
const resolver = createResolver('resolved-value');
|
|
221
|
+
const overrides = {
|
|
222
|
+
command: '${input:value}',
|
|
223
|
+
args: ['${input:value}'],
|
|
224
|
+
options: {
|
|
225
|
+
cwd: '${input:value}',
|
|
226
|
+
env: { INPUT: '${input:value}' },
|
|
227
|
+
shell: { executable: 'custom-shell', args: ['-c'] }
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const task = createTask({ [platform]: overrides });
|
|
231
|
+
|
|
232
|
+
const resolved = await resolver.resolveTask(task) as ProcessTaskConfiguration;
|
|
233
|
+
|
|
234
|
+
expect(resolved[platform]).to.deep.equal({
|
|
235
|
+
command: 'resolved-value',
|
|
236
|
+
args: ['resolved-value'],
|
|
237
|
+
options: {
|
|
238
|
+
cwd: 'resolved-value',
|
|
239
|
+
env: { INPUT: 'resolved-value' },
|
|
240
|
+
shell: { executable: 'custom-shell', args: ['-c'] }
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
expect(task[platform]).to.equal(overrides);
|
|
244
|
+
expect(overrides.options.env.INPUT).to.equal('${input:value}');
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
});
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import { VariableResolverService } from '@theia/variable-resolver/lib/browser';
|
|
19
|
-
import { TaskResolver } from '../task-contribution';
|
|
20
|
-
import { TaskConfiguration } from '../../common/task-protocol';
|
|
21
|
-
import { ProcessTaskConfiguration } from '../../common/process/task-protocol';
|
|
22
|
-
import { TaskDefinitionRegistry } from '../task-definition-registry';
|
|
18
|
+
import { VariableResolveOptions, VariableResolverService } from '@theia/variable-resolver/lib/browser';
|
|
19
|
+
import { TaskResolver } from '../task-contribution.js';
|
|
20
|
+
import { TaskConfiguration } from '../../common/task-protocol.js';
|
|
21
|
+
import { CommandProperties, ProcessTaskConfiguration } from '../../common/process/task-protocol.js';
|
|
22
|
+
import { TaskDefinitionRegistry } from '../task-definition-registry.js';
|
|
23
23
|
import URI from '@theia/core/lib/common/uri';
|
|
24
24
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
25
|
+
import { cancelled } from '@theia/core/lib/common/cancellation';
|
|
25
26
|
|
|
26
27
|
@injectable()
|
|
27
28
|
export class ProcessTaskResolver implements TaskResolver {
|
|
@@ -40,6 +41,7 @@ export class ProcessTaskResolver implements TaskResolver {
|
|
|
40
41
|
* it to the backend to be executed. We can make sure that parameters that
|
|
41
42
|
* are optional to the user but required by the server will be defined, with
|
|
42
43
|
* sane default values. Also, resolve all known variables, e.g. `${workspaceFolder}`.
|
|
44
|
+
* Rejects with a cancellation error if the user cancels a variable, e.g. an input prompt.
|
|
43
45
|
*/
|
|
44
46
|
async resolveTask(taskConfig: TaskConfiguration): Promise<TaskConfiguration> {
|
|
45
47
|
const type = taskConfig.executionType || taskConfig.type;
|
|
@@ -59,31 +61,46 @@ export class ProcessTaskResolver implements TaskResolver {
|
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
const commandProperties = await this.resolveCommandProperties({
|
|
65
|
+
...processTaskConfig,
|
|
66
|
+
options: { ...processTaskConfig.options, cwd }
|
|
67
|
+
}, variableResolverOptions);
|
|
62
68
|
const result: ProcessTaskConfiguration = {
|
|
63
69
|
...processTaskConfig,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
args: processTaskConfig.windows.args ? await this.variableResolverService.resolve(processTaskConfig.windows.args, variableResolverOptions) : undefined,
|
|
69
|
-
options: processTaskConfig.windows.options
|
|
70
|
-
} : undefined,
|
|
71
|
-
osx: processTaskConfig.osx ? {
|
|
72
|
-
command: await this.variableResolverService.resolve(processTaskConfig.osx.command, variableResolverOptions),
|
|
73
|
-
args: processTaskConfig.osx.args ? await this.variableResolverService.resolve(processTaskConfig.osx.args, variableResolverOptions) : undefined,
|
|
74
|
-
options: processTaskConfig.osx.options
|
|
75
|
-
} : undefined,
|
|
76
|
-
linux: processTaskConfig.linux ? {
|
|
77
|
-
command: await this.variableResolverService.resolve(processTaskConfig.linux.command, variableResolverOptions),
|
|
78
|
-
args: processTaskConfig.linux.args ? await this.variableResolverService.resolve(processTaskConfig.linux.args, variableResolverOptions) : undefined,
|
|
79
|
-
options: processTaskConfig.linux.options
|
|
80
|
-
} : undefined,
|
|
81
|
-
options: {
|
|
82
|
-
cwd: await this.variableResolverService.resolve(cwd, variableResolverOptions),
|
|
83
|
-
env: processTaskConfig.options?.env && await this.variableResolverService.resolve(processTaskConfig.options.env, variableResolverOptions),
|
|
84
|
-
shell: processTaskConfig.options && processTaskConfig.options.shell
|
|
85
|
-
}
|
|
70
|
+
...commandProperties,
|
|
71
|
+
windows: await this.resolveCommandProperties(processTaskConfig.windows, variableResolverOptions),
|
|
72
|
+
osx: await this.resolveCommandProperties(processTaskConfig.osx, variableResolverOptions),
|
|
73
|
+
linux: await this.resolveCommandProperties(processTaskConfig.linux, variableResolverOptions)
|
|
86
74
|
};
|
|
87
75
|
return result;
|
|
88
76
|
}
|
|
77
|
+
|
|
78
|
+
protected async resolveCommandProperties(
|
|
79
|
+
properties: CommandProperties | undefined,
|
|
80
|
+
variableResolverOptions: VariableResolveOptions
|
|
81
|
+
): Promise<CommandProperties | undefined> {
|
|
82
|
+
if (!properties) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
command: await this.resolveVariable(properties.command, variableResolverOptions),
|
|
87
|
+
args: await this.resolveVariable(properties.args, variableResolverOptions),
|
|
88
|
+
options: properties.options && {
|
|
89
|
+
...properties.options,
|
|
90
|
+
cwd: await this.resolveVariable(properties.options.cwd, variableResolverOptions),
|
|
91
|
+
env: await this.resolveVariable(properties.options.env, variableResolverOptions)
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
protected async resolveVariable<T>(value: T, options: VariableResolveOptions): Promise<T | undefined> {
|
|
97
|
+
if (value === undefined) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const resolved = await this.variableResolverService.resolve(value, options);
|
|
101
|
+
if (resolved === undefined) {
|
|
102
|
+
throw cancelled();
|
|
103
|
+
}
|
|
104
|
+
return resolved;
|
|
105
|
+
}
|
|
89
106
|
}
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
import { assert } from 'chai';
|
|
18
18
|
import { Container } from '@theia/core/shared/inversify';
|
|
19
|
-
import { ProvidedTaskConfigurations } from './provided-task-configurations';
|
|
20
|
-
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
21
|
-
import { TaskProviderRegistry } from './task-contribution';
|
|
22
|
-
import { TaskConfiguration } from '../common';
|
|
19
|
+
import { ProvidedTaskConfigurations } from './provided-task-configurations.js';
|
|
20
|
+
import { TaskDefinitionRegistry } from './task-definition-registry.js';
|
|
21
|
+
import { TaskProviderRegistry } from './task-contribution.js';
|
|
22
|
+
import { TaskConfiguration } from '../common/index.js';
|
|
23
23
|
|
|
24
24
|
describe('provided-task-configurations', () => {
|
|
25
25
|
let container: Container;
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { TaskProviderRegistry, TaskProvider } from './task-contribution';
|
|
19
|
-
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
20
|
-
import { TaskConfiguration, TaskCustomization, TaskOutputPresentation, TaskConfigurationScope, TaskScope } from '../common';
|
|
18
|
+
import { TaskProviderRegistry, TaskProvider } from './task-contribution.js';
|
|
19
|
+
import { TaskDefinitionRegistry } from './task-definition-registry.js';
|
|
20
|
+
import { TaskConfiguration, TaskCustomization, TaskOutputPresentation, TaskConfigurationScope, TaskScope } from '../common/index.js';
|
|
21
21
|
|
|
22
22
|
export const ALL_TASK_TYPES: string = '*';
|
|
23
23
|
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { inject, injectable, optional } from '@theia/core/shared/inversify';
|
|
18
|
-
import { TaskService } from './task-service';
|
|
19
|
-
import { TaskInfo, TaskConfiguration, TaskCustomization, TaskScope, TaskConfigurationScope, TaskDefinition } from '../common/task-protocol';
|
|
20
|
-
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
18
|
+
import { TaskService } from './task-service.js';
|
|
19
|
+
import { TaskInfo, TaskConfiguration, TaskCustomization, TaskScope, TaskConfigurationScope, TaskDefinition } from '../common/task-protocol.js';
|
|
20
|
+
import { TaskDefinitionRegistry } from './task-definition-registry.js';
|
|
21
21
|
import URI from '@theia/core/lib/common/uri';
|
|
22
22
|
import { LabelProvider, QuickAccessProvider, QuickAccessRegistry, QuickInputService, QuickPick } from '@theia/core/lib/browser';
|
|
23
23
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
24
24
|
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
25
|
-
import { ALL_TASK_TYPES } from './provided-task-configurations';
|
|
26
|
-
import { TaskNameResolver } from './task-name-resolver';
|
|
27
|
-
import { TaskSourceResolver } from './task-source-resolver';
|
|
28
|
-
import { TaskConfigurationManager } from './task-configuration-manager';
|
|
25
|
+
import { ALL_TASK_TYPES } from './provided-task-configurations.js';
|
|
26
|
+
import { TaskNameResolver } from './task-name-resolver.js';
|
|
27
|
+
import { TaskSourceResolver } from './task-source-resolver.js';
|
|
28
|
+
import { TaskConfigurationManager } from './task-configuration-manager.js';
|
|
29
29
|
import { filterItems, QuickInputButton, QuickPickItem, QuickPickItemOrSeparator, QuickPicks, QuickPickInput, QuickPickValue } from
|
|
30
30
|
'@theia/core/lib/browser/quick-input/quick-input-service';
|
|
31
31
|
import { CancellationToken, PreferenceService } from '@theia/core/lib/common';
|
|
32
32
|
import { nls } from '@theia/core/lib/common/nls';
|
|
33
|
-
import { TriggerAction } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/pickerQuickAccess';
|
|
33
|
+
import { TriggerAction } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/pickerQuickAccess.js';
|
|
34
34
|
|
|
35
35
|
export namespace ConfigureTaskAction {
|
|
36
36
|
export const ID = 'workbench.action.tasks.configureTaskRunner';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as jsoncparser from 'jsonc-parser';
|
|
18
|
-
import debounce
|
|
18
|
+
import debounce from 'p-debounce';
|
|
19
19
|
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';
|
|
@@ -23,14 +23,14 @@ import { EditorManager, EditorWidget } from '@theia/editor/lib/browser';
|
|
|
23
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
|
-
import { TaskConfigurationModel } from './task-configuration-model';
|
|
27
|
-
import { TaskTemplateSelector } from './task-templates';
|
|
28
|
-
import { TaskCustomization, TaskConfiguration, TaskConfigurationScope, TaskScope } from '../common/task-protocol';
|
|
26
|
+
import { TaskConfigurationModel } from './task-configuration-model.js';
|
|
27
|
+
import { TaskTemplateSelector } from './task-templates.js';
|
|
28
|
+
import { TaskCustomization, TaskConfiguration, TaskConfigurationScope, TaskScope } from '../common/task-protocol.js';
|
|
29
29
|
import { WorkspaceVariableContribution } from '@theia/workspace/lib/browser/workspace-variable-contribution';
|
|
30
30
|
import { FileChangeType } from '@theia/filesystem/lib/common/filesystem-watcher-protocol';
|
|
31
31
|
import { PreferenceConfigurations } from '@theia/core/lib/common/preferences/preference-configurations';
|
|
32
32
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
33
|
-
import { TaskSchemaUpdater } from './task-schema-updater';
|
|
33
|
+
import { TaskSchemaUpdater } from './task-schema-updater.js';
|
|
34
34
|
import { JSONObject } from '@theia/core/shared/@lumino/coreutils';
|
|
35
35
|
import { PreferenceProvider } from '@theia/core/lib/common/preferences/preference-provider';
|
|
36
36
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import URI from '@theia/core/lib/common/uri';
|
|
18
18
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
19
19
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
20
|
-
import { TaskCustomization, TaskConfiguration, TaskConfigurationScope } from '../common/task-protocol';
|
|
20
|
+
import { TaskCustomization, TaskConfiguration, TaskConfigurationScope } from '../common/task-protocol.js';
|
|
21
21
|
import { PreferenceProviderDataChanges, PreferenceProviderDataChange, isObject } from '@theia/core/lib/common';
|
|
22
22
|
import { PreferenceProvider } from '@theia/core/lib/common/preferences/preference-provider';
|
|
23
23
|
import { JSONValue } from '@theia/core/shared/@lumino/coreutils';
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
TaskConfigurationScope,
|
|
24
24
|
TaskScope,
|
|
25
25
|
asVariableName
|
|
26
|
-
} from '../common';
|
|
27
|
-
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
28
|
-
import { ProvidedTaskConfigurations } from './provided-task-configurations';
|
|
29
|
-
import { TaskConfigurationManager, TasksChange } from './task-configuration-manager';
|
|
30
|
-
import { TaskSchemaUpdater } from './task-schema-updater';
|
|
31
|
-
import { TaskSourceResolver } from './task-source-resolver';
|
|
26
|
+
} from '../common/index.js';
|
|
27
|
+
import { TaskDefinitionRegistry } from './task-definition-registry.js';
|
|
28
|
+
import { ProvidedTaskConfigurations } from './provided-task-configurations.js';
|
|
29
|
+
import { TaskConfigurationManager, TasksChange } from './task-configuration-manager.js';
|
|
30
|
+
import { TaskSchemaUpdater } from './task-schema-updater.js';
|
|
31
|
+
import { TaskSourceResolver } from './task-source-resolver.js';
|
|
32
32
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common';
|
|
33
33
|
import { FileChangeType } from '@theia/filesystem/lib/common/filesystem-watcher-protocol';
|
|
34
34
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { injectable, postConstruct, inject, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
19
|
-
import { TaskConfiguration } from '../common/task-protocol';
|
|
19
|
+
import { TaskConfiguration } from '../common/task-protocol.js';
|
|
20
20
|
import { WaitUntilEvent, Emitter } from '@theia/core/lib/common/event';
|
|
21
21
|
import { ILogger } from '@theia/core';
|
|
22
22
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { expect } from 'chai';
|
|
18
|
-
import { PanelKind, RevealKind, TaskScope, TaskDefinition } from '../common';
|
|
19
|
-
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
18
|
+
import { PanelKind, RevealKind, TaskScope, TaskDefinition } from '../common/index.js';
|
|
19
|
+
import { TaskDefinitionRegistry } from './task-definition-registry.js';
|
|
20
20
|
|
|
21
21
|
describe('TaskDefinitionRegistry', () => {
|
|
22
22
|
let registry: TaskDefinitionRegistry;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { injectable } from '@theia/core/shared/inversify';
|
|
18
18
|
import { JSONExt } from '@theia/core/shared/@lumino/coreutils';
|
|
19
19
|
import { Event, Emitter } from '@theia/core/lib/common';
|
|
20
|
-
import { TaskConfiguration, TaskDefinition, TaskCustomization } from '../common';
|
|
20
|
+
import { TaskConfiguration, TaskDefinition, TaskCustomization } from '../common/index.js';
|
|
21
21
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
22
22
|
|
|
23
23
|
@injectable()
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
|
|
17
17
|
import { inject, injectable, named, postConstruct } from '@theia/core/shared/inversify';
|
|
18
18
|
import { ILogger, ContributionProvider, CommandContribution, Command, CommandRegistry, MenuContribution, MenuModelRegistry, nls } from '@theia/core/lib/common';
|
|
19
|
-
import { QuickOpenTask, TaskTerminateQuickOpen, TaskRunningQuickOpen, TaskRestartRunningQuickOpen } from './quick-open-task';
|
|
19
|
+
import { QuickOpenTask, TaskTerminateQuickOpen, TaskRunningQuickOpen, TaskRestartRunningQuickOpen } from './quick-open-task.js';
|
|
20
20
|
import {
|
|
21
21
|
FrontendApplication, FrontendApplicationContribution, QuickAccessContribution,
|
|
22
22
|
KeybindingRegistry, KeybindingContribution, StorageService, StatusBar, StatusBarAlignment, CommonMenus
|
|
23
23
|
} from '@theia/core/lib/browser';
|
|
24
24
|
import { WidgetManager } from '@theia/core/lib/browser/widget-manager';
|
|
25
|
-
import { TaskContribution, TaskResolverRegistry, TaskProviderRegistry } from './task-contribution';
|
|
26
|
-
import { TaskService } from './task-service';
|
|
25
|
+
import { TaskContribution, TaskResolverRegistry, TaskProviderRegistry } from './task-contribution.js';
|
|
26
|
+
import { TaskService } from './task-service.js';
|
|
27
27
|
import { TerminalMenus } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
|
|
28
|
-
import { TaskSchemaUpdater } from './task-schema-updater';
|
|
29
|
-
import { TaskConfiguration, TaskWatcher } from '../common';
|
|
28
|
+
import { TaskSchemaUpdater } from './task-schema-updater.js';
|
|
29
|
+
import { TaskConfiguration, TaskWatcher } from '../common/index.js';
|
|
30
30
|
import { EditorManager } from '@theia/editor/lib/browser';
|
|
31
31
|
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
32
32
|
|
|
@@ -18,31 +18,31 @@ import { ContainerModule } from '@theia/core/shared/inversify';
|
|
|
18
18
|
import { FrontendApplicationContribution, KeybindingContribution } from '@theia/core/lib/browser';
|
|
19
19
|
import { CommandContribution, MenuContribution, bindRootContributionProvider, nls } from '@theia/core/lib/common';
|
|
20
20
|
import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging';
|
|
21
|
-
import { QuickOpenTask, TaskTerminateQuickOpen, TaskRestartRunningQuickOpen, TaskRunningQuickOpen } from './quick-open-task';
|
|
22
|
-
import { TaskContribution, TaskProviderRegistry, TaskResolverRegistry } from './task-contribution';
|
|
23
|
-
import { TaskService } from './task-service';
|
|
24
|
-
import { TaskConfigurations } from './task-configurations';
|
|
25
|
-
import { ProvidedTaskConfigurations } from './provided-task-configurations';
|
|
26
|
-
import { TaskFrontendContribution } from './task-frontend-contribution';
|
|
27
|
-
import { createCommonBindings } from '../common/task-common-module';
|
|
28
|
-
import { TaskServer, taskPath } from '../common/task-protocol';
|
|
29
|
-
import { TaskWatcher } from '../common/task-watcher';
|
|
30
|
-
import { bindProcessTaskModule } from './process/process-task-frontend-module';
|
|
31
|
-
import { TaskSchemaUpdater } from './task-schema-updater';
|
|
32
|
-
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
33
|
-
import { ProblemMatcherRegistry } from './task-problem-matcher-registry';
|
|
34
|
-
import { ProblemPatternRegistry } from './task-problem-pattern-registry';
|
|
35
|
-
import { TaskConfigurationManager } from './task-configuration-manager';
|
|
36
|
-
import { bindTaskPreferences } from '../common/task-preferences';
|
|
21
|
+
import { QuickOpenTask, TaskTerminateQuickOpen, TaskRestartRunningQuickOpen, TaskRunningQuickOpen } from './quick-open-task.js';
|
|
22
|
+
import { TaskContribution, TaskProviderRegistry, TaskResolverRegistry } from './task-contribution.js';
|
|
23
|
+
import { TaskService } from './task-service.js';
|
|
24
|
+
import { TaskConfigurations } from './task-configurations.js';
|
|
25
|
+
import { ProvidedTaskConfigurations } from './provided-task-configurations.js';
|
|
26
|
+
import { TaskFrontendContribution } from './task-frontend-contribution.js';
|
|
27
|
+
import { createCommonBindings } from '../common/task-common-module.js';
|
|
28
|
+
import { TaskServer, taskPath } from '../common/task-protocol.js';
|
|
29
|
+
import { TaskWatcher } from '../common/task-watcher.js';
|
|
30
|
+
import { bindProcessTaskModule } from './process/process-task-frontend-module.js';
|
|
31
|
+
import { TaskSchemaUpdater } from './task-schema-updater.js';
|
|
32
|
+
import { TaskDefinitionRegistry } from './task-definition-registry.js';
|
|
33
|
+
import { ProblemMatcherRegistry } from './task-problem-matcher-registry.js';
|
|
34
|
+
import { ProblemPatternRegistry } from './task-problem-pattern-registry.js';
|
|
35
|
+
import { TaskConfigurationManager } from './task-configuration-manager.js';
|
|
36
|
+
import { bindTaskPreferences } from '../common/task-preferences.js';
|
|
37
37
|
import '../../src/browser/style/index.css';
|
|
38
|
-
import './tasks-monaco-contribution';
|
|
39
|
-
import { TaskNameResolver } from './task-name-resolver';
|
|
40
|
-
import { TaskSourceResolver } from './task-source-resolver';
|
|
41
|
-
import { TaskTemplateSelector } from './task-templates';
|
|
42
|
-
import { TaskTerminalWidgetManager } from './task-terminal-widget-manager';
|
|
38
|
+
import './tasks-monaco-contribution.js';
|
|
39
|
+
import { TaskNameResolver } from './task-name-resolver.js';
|
|
40
|
+
import { TaskSourceResolver } from './task-source-resolver.js';
|
|
41
|
+
import { TaskTemplateSelector } from './task-templates.js';
|
|
42
|
+
import { TaskTerminalWidgetManager } from './task-terminal-widget-manager.js';
|
|
43
43
|
import { JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
|
|
44
44
|
import { QuickAccessContribution } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
45
|
-
import { TaskContextKeyService } from './task-context-key-service';
|
|
45
|
+
import { TaskContextKeyService } from './task-context-key-service.js';
|
|
46
46
|
import { WorkspaceRestrictionContribution, WorkspaceRestriction } from '@theia/workspace/lib/browser/workspace-trust-service';
|
|
47
47
|
|
|
48
48
|
export default new ContainerModule(bind => {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { TaskConfiguration } from '../common';
|
|
19
|
-
import { TaskDefinitionRegistry } from './task-definition-registry';
|
|
20
|
-
import { TaskConfigurations } from './task-configurations';
|
|
18
|
+
import { TaskConfiguration } from '../common/index.js';
|
|
19
|
+
import { TaskDefinitionRegistry } from './task-definition-registry.js';
|
|
20
|
+
import { TaskConfigurations } from './task-configurations.js';
|
|
21
21
|
|
|
22
22
|
@injectable()
|
|
23
23
|
export class TaskNameResolver {
|