Move schema definitions to the commands definitions (#66458)

This commit is contained in:
Alex Dima
2019-02-14 12:37:37 +01:00
parent aad61e8af7
commit 1ed83c7cad
12 changed files with 344 additions and 349 deletions

View File

@@ -65,7 +65,24 @@ export class OpenFolderAPICommand {
return executor.executeCommand('_files.windowOpen', { urisToOpen: [{ uri }], forceNewWindow });
}
}
CommandsRegistry.registerCommand(OpenFolderAPICommand.ID, adjustHandler(OpenFolderAPICommand.execute));
CommandsRegistry.registerCommand({
id: OpenFolderAPICommand.ID,
handler: adjustHandler(OpenFolderAPICommand.execute),
description: {
description: `Open a folder`,
args: [{
name: 'uri',
schema: {
'type': 'string'
}
}, {
name: 'forceNewWindow',
schema: {
'type': 'boolean'
}
}]
}
});
export class DiffAPICommand {
public static ID = 'vscode.diff';
@@ -126,7 +143,31 @@ export class SetEditorLayoutAPICommand {
return executor.executeCommand('layoutEditorGroups', layout);
}
}
CommandsRegistry.registerCommand(SetEditorLayoutAPICommand.ID, adjustHandler(SetEditorLayoutAPICommand.execute));
CommandsRegistry.registerCommand({
id: SetEditorLayoutAPICommand.ID,
handler: adjustHandler(SetEditorLayoutAPICommand.execute),
description: {
description: 'Set Editor Layout',
args: [{
name: 'args',
schema: {
'type': 'object',
'required': ['groups'],
'properties': {
'orientation': {
'type': 'number',
'default': 0,
'enum': [0, 1]
},
'groups': {
'$ref': '#/definitions/editorGroupsSchema', // defined in keybindingService.ts ...
'default': [{}, {}],
}
}
}
}]
}
});
CommandsRegistry.registerCommand('_workbench.downloadResource', function (accessor: ServicesAccessor, resource: URI) {
const downloadService = accessor.get(IDownloadService);