-
Notifications
You must be signed in to change notification settings - Fork 14
TypeScript BuildPath
In a lot of Eclipse plugins (JDT, JSDT, other TypeScript plugins), they use Eclipse Nature which is used to for instance showing some menus according the nature of the Eclipse project.
TypeScript IDE doesn't use Eclipse Nature because a TypeScript project can be created with other IDE like VSCode, Atom, WebStorm, etc.
For TypeScript IDE, an Eclipse project is a TypeScript project if it contains one or more tsconfig.json files. The problem is that tsconfig.json files can be hosted in any folders of the project. To avoid scanning each time the whole of files of project each time, TypeScript IDE uses the following rules:
-
search
tsconfig.jsoninside root project and/srcfolder. If atsconfig.jsonfile exists in this location, the project hasTypeScript Nature. -
if
tsconfig.jsonis not found in the default location, you can add one or several folders of your project by usingTypeScript Build Path.
When a project has TypeScript Nature:
- it display
TypeScript Resourcesin the root of project inside theProject Explorer:

- the
TypeScriptmenu item of the project properties is shown:

Please note that TypeScript IDE doesn't need TypeScript Nature if you wish to use just completion, hover, search inside TypeScript Editor since it consummes tsserver.
When a project is loaded, TypeScript IDE searches tsconfig.json inside root project and /src folder. If a tsconfig.json file exists in this location, the project has TypeScript Nature but you could have not this rule in your Eclipse project.
If you are in this case, you must configure Build Path by setting where your(s) tsconfig.json are hosted. TypeScript Build Path is a list of folders which contains a tsconfig.json file in the root folder. Build Path is used for:
-
TypeScript Nature. - Compilation
- Validation
Here a demo with add/remove Build Path:

To add Build Path, select your custom folder which contains your tsconfig.json, open contextual menu and select Add to TypeScript BuildPath...
To remove Build Path, select your custom folder which contains your tsconfig.json, open contextual menu and select Remove to TypeScript BuildPath...
TODO : manage default build path with UI preferences to add other default folder (see issue 55).
TODO: working on this issue.
Working but I think more and more to remove WTP Validator which is very slow because it loop for the whole files of the project when "Validation Builder" is activated.
- TypeScript IDE
- New and Noteworthy