CLion 2021.3 Help

TypeScript tool window

The TypeScript tool window lists compilation errors in TypeScript code. This list is not affected by changes you make to your code and is updated only when you invoke compilation again.

CLion shows this tool window only when the TypeScript Language Service is activated.

The tool window shows up only after you first compile your TypeScript code manually. After that the tool window is accessible via View | Tool Windows | TypeScript on the main menu or via the tool window bar.

See Compiling TypeScript into JavaScript.

Compile Errors

The tool window shows up only after you first compile your TypeScript code manually. This can be done in two ways:

  • Click the TypeScript widget on the Status bar, select Compile, and then select the compilation scope.

    By default, Compile All stands for Compile all TypeScript files in the whole project. To change this behavior, define another scope under the files property of your tsconfig.json file. Type the names of the files to process in the following format:

    "files" : ["<file1.ts>","<file2.ts>"],

    TypeScript: monitor compilation errors
  • Select Compile TypeScript from the context menu of any TypeScript file. All the TypeScript files in the default scope will be compiled, as when you select Compile All from the TypeScript widget,

After that the tool window is accessible via View | Tool Windows | TypeScript on the main menu or via the tool window bar.

The tool window lists all the compilation errors detected in the chosen scope. This list is not affected by changes you make to your code and is updated only when you invoke compilation manually again.

Error messages are grouped by files in which they were detected. To navigate to the code in question, double-click the corresponding error message or select it and choose Jump to Source from the context menu.

TypeScript widget

Item

Description

Compile

Select this option to invoke manual TypeScript compilation and then select the range of files to compile.

  • To compile the file in the active editor tab, choose the path to the file.

  • To use the scope defined in a tsconfig.json file, choose the path to the required tsconfig.json.

  • If you select Compile All, by default, the compiler runs in the whole project. To change this behavior, define another scope under the files property of your tsconfig.json file. Type the names of the files to process in the following format:

    "files" : ["<file1.ts>","<file2.ts>"],

Configure TypeScript

The Configure button

Select this option to open the Typescript page and edit the TypeScript settings.

Restart TypeScript Service

The Restart TypeScript Service button

Select this option to clear run the TypeScript Language Service anew.

Toolbar

Item

Tooltip and shortcut

Description

Expand all/Collapse all

Expand all

Ctrl+NumPad +

Collapse all

Ctrl+NumPad -

Use these buttons to have all nodes expanded or collapsed.

The Clear All button

Clear All

Click this button to remove all the error messages from the tool window.

The Close button

Close Ctrl+Shift+F4

Click this button to terminate the compiler and the TypeScript Language Service and close the tool window.

Context menu

Item

Icon and shortcut

Description

Jump to source

Jump to source

F4

Open the file where the selected error was detected and navigate to the fragment of code which caused the error.

Copy

Copy

Ctrl+C

Copy the selected error message with the information on the file, the line, and the column where the error was detected.

Navigate with single click

When this option is selected, clicking an error message brings you to the code which caused the problem.

Collapse All

Collapse all

Ctrl+NumPad -

Hide the error messages and show only the files where compilation errors are detected.

Expand All

Expand all

Ctrl+NumPad +

Unfold all the nodes in the tool window and show the error messages for each file.

Export to text file

Export to text file

Alt+O

Save a list of files where compilation errors occurred.

  1. In the Export Preview dialog that opens, specify the path to the text file where you want to store the list of files with compilation problems.

    To have the corresponding error messages saved as well, make sure the Details checkbox is selected.

    To save the list of erroneous files to the clipboard, click Copy.

    TypeScript tool window: Export Preview
  2. Click Save. If the specified file already exists, CLion asks you whether you want to overwrite this file or to append the new file list to it.

Last modified: 23 September 2021