Skip to content

Commit

Permalink
fix(task): Align task group validation with VS Code (#13075)
Browse files Browse the repository at this point in the history
* fix(task): Align task group validation with VSCode

In VS Code, the following is considered correct in a `tasks.json`:
```
"group": {"kind": "build","isDefault": false}
```

In Theia, however, this is considered an error. This also prevents such
tasks to be listed correctly when e.g. executing the command
"Run Build Task".

Contributed on behalf of STMicroelectronics.

Fixes #12917
  • Loading branch information
planger authored Nov 28, 2023
1 parent 5f7c5c1 commit c992452
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [task] prevent task widget title from being changed by task process [#13003](https://github.com/eclipse-theia/theia/pull/13003)
- [vscode] added Notebook CodeActionKind [#13093](https://github.com/eclipse-theia/theia/pull/13093) - contributed on behalf of STMicroelectronics
- [vscode] added support to env.ondidChangeShell event [#13097](https://github.com/eclipse-theia/theia/pull/13097) - contributed on behalf of STMicroelectronics
- [task] support `isDefault: false` in task group definition [#13075](https://github.com/eclipse-theia/theia/pull/13075) - contributed on behalf of STMicroelectronics

## v1.43.0 - 10/26/2023

Expand Down
30 changes: 14 additions & 16 deletions packages/task/src/browser/task-schema-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,27 @@ const commandAndArgs = {
const group: IJSONSchema = {
oneOf: [
{
type: 'string'
type: 'string',
enum: ['build', 'test', 'none'],
enumDescriptions: [
'Marks the task as a build task accessible through the \'Run Build Task\' command.',
'Marks the task as a test task accessible through the \'Run Test Task\' command.',
'Assigns the task to no group'
]
},
{
type: 'object',
properties: {
kind: {
type: 'string',
default: 'none',
description: 'The task\'s execution group.'
description: 'The task\'s execution group.',
enum: ['build', 'test', 'none'],
enumDescriptions: [
'Marks the task as a build task accessible through the \'Run Build Task\' command.',
'Marks the task as a test task accessible through the \'Run Test Task\' command.',
'Assigns the task to no group'
]
},
isDefault: {
type: 'boolean',
Expand All @@ -312,20 +324,6 @@ const group: IJSONSchema = {
}
}
],
enum: [
{ kind: 'build', isDefault: true },
{ kind: 'test', isDefault: true },
'build',
'test',
'none'
],
enumDescriptions: [
'Marks the task as the default build task.',
'Marks the task as the default test task.',
'Marks the task as a build task accessible through the \'Run Build Task\' command.',
'Marks the task as a test task accessible through the \'Run Test Task\' command.',
'Assigns the task to no group'
],
// eslint-disable-next-line max-len
description: 'Defines to which execution group this task belongs to. It supports "build" to add it to the build group and "test" to add it to the test group.'
};
Expand Down

0 comments on commit c992452

Please sign in to comment.