getWorkspaceFolders

Supported from HBuilderX 2.7.12+

Get all project objects under the project explorer (not including closed projects)

Parameter

No

Returns

Type Description
Promise<Array<WorkspaceFolder>> All projects under the project manager

Example

  1. var wsPromise = hx.workspace.getWorkspaceFolders();
  2. wsPromise.then(function(wsFolders) {
  3. console.log("Number of projects included in the project manager:",wsFolders.length);
  4. });

WorkspaceFolder

A workspace folder is one of potentially many roots opened by the editor. All workspace folders are equal which means there is no notion of an active or primary workspace folder.

Attribute list

Attribute name Type Description
uri String or Uri Project Path
name String Project directory name
nature String Project Type
id String Project ID