···11+{
22+ // See http://go.microsoft.com/fwlink/?LinkId=827846
33+ // for the documentation about the extensions.json format
44+ "recommendations": [
55+ "dbaeumer.vscode-eslint"
66+ ]
77+}
+28
.vscode/launch.json
···11+// A launch configuration that launches the extension inside a new window
22+// Use IntelliSense to learn about possible attributes.
33+// Hover to view descriptions of existing attributes.
44+// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55+{
66+ "version": "0.2.0",
77+ "configurations": [
88+ {
99+ "name": "Extension",
1010+ "type": "extensionHost",
1111+ "request": "launch",
1212+ "runtimeExecutable": "${execPath}",
1313+ "args": [
1414+ "--extensionDevelopmentPath=${workspaceFolder}"
1515+ ]
1616+ },
1717+ {
1818+ "name": "Extension Tests",
1919+ "type": "extensionHost",
2020+ "request": "launch",
2121+ "runtimeExecutable": "${execPath}",
2222+ "args": [
2323+ "--extensionDevelopmentPath=${workspaceFolder}",
2424+ "--extensionTestsPath=${workspaceFolder}/test"
2525+ ]
2626+ }
2727+ ]
2828+}
+3
.vscode/settings.json
···11+// Place your settings in this file to overwrite default and user settings.
22+{
33+}
···11+# Change Log
22+All notable changes to the "vscode-cheer" extension will be documented in this file.
33+44+Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
55+66+## [Unreleased]
77+- Initial release
+65
README.md
···11+# vscode-cheer README
22+33+This is the README for your extension "vscode-cheer". After writing up a brief description, we recommend including the following sections.
44+55+## Features
66+77+Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
88+99+For example if there is an image subfolder under your extension project workspace:
1010+1111+\!\[feature X\]\(images/feature-x.png\)
1212+1313+> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
1414+1515+## Requirements
1616+1717+If you have any requirements or dependencies, add a section describing those and how to install and configure them.
1818+1919+## Extension Settings
2020+2121+Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
2222+2323+For example:
2424+2525+This extension contributes the following settings:
2626+2727+* `myExtension.enable`: enable/disable this extension
2828+* `myExtension.thing`: set to `blah` to do something
2929+3030+## Known Issues
3131+3232+Calling out known issues can help limit users opening duplicate issues against your extension.
3333+3434+## Release Notes
3535+3636+Users appreciate release notes as you update your extension.
3737+3838+### 1.0.0
3939+4040+Initial release of ...
4141+4242+### 1.0.1
4343+4444+Fixed issue #.
4545+4646+### 1.1.0
4747+4848+Added features X, Y, and Z.
4949+5050+-----------------------------------------------------------------------------------------------------------
5151+5252+## Working with Markdown
5353+5454+**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
5555+5656+* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
5757+* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
5858+* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
5959+6060+### For more information
6161+6262+* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
6363+* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
6464+6565+**Enjoy!**
+25
extension.js
···11+// The module 'vscode' contains the VS Code extensibility API
22+// Import the module and reference it with the alias vscode in your code below
33+const vscode = require('vscode')
44+const { getMessage } = require('./messages')
55+66+// this method is called when your extension is activated
77+// your extension is activated the very first time the command is executed
88+function activate() {
99+ const { emoji } = vscode.workspace.getConfiguration('cheer')
1010+ console.log('"vscode-cheer" standing by!')
1111+1212+ // Make a space for supportive messages
1313+ vscode.window.createStatusBarItem('left', 5)
1414+1515+ // On save —
1616+ vscode.workspace.onWillSaveTextDocument(function() {
1717+ // Display a message for a little bit
1818+ vscode.window.setStatusBarMessage(getMessage(emoji), 2500)
1919+ })
2020+}
2121+exports.activate = activate
2222+2323+// this method is called when your extension is deactivated
2424+function deactivate() {}
2525+exports.deactivate = deactivate
···11+/* global suite, test */
22+33+//
44+// Note: This example test is leveraging the Mocha test framework.
55+// Please refer to their documentation on https://mochajs.org/ for help.
66+//
77+88+// The module 'assert' provides assertion methods from node
99+const assert = require('assert')
1010+1111+// You can import and use all API from the 'vscode' module
1212+// as well as import your extension to test it
1313+// const vscode = require('vscode');
1414+// const myExtension = require('../extension');
1515+1616+// Defines a Mocha test suite to group tests of similar kind together
1717+suite('Extension Tests', function() {
1818+ // Defines a Mocha unit test
1919+ test('Something 1', function() {
2020+ assert.equal(-1, [1, 2, 3].indexOf(5))
2121+ assert.equal(-1, [1, 2, 3].indexOf(0))
2222+ })
2323+})
+22
test/index.js
···11+//
22+// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
33+//
44+// This file is providing the test runner to use when running extension tests.
55+// By default the test runner in use is Mocha based.
66+//
77+// You can provide your own test runner if you want to override it by exporting
88+// a function run(testRoot: string, clb: (error:Error) => void) that the extension
99+// host can call to run the tests. The test runner is expected to use console.log
1010+// to report the results back to the caller. When the tests are finished, return
1111+// a possible error to the callback or null if none.
1212+1313+const testRunner = require('vscode/lib/testrunner')
1414+1515+// You can directly control Mocha options by uncommenting the following lines
1616+// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
1717+testRunner.configure({
1818+ ui: 'tdd', // the TDD UI is being used in extension.test.js (suite, test, etc.)
1919+ useColors: true // colored output from test results
2020+})
2121+2222+module.exports = testRunner
+41
vsc-extension-quickstart.md
···11+# Welcome to your VS Code Extension
22+33+## What's in the folder
44+55+- This folder contains all of the files necessary for your extension.
66+- `package.json` - this is the manifest file in which you declare your extension and command.
77+88+The sample plugin registers a command and defines its title and command name. With this information
99+VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
1010+1111+- `extension.js` - this is the main file where you will provide the implementation of your command.
1212+1313+The file exports one function, `activate`, which is called the very first time your extension is
1414+activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
1515+We pass the function containing the implementation of the command as the second parameter to
1616+`registerCommand`.
1717+1818+## Get up and running straight away
1919+2020+- Press `F5` to open a new window with your extension loaded.
2121+- Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`.
2222+- Set breakpoints in your code inside `extension.js` to debug your extension.
2323+- Find output from your extension in the debug console.
2424+2525+## Make changes
2626+2727+- You can relaunch the extension from the debug toolbar after changing code in `extension.js`.
2828+- You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
2929+3030+## Explore the API
3131+3232+- You can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`.
3333+3434+## Run tests
3535+3636+- Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
3737+- Press `F5` to run the tests in a new window with your extension loaded.
3838+- See the output of the test result in the debug console.
3939+- Make changes to `test/extension.test.js` or create new test files inside the `test` folder.
4040+ - By convention, the test runner will only consider files matching the name pattern `**.test.js`.
4141+ - You can create folders inside the `test` folder to structure your tests any way you want.