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

'group' property is not an object literal in tasks.json #29573

Closed
michelkaporin opened this issue Jun 27, 2017 · 4 comments
Closed

'group' property is not an object literal in tasks.json #29573

michelkaporin opened this issue Jun 27, 2017 · 4 comments
Assignees
Milestone

Comments

@michelkaporin
Copy link
Contributor

Testing #29442:

image

Intellisense on group property suggests only "kind" of a group, rather than an object literal with kind and isPrimary. Is it intended?
Also no documentation on build kind when typing "group": "build".

@dbaeumer dbaeumer added this to the June 2017 milestone Jun 27, 2017
@dbaeumer
Copy link
Member

The problem is that group is either a string or an object literal. Might be the problem why code complete only shows the string enums.

@aeschli the property is defined as follows:

const group: IJSONSchema = {
	oneOf: [
		{
			type: 'string',
			enum: ['none', 'clean', 'build', 'rebuildAll', 'test'],
			default: 'none',
		},
		{
			type: 'object',
			properties: {
				kind: {
					type: 'string',
					enum: ['none', 'clean', 'build', 'rebuildAll', 'test'],
					default: 'none',
					description: nls.localize('JsonSchema.tasks.group.kind', 'The task\'s execution group.')
				},
				isPrimary: {
					type: 'boolean',
					default: false,
					description: nls.localize('JsonSchema.tasks.group.isPrimary', 'Defines if this task is a primary task in a group.')
				}
			}
		}
	],
	description: nls.localize('JsonSchema.tasks.group', 'Defines to which execution group this task belongs to. If omitted the task belongs to no group.')
};

And how do I add documentation for the enum values defined for the string ?

@dbaeumer
Copy link
Member

@dbaeumer
Copy link
Member

Found a way:
capture

@aeschli
Copy link
Contributor

aeschli commented Jun 28, 2017

@dbaeumer To add descriptions to the enum values, use 'enumDescriptions', as seen here
https://github.com/Microsoft/vscode/blame/master/src/vs/editor/common/config/commonEditorConfig.ts#L572
To add suggestions for the object, use 'defaultSnippet' as seen here: https://github.com/Microsoft/vscode/blame/master/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts#L543.

Adding an enum just for the sake of proposals is not recommended as enums are used for validation.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants