pulsar/packages/tree-view
Spiker985 79820ef760
Remove @ from example to fix Documentation CI
Coffeescript function calls are prefixed with an @, which is the same syntax that jsdoc uses for parsing - which meant that it thought the example was empty.
2023-09-14 18:50:55 -04:00
..
keymaps Bundle tree-view code 2023-05-01 20:40:09 -07:00
lib Remove @ from example to fix Documentation CI 2023-09-14 18:50:55 -04:00
menus Bundle tree-view code 2023-05-01 20:40:09 -07:00
spec Manual decaf tree-view specs 2023-08-30 21:38:51 -07:00
styles Bundle tree-view code 2023-05-01 20:40:09 -07:00
.gitignore Bundle tree-view code 2023-05-01 20:40:09 -07:00
package-lock.json Call super before accessing this of classes 2023-09-04 12:34:58 -07:00
package.json Update package.json 2023-05-01 20:40:44 -07:00
README.md Bundle tree-view code 2023-05-01 20:40:09 -07:00

Tree View package

Explore and open files in the current project.

Press ctrl-\ or cmd-\ to open/close the tree view and alt-\ or ctrl-0 to focus it.

When the tree view has focus you can press a, shift-a, m, or delete to add, move or delete files and folders.

To move the Tree view to the opposite side, select and drag the Tree view dock to the other side.

API

This package provides a service that you can use in other Pulsar packages. To use it, include tree-view in the consumedServices section of your package.json:

{
  "name": "my-package",
  "consumedServices": {
    "tree-view": {
      "versions": {
        "^1.0.0": "consumeTreeView"
      }
    }
  }
}

Then, in your package's main module, call methods on the service:

module.exports =
  activate: -> # ...

  consumeTreeView: (treeView) ->
    selectedPaths = treeView.selectedPaths()
    # Do something with the paths...

The tree-view API has two methods:

  • selectedPaths() - Returns the paths to the selected tree view entries.
  • entryForPath(entryPath) - Returns a tree view entry for the given path.

Customization

The tree view displays icons next to files. These icons are customizable by installing a package that provides an atom.file-icons service.

The atom.file-icons service must provide the following methods:

  • iconClassForPath(path) - Returns a CSS class name to add to the file view.