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

Align Theia task schema with vs code #5516

Open
elaihau opened this issue Jun 19, 2019 · 1 comment
Open

Align Theia task schema with vs code #5516

elaihau opened this issue Jun 19, 2019 · 1 comment
Labels
tasks issues related to the task system

Comments

@elaihau
Copy link
Contributor

elaihau commented Jun 19, 2019

Description

As per https://code.visualstudio.com/docs/editor/tasks#_custom-tasks and https://code.visualstudio.com/docs/editor/tasks-appendix vs code task schema is quite different from that in Theia:

export interface CommandProperties<T = string> {
    readonly command: string;
    readonly args?: T[];
    readonly options?: object;
}

/** Configuration of a Task that may be run as a process or a command inside a shell. */
export interface ProcessTaskConfiguration<T = string> extends TaskConfiguration, CommandProperties<T> {
    readonly type: ProcessType;
    readonly windows?: CommandProperties<T>;
    readonly cwd?: string;
}

We should align them for consistent user experience.

This issue was originally brought up by @akosyakov in #5024 (comment)

It seems to work somehow. I've noticed that label and cwd is mandatory. It should not be. cwd should be a proper register variable which can be computed from the current context.

Also according to docs, cwd should be part of options, see here https://code.visualstudio.com/Docs/editor/tasks#_custom-tasks

If the task cannot be started, like cwd is missing, there is no any feedback to a user. Plus programming errors in logs.

like Anton said, a good first step would be moving cwd into options, and making label optional for configuring tasks.

Reproduction Steps

Open Theia example browser, open tasks.json, and create custom tasks in the editor.

OS and Theia version:

Theia 0.7. This issue is OS and browser version independent.

@elaihau elaihau added the tasks issues related to the task system label Jun 19, 2019
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 20, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 20, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 20, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 20, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 20, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 20, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 21, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 24, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 24, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit that referenced this issue Jun 25, 2019
- "cwd" (i.e., the current working directory) is currently defined directly under Task, which is inconsistent from the VS Code Task schema. In this pull request "cwd" is moved into the "options" as part of the CommandOptions.
- part of #5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 25, 2019
- as per https://github.com/microsoft/vscode/blob/1.35.1/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts#L255, vsCode supports having separated command properties for Windows, OSX, and Linux. This change adds the same support to Theia.
- changed the `command` property in CommandProperties interface from mandatory to optional.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 25, 2019
- as per https://github.com/microsoft/vscode/blob/1.35.1/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts#L255, vsCode supports having separated command properties for Windows, OSX, and Linux. This change adds the same support to Theia.
- changed the `command` property in CommandProperties interface from mandatory to optional.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 27, 2019
- as per https://github.com/microsoft/vscode/blob/1.35.1/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts#L255, vsCode supports having separated command properties for Windows, OSX, and Linux. This change adds the same support to Theia.
- changed the `command` property in CommandProperties interface from mandatory to optional.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 27, 2019
- as per https://github.com/microsoft/vscode/blob/1.35.1/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts#L255, vsCode supports having separated command properties for Windows, OSX, and Linux. This change adds the same support to Theia.
- changed the `command` property in CommandProperties interface from mandatory to optional.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit to elaihau/theia that referenced this issue Jun 27, 2019
- as per https://github.com/microsoft/vscode/blob/1.35.1/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts#L255, vsCode supports having separated command properties for Windows, OSX, and Linux. This change adds the same support to Theia.
- changed the `command` property in CommandProperties interface from mandatory to optional.
- part of eclipse-theia#5516

Signed-off-by: elaihau <[email protected]>
elaihau pushed a commit that referenced this issue Jul 2, 2019
- as per https://github.com/microsoft/vscode/blob/1.35.1/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts#L255, vsCode supports having separated command properties for Windows, OSX, and Linux. This change adds the same support to Theia.
- changed the `command` property in CommandProperties interface from mandatory to optional.
- part of #5516

Signed-off-by: elaihau <[email protected]>
@mmx85
Copy link

mmx85 commented Nov 15, 2024

Related to this topic.
The following works well in VS Code

        {
            "label": "Rebuild",
            "dependsOrder": "sequence",
            "dependsOn" : [ "Clean", "Build" ],
            "group": {
                "kind": "build"
            }
        }

But Theia IDE 1.55.0 complains that "type" and "command" are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks issues related to the task system
Projects
None yet
Development

No branches or pull requests

2 participants