You will need to set up a task to do this.
I apologise in advance if I get the short-cuts a bit wrong as I am sat using a different operating system. For anyone using Windows, it will be CTRL
- I think the OSX version just means using CMD
instead.
If you press CTRL
+ SHIFT
+ P
, you should get an action menu appear that allows you to search all commands.
Type Configure Task Runner
. If you don't already have one, this will create a tasks.json file in a settings folder for you. Otherwise, it will open the existing tasks.json file.
You can uncomment the TypeScript task that is built in - it looks like this (my main file is app.ts, the default in this file is HelloWorld.ts):
// A task runner that calls the Typescipt compiler (tsc) and
// Compiles a HelloWorld.ts program
{
"version": "0.1.0",
// The command is tsc.
"command": "tsc",
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// Under windows use tsc.exe. This ensures we don't need a shell.
"windows": {
"command": "tsc.exe"
},
// args is the HelloWorld program to compile.
"args": ["app.ts"],
// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"
}
You can then this task on demand using CTRL
+ SHIFT
+ B
.
If you have multiple tasks defined, you can use CTRL
+ E
and type task
(note the space after "task") and it will give you a list of all tasks for you to choose from.
Your hands don't need to leave the keyboard for any of this!
Lastly... if you are still getting nothing, check this icon at the bottom of the window as you may have a compiler error... (the icons below are showing one error - click on it in your editor for details).
