Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>DeclaraTreeNew to Visual Studio Code? Get it now.
DeclaraTree

DeclaraTree

icode100

|
4 installs
| (0) | Free
A focused, VS Code-native project explorer for Java source workspaces with compact packages and semantic type icons.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

DeclaraTree

DeclaraTree is an independent VS Code extension for Java source workspaces. It adds a compact, source-focused project view to VS Code's existing Explorer sidebar without importing a build model, starting a language server, or running Apache Maven, Gradle, wrappers, tests, or workspace code.

Current release: 0.3.1

DeclaraTree icon

Project view

my-workspace                         Maven
├─ src/main/java                    main
│  └─ com.example.orders
│     ├─ Order                      class
│     ├─ OrderRepository            interface
│     ├─ OrderStatus                enum
│     └─ OrderNotFoundException     exception
├─ src/test/java                    test
├─ src/main/resources               resources
├─ mvnw
├─ mvnw.cmd
└─ pom.xml
DeclaraTree showing semantic Java types in the bundled demo project
  • Detects Maven, Gradle, nested-module, multi-root, and plain source workspaces.
  • Groups conventional, configured, and inferred source roots as main or test.
  • Compacts single-child package chains such as com → example → orders.
  • Omits .java from labels and uses the primary top-level declaration name.
  • Shows resource trees and build files while preserving the active file icon theme.
  • Displays empty packages under conventional and configured source roots.

Create from DeclaraTree

Use the folder-plus button in the DeclaraTree title bar to create a Java package without opening VS Code's normal File Explorer. The command chooses the active Java context when possible and otherwise asks for a source root.

Right-click a project, module, source root, package, or Java type and choose New:

  • New Java Type… offers Class, Interface, Enum, Record, Annotation, Abstract Class, Exception, and Test Class.
  • New Java Package… creates a validated package below the selected package.
  • A resource root or folder offers New Resource File… and New Resource Folder….

The same Java creation commands are available from the Command Palette. Files are created with VS Code's workspace filesystem APIs, including for writable remote and virtual workspaces. Existing files and folders are never replaced. Creation is rejected outside the open workspace, on read-only providers, for invalid Java names, or when the destination exists.

DeclaraTree opens a newly-created source or resource file in the editor, but it does not expand its own view unless the view was already visible. Likewise, opening or switching editor files never opens a collapsed DeclaraTree view. The explicit Reveal Active Java File command is the only reveal action allowed to open it.

Delete from DeclaraTree

Select a non-default package, Java source, resource file/folder, or recognized build file and press Delete (Cmd+Backspace on macOS), or right-click it and choose Delete…. Project and module roots, Java source roots, resource roots, the default package, read-only targets, symbolic links or junction paths, and targets containing unsaved text, notebook, or custom editors are protected.

Deletion always starts with a modal confirmation and asks the active VS Code filesystem provider to move the exact selected item to Trash. Packages and resource folders show an explicit recursive-content warning. Known not-found, permission, unavailable-provider, and stale-kind failures stop without offering permanent deletion. For an otherwise unclassified Trash-request failure, DeclaraTree describes the failure and requires a separate Delete Permanently confirmation; it never silently falls back. Compact package deletion targets only the displayed endpoint folder, leaving compacted ancestors in place because they may contain files not shown in the Java-only tree.

Semantic icons

DeclaraTree performs lightweight, dependency-free source analysis.

Meaning DeclaraTree icon Native Explorer badge
Class class symbol C
Interface interface symbol I
Enum enum symbol E
Record struct symbol R
Annotation type key symbol @
Abstract class class symbol A
Custom exception flame !
Exception handler/advice shield H
Test type beaker T

The classifier recognizes declaration kinds plus common exception, Spring Framework handler, and test signals. It is intentionally not a compiler or symbol solver, so indirect inheritance and custom meta-annotations may not be recognized.

Material Icon Theme compatibility

The DeclaraTree tree uses product icons supplied at runtime by VS Code. Ordinary resources and build files defer to the active file icon theme. In the normal File Explorer, DeclaraTree adds only a semantic badge and color decoration; it does not replace icons from Material Icon Theme or another installed theme.

Commands

  • Refresh DeclaraTree rescans the workspace.
  • Reveal Active Java File explicitly opens/reveals the current source in the view.
  • Copy Qualified Name copies a selected declaration's package-qualified name.
  • Reveal in File Explorer locates the selected item in VS Code's normal file tree.
  • New Java Package… is available from both the folder-plus title action and the right-click New submenu.
  • New Java Type… and the direct type commands create dependency-free skeletons.
  • Delete… requests Trash first for an eligible selected node; permanent fallback requires a separate confirmation.

Settings

Setting Default Purpose
declaratree.compactPackages true Combine package folders that contain only one child package.
declaratree.autoReveal true Select the active source only while DeclaraTree is already visible.
declaratree.showResources true Show conventional main and test resource folders.
declaratree.decorations.enabled true Add semantic badges without replacing normal Explorer icons.
declaratree.semanticRoleIcons true Prefer handler, exception, and test icons over base declaration icons.
declaratree.sourceRoots [] Add safe source-root paths relative to each workspace folder.
declaratree.exclude generated/build metadata glob Exclude generated, dependency, and metadata folders.
declaratree.maxFiles 15000 Limit indexed source files per workspace folder.

Install

DeclaraTree requires VS Code 1.96 or newer.

Visual Studio Marketplace

Open the Extensions view in VS Code, search for DeclaraTree by icode100, and choose Install, or run:

code --install-extension icode100.declaratree

View DeclaraTree on the Visual Studio Marketplace

Install from a VSIX

  1. Obtain declaratree-0.3.1.vsix.
  2. In VS Code, open Extensions.
  3. Choose Views and More Actions… (…) → Install from VSIX….
  4. Select the VSIX and reload VS Code if prompted.
code --install-extension .\declaratree-0.3.1.vsix

Safety and privacy

  • Discovery and classification are read-only; workspace writes occur only after an explicit New… command or a confirmed Delete… command.
  • Deletion is URI-native and Trash-first. Protected roots, symbolic-link/junction paths, read-only/unknown providers, and dirty text/notebook/custom-editor resources are rejected before mutation; an eligible permanent fallback requires a second modal confirmation.
  • No build tool, wrapper, task, test, terminal, compiler, or workspace executable is launched.
  • No telemetry is collected and the runtime makes no network requests.
  • Remote and virtual access uses vscode.workspace.fs, URI operations, and non-overwriting WorkspaceEdit creation.
  • Restricted Mode is supported because the extension neither executes nor evaluates workspace content.
  • The clipboard changes only after Copy Qualified Name.

See Architecture, Security, Third-Party Notices, Trademarks, and the Changelog.

Develop and package

Development requires Node.js 20 or newer and pnpm 11.

pnpm install --frozen-lockfile
pnpm check
pnpm test
pnpm build
pnpm run package:vsix

The VSIX has no runtime dependencies; development tools are excluded from the package.

License

MIT © 2026 icode100. See LICENSE.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft