- Generates a visual dependency tree within the VS Code explorer for easy navigation and understanding of project dependencies.
- Allows adding new dependencies directly from the tree view.
- Refreshes the tree view to reflect changes in the
package.jsonfile. - Provides a user-friendly interface with clear icons and labels.
- Open a Node.js project in VS Code.
- Access the "Package Explorer" view from the Activity Bar (icon: React logo).
- Generate the initial dependency tree using the "Dep-Tree-Generator: Generate Tree" command (Ctrl+Shift+P or Cmd+Shift+P).
- Interact with the tree:
- Expand and collapse dependencies to explore their relationships.
- Click the "Add" button to add new dependencies.
- Click the "Refresh" button to update the tree view.
- Icon Display Issue: Icons might still appear for dependencies with a collapsible state of "None" under certain conditions. This is currently being investigated.
Feel free to contribute to this extension! Please follow these steps:
- Fork this repository.
- Make your changes.
- Submit a pull request.
This extension is licensed under the MIT License.
For any questions or feedback, please contact [your name or email address].
- Supported VS Code Versions: 1.85.0 or higher
- Required Dependencies:
@types/vscode@types/mocha@types/node@typescript-eslint/eslint-plugin@typescript-eslint/parsereslinttypescript@vscode/test-cli@vscode/test-electron
This class is responsible for providing data for the tree view. It contains the following methods:
Initializes the class with the root path of the workspace.
Returns the given element as a tree item.
Returns the child dependencies of the given element or the top-level dependencies if no element is provided.
Reads the package.json file at the given path and returns an array of dependencies.
This class represents a dependency in the tree view. It extends the vscode.TreeItem class and includes thefollowing properties:
label: string: The name of the dependency.version: string: The version of the dependency.collapsibleState: vscode.TreeItemCollapsibleState: The collapsible state of the dependency (either "None" or"Collapsed").tooltip: string: The tooltip text for the dependency.description: string: The description text for the dependency.iconPath: { light: string, dark: string }: The path to the icon file for the dependency.
This sample uses following contribution points, activation events and APIs
viewsviewsContainersmenuview/titleview/item/context
onView:${viewId}
window.createTreeViewwindow.registerTreeDataProviderTreeViewTreeDataProvider
- Open this example in VS Code Insiders
npm installnpm run watchF5to start debugging- Node dependencies view is shown in Package explorer view container in Activity bar.
- FTP file explorer view should be shown in Explorer