diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a132a04214..99ea9b0775 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -16,15 +16,39 @@ // the command is a shell script "isShellCommand": true, - // show the output window only if unrecognized errors occur. - "showOutput": "silent", + "tasks": [ + { + "taskName": "install", + "showOutput": "always" + }, + { + "taskName": "compile", + "suppressTaskName": true, - // we run the custom script "compile" as defined in package.json - "args": ["run", "compile"], + // show the output window only if unrecognized errors occur. + "showOutput": "silent", - // The tsc compiler is started in watching mode - "isWatching": true, + // we run the custom script "compile" as defined in package.json + "args": ["run", "compile"], - // use the standard tsc in watch mode problem matcher to find compile problems in the output. - "problemMatcher": "$tsc-watch" -} \ No newline at end of file + // use the standard tsc problem matcher to find compile problems in the output. + "problemMatcher": "$tsc" + }, + { + "taskName": "compile-watch", + "suppressTaskName": true, + + // show the output window only if unrecognized errors occur. + "showOutput": "silent", + + // we run the custom script "compile-watch" as defined in package.json + "args": ["run", "compile-watch"], + + // The tsc compiler is started in watching mode + "isWatching": true, + + // use the standard tsc in watch mode problem matcher to find compile problems in the output. + "problemMatcher": "$tsc-watch" + } + ] +} diff --git a/docs/development.md b/docs/development.md index 15be7089ca..65d4fb76e4 100644 --- a/docs/development.md +++ b/docs/development.md @@ -2,29 +2,51 @@ ## Building the code -First, install the package dependencies: +1. Install [Node.js](https://nodejs.org/en/) 4.4.1 or higher. -``` -npm install -``` +2. Install the package dependencies by running one of the following commands: -Now you can compile the code: + ``` + # From a PowerShell prompt + npm install -``` -npm run compile -``` + # Or from Visual Studio Code + Press Ctrl+P and type "task install" + ``` -After the initial compile, the source files will be watched and recompiled -when changes are saved. +3. Compile the code by running one of the following commands: + + ``` + # From a PowerShell prompt + npm run compile + + # Or from Visual Studio Code + Press Ctrl+P and type "task compile" + ``` + This will compile the TypeScript files in the project to JavaScript files. + + OR + + You can compile the files and then have the TypeScript compiler watch for changes to + the source files and automatically recompile those files when changes are saved. + To do this, run one of the following commands: + + ``` + # From a PowerShell prompt + npm run compile-watch + + # Or from Visual Studio Code + Press Ctrl+P and type "task compile-watch" + ``` ## Running the compiled code -From a PowerShell or cmd.exe prompt, run the following command: +1. From a PowerShell prompt, run the following command: + + ``` + code --extensionDevelopmentPath="c:\path\to\vscode-powershell" . + ``` -``` -code --extensionDevelopmentPath="c:\path\to\vscode-powershell" . -``` - -If you allow the compiler to continue watching for file changes, you can use -the `Reload Window` command found in the command palette `(Ctrl+Shift+P)` -so that the new source files are loaded. +2. If you allow the compiler to continue watching for file changes, you can use + the `Reload Window` command found in the command palette `(Ctrl+Shift+P)` + so that the new source files are loaded. diff --git a/package.json b/package.json index 78a6743de4..493124b7e5 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,8 @@ "scripts": { "postinstall": "node ./node_modules/vscode/bin/install", "vscode:prepublish": "node ./node_modules/vscode/bin/compile", - "compile": "node ./node_modules/vscode/bin/compile -watch -p ./" + "compile": "node ./node_modules/vscode/bin/compile -p ./", + "compile-watch": "node ./node_modules/vscode/bin/compile -watch -p ./" }, "contributes": { "keybindings": [