mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Update hellocode-minimal-sample. Fix #116
This commit is contained in:
@ -21,7 +21,7 @@ You can expect from each sample:
|
||||
## Getting Started
|
||||
|
||||
- [Hello Code Sample](hellocode-sample): The Hello World sample for VS Code.
|
||||
- [Hello Code Minimal Sample](hellocode-sample): A minimal version of Hello Code Sample that doesn't use TypeScript.
|
||||
- [Hello Code Minimal Sample](hellocode-minimal-sample): A minimal version of Hello Code Sample that doesn't use TypeScript.
|
||||
|
||||
## Samples
|
||||
|
||||
|
||||
25
hellocode-minimal-sample/README.md
Normal file
25
hellocode-minimal-sample/README.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Hello Code Minimal Sample
|
||||
|
||||
This is a minimal version of the [Hello Code Sample](../hellocode-sample).
|
||||
|
||||
It does not use TypeScript and only includes the `vscode` devDependency needed for extension development.
|
||||
|
||||
## Demo
|
||||
|
||||

|
||||
|
||||
## VS Code API
|
||||
|
||||
### `vscode` module
|
||||
|
||||
- [`commands.registerCommand`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#commands.registerCommand)
|
||||
- [`window.showInformationMessage`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#window.showInformationMessage)
|
||||
|
||||
### Contribution Points
|
||||
|
||||
- [`contributes.commands`](https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributescommands)
|
||||
|
||||
## Running the Sample
|
||||
|
||||
- Run `npm install` in terminal to install dependencies
|
||||
- Run the `Run Extension` target in the Debug View.
|
||||
@ -4,10 +4,14 @@ const vscode = require('vscode');
|
||||
|
||||
// this method is called when your extension is activated
|
||||
// your extension is activated the very first time the command is executed
|
||||
|
||||
/**
|
||||
* @param {vscode.ExtensionContext} context
|
||||
*/
|
||||
function activate(context) {
|
||||
// Use the console to output diagnostic information (console.log) and errors (console.error)
|
||||
// This line of code will only be executed once when your extension is activated
|
||||
console.log('Congratulations, your extension "hellocode-sample" is now active!');
|
||||
console.log('Congratulations, your extension "hellocode-minimal-sample" is now active!');
|
||||
|
||||
// The command has been defined in the package.json file
|
||||
// Now provide the implementation of the command with registerCommand
|
||||
|
||||
@ -17,5 +17,11 @@
|
||||
"title": "Hello World"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./node_modules/vscode/bin/install"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vscode": "^1.1.17"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user