mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Provide example of openFolder getting started commands
This commit is contained in:
@ -15,7 +15,8 @@
|
||||
"onCommand:getting-started-sample.runCommand",
|
||||
"onCommand:getting-started-sample.changeSetting",
|
||||
"onCommand:getting-started-sample.setContext",
|
||||
"onCommand:getting-started-sample.sayHello"
|
||||
"onCommand:getting-started-sample.sayHello",
|
||||
"onCommand:getting-started-sample.viewSources"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"contributes": {
|
||||
@ -26,10 +27,10 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"commands":[
|
||||
"commands": [
|
||||
{
|
||||
"category": "file",
|
||||
"title": "Say Hello",
|
||||
"title": "Getting Started Sample: Say Hello",
|
||||
"shortTitle": "Say Hello (This is the name used in the New File quick pick)",
|
||||
"command": "getting-started-sample.sayHello"
|
||||
}
|
||||
],
|
||||
@ -170,6 +171,15 @@
|
||||
"media": {
|
||||
"markdown": "media/linux.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "showSources",
|
||||
"title": "View Sources",
|
||||
"description": "Open a folder containg the sources of this extension.\n[View Sources](command:getting-started-sample.viewSources)",
|
||||
"media": {
|
||||
"image": "media/image.png",
|
||||
"altText": "Empty image"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -24,4 +24,8 @@ export function activate(context: vscode.ExtensionContext): void {
|
||||
context.subscriptions.push(vscode.commands.registerCommand('getting-started-sample.sayHello', () => {
|
||||
vscode.window.showInformationMessage('Hello');
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('getting-started-sample.viewSources', () => {
|
||||
return { openFolder: vscode.Uri.joinPath(context.extensionUri, 'src') };
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user