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

Snippet used when creating extensions.json puts cursor in the wrong place #35190

Closed
ramya-rao-a opened this issue Sep 26, 2017 · 4 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions verified Verification succeeded
Milestone

Comments

@ramya-rao-a
Copy link
Contributor

Testing #29242

In multi-root set up, the command Extensions: Configure Recommended Extensions (Workspace) creates the extensions.json file as below

image

The cursor should be inside the [].
Instead the cursor is just before []

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Sep 26, 2017
@sandy081 sandy081 added json JSON support issues and removed extensions Issues concerning extensions labels Sep 27, 2017
@aeschli
Copy link
Contributor

aeschli commented Sep 28, 2017

@sandy081 Can you give more information what's happening in the background and why you think this is something I can fix?

@sandy081
Copy link
Member

@aeschli Here is my schema for extensions/recommendations

{
	id: ExtensionsConfigurationSchemaId,
	type: 'object',
	title: localize('app.extensions.json.title', "Extensions"),
	properties: {
		recommendations: {
			type: 'array',
			description: localize('app.extensions.json.recommendations', "List of extensions recommendations. The identifier of an extension is always '${publisher}.${name}'. For example: 'vscode.csharp'."),
			items: {
				type: 'string',
				pattern: EXTENSION_IDENTIFIER_PATTERN,
				errorMessage: localize('app.extension.identifier.errorMessage', "Expected format '${publisher}.${name}'. Example: 'vscode.csharp'.")
			},
		},
	}
}

recommendations is of type array. When a user types recommendations I think you are automatically writing empty array. I think the bug here is that, cursor is not placed inside array.

@aeschli
Copy link
Contributor

aeschli commented Sep 28, 2017

When completing 'recommendations' with code assist, you get
image

The Extensions: Configure Recommended Extensions (Workspace) seems to either create a new file or open the existing file and add recommendations. In both cases the cursor is at the end.

How do you insert recommendations? You would have to add it as snippet. Probably like that: https://github.com/Microsoft/vscode/blob/5b76a1d27f75814a4494aad6d909a01436c61f0a/src/vs/workbench/api/electron-browser/mainThreadEditor.ts#L358, but Joh would know.

@aeschli aeschli assigned sandy081 and unassigned aeschli Sep 28, 2017
@sandy081
Copy link
Member

Ah ok. This is while creation. Could be that I placing the cursor there. Thanks @aeschli for insight.

@sandy081 sandy081 assigned sandy081 and unassigned sandy081 Sep 28, 2017
@sandy081 sandy081 added extensions Issues concerning extensions bug Issue identified by VS Code Team member as probable bug and removed json JSON support issues extensions Issues concerning extensions labels Sep 28, 2017
@sandy081 sandy081 added this to the Backlog milestone Sep 28, 2017
@sandy081 sandy081 modified the milestones: Backlog, November 2017 Nov 22, 2017
@ramya-rao-a ramya-rao-a added the verified Verification succeeded label Dec 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants