Files
vscode-extension-samples/tree-view-sample
Barbara Valdez bee31a77ed Implement drag and drop controller (#431)
* implement drag and drop in sample

* clean code

* fix reveal command

* remove unnecessary method

* fix getParent to return the existing node instead of creating a new key

* Linting, naming, etc.

Co-authored-by: Alex Ross <alros@microsoft.com>
2021-06-23 15:37:55 +02:00
..
2020-05-29 14:20:07 -07:00
2017-06-02 14:27:05 +02:00
2018-11-19 12:17:15 +01:00
2020-05-29 14:01:37 -07:00
2020-05-29 14:13:32 -07:00
2020-12-01 11:03:07 +01:00
2017-06-02 14:27:05 +02:00
2021-06-11 17:01:56 -07:00
2020-05-06 12:14:11 -07:00
2021-03-27 15:30:10 +03:00

Views & View Containers

This sample demonstrates how to implement and contribute a tree view in VS Code. This includes:

  • Contributing views and view containers.
  • Contributing actions in various location of the view.
  • Implementing the tree data provider for the view.
  • Creating and working with the view.

This sample provides following views

  • Node dependencies view
  • Ftp file explorer view

Following example shows Node dependencies view in Package Explorer View container.

Package Explorer

VS Code API

This sample uses following contribution points, activation events and APIs

Contribution Points

  • views
  • viewsContainers
  • menu
    • view/title
    • view/item/context

Activation Events

  • onView:${viewId}

APIs

  • window.createTreeView
  • window.registerTreeDataProvider
  • TreeView
  • TreeDataProvider

Refer to Usage document for more details.

Running the Sample

  • Open this example in VS Code Insiders
  • npm install
  • npm run watch
  • F5 to start debugging
  • Node dependencies view is shown in Package explorer view container in Activity bar.
  • FTP file explorer view should be shown in Explorer