Update hellocode-minimal-sample. Fix #116

This commit is contained in:
Pine Wu
2018-11-05 23:31:13 -08:00
parent 5b67aaac47
commit 52b7c255b1
4 changed files with 37 additions and 2 deletions

View File

@ -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

View 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
![demo](demo.gif)
## 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.

View File

@ -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

View File

@ -17,5 +17,11 @@
"title": "Hello World"
}
]
},
"scripts": {
"postinstall": "node ./node_modules/vscode/bin/install"
},
"devDependencies": {
"vscode": "^1.1.17"
}
}