|
for Windows and Linux
for macOS
⌘,⌘,⌘,⌥F7⌃⌥S
In this dialog:
-
Choose whether you want to use the TypeScript Language Service
or to get coding assistance from IntelliJ IDEA only.
-
Activate, deactivate, and configure the behaviour of the built-in TypeScript compiler.
| Item | Description |
|---|
|
Node interpreter
|
In this field,
specify the location of the Node.js executable file. In most cases, IntelliJ IDEA
detects the Node.js executable and fills in the field automatically.
| |
TypeScript version
|
In this area,
specify the version of the compiler to use (IntelliJ IDEA displays the currently chosen version):
-
Click Edit.
-
In the Configure TypeScript Compiler dialog box that opens, choose one of the following options:
-
Detect: if you choose this option, IntelliJ IDEA searches for a
typescript package in the current project.
If a typescript package is found, IntelliJ IDEA uses it. Otherwise the default bundled package is used.
This option is chosen by default.
-
Bundled: if you choose this option, IntelliJ IDEA uses it without attempting to find another
typescript package.
-
Custom directory: choose this option to use a custom version of the compiler.
In the text box, specify the location of the
typescriptServices.js, lib.d.ts, and lib.es6.d.ts files
downloaded from https://github.com/Microsoft/TypeScript/ .
| |
Use TypeScript Service
|
Select this checkbox
to get native support from the TypeScript Language Service
according to the up-to-date specifications. As a result:
-
Syntax and error highlighting is based on the annotations from the TypeScript Language Service.
-
Completion lists contain both suggestions from the TypeScript Language Service and suggestions calculated by IntelliJ IDEA.
To get only suggestions from IntelliJ IDEA, click Configure and clear the Code completion checkbox
in the Service Options dialog that opens.
IntelliJ IDEA supports integration with the Angular language service
developed by the Angular team to improve code analysis and completion for Angular-TypeScript projects.
Note that the Angular language service works only with the projects that use Angular 2.3.1 or higher
and TypeScript version compatible with it.
The Angular language service is activated by default so IntelliJ IDEA starts it automatically together with the TypeScript service
and shows all the errors and warnings in your TypeScript and HTML files both in the editor
and in the TypeScript Compiler Tool Window.
However if you still need to activate the service, click Configure
and select the Use Angular service checkbox in the Service Options dialog box that opens.
In the Default options field,
specify the command line options to be passed to the compiler when the tsconfig.json file is not found.
See the list of acceptable options at TSC arguments .
Note that the -w or --watch (Watch input files) option is irrelevant.
By default, the Use TypeScript Service checkbox is selected.
| |
Enable TypeScript Compiler
|
Select this checkbox to activate the built-in compiler.
When the checkbox is selected, syntax highlighting and code completion are provided based only on the data from the built-in TypeScript compiler.
After you select this checkbox, the fields below in the area become active
and you can configure the behaviour of the compiler.
By default, the checkbox is cleared.
| |
Track changes
|
| |
Scope
|
From this drop-down list, choose the scope to apply the compiler in. The available options are:
-
Project Files: all the files within the project
content roots (see Content Root and Configuring Content Roots).
-
Project Production Files: all the files within the project content roots excluding test sources.
-
Project Test Files: all the files within the project test source roots.
-
Open Files: all the files that are currently opened in the editor.
VCS Scopes: these scopes are only available if your project is under version control.
-
Changed Files: all changed files, that is, all files associated with all existing changelists.
-
Default: all the files associated with the changelist
Default.
Alternatively, click the Browse button and configure a custom scope in the Scopes dialog box that opens.
For more details on scopes, see
the pages Scopes and
Scopes dialog.
| |
Use tsconfig.json
|
Choose this option to
have the built-in compiler analyze the code according to the settings specified in the tsconfig.json file.
When you open a project, IntelliJ IDEA starts searching for a tsconfig.json file in it. If a tsconfig.json file is found,
the compiler uses the options specified in it. Otherwise an error is reported.
| |
Set options manually
|
Choose this option to configure the behaviour of the built-in compiler manually:
-
Select the Generate source maps checkbox
to generate source maps
that set correspondence between lines in your TypeScript code and in the generated JavaScript code,
otherwise your breakpoints will not be recognised and processed correctly.
-
Select the Compile main file only checkbox
to have IntelliJ IDEA compile only a specific file and the files that are referenced from it and ignore all the other files in the project.
This may be helpful if you have a dedicated
main.ts file which only references other files.
-
Select the Use output path checkbox
to have the built-in compiler store the generated JavaScript files and source map in a custom folder.
Specify the path to this folder explicitly or use one of the listed available macros in the format:
$<macros_name>$.
The available macros are:
-
FileDir: the path to the folder where the file is stored.
-
FileRelativeDir: the path to the file directory relative to the project root.
-
FileDirRelativeToProjectRoot:
the path to the file directory relative to the module content root the file belongs to.
-
ModuleFileDir:
the path to the module root folder.
-
SourcePath:
the path to the source folder under the content root to which the file belongs,
see Configuring Content Roots.
-
FileDirRelativeToSourcePath:
the path to the file relative to the source folder under the content root to the file belongs.
|
See AlsoProcedures:
Reference:
|