Add design instantiation hierarchy view#111
Open
nohous wants to merge 1 commit into
Open
Conversation
Adds a VHDL Hierarchy activity-bar view that renders the project's
design instantiation tree by calling two custom requests on the language
server, vhdl/designHierarchy and vhdl/designHierarchyCandidates.
Picking a top entity opens a quick-pick pre-populated from the server:
real top candidates (entities with no incoming instantiations) come
first, deepest subtree first, so the intended top of the design
typically sits at the top of the list. Each candidate shows the depth
and instance count plus the entity declaration's file path. Free-text
input is supported as a fallback. The chosen top is persisted to
`vhdlls.topEntity` (workspace scope when available; user scope
otherwise) and reloaded on the next session.
Tree nodes show `instance_label : library.entity(architecture)` with an
icon per node kind (top, bound component, unbound component,
configuration, unresolved). Clicking a node opens the file at the
instantiation site (or, for the top node, at the entity declaration).
If the active vhdl_ls does not implement the new requests
(method-not-found, -32601), the view shows a notice and the picker
displays a one-shot warning instead of failing silently.
Contributions
- Commands: vhdlls.showHierarchy, vhdlls.setHierarchyTop,
vhdlls.refreshHierarchy.
- View container `vhdlHierarchyContainer` with the `vhdlHierarchy`
view; refresh and edit-top buttons in the title bar.
- Setting `vhdlls.topEntity` (string, e.g. `work.top`).
Version bumped to 0.8.0; CHANGELOG and README updated. Requires a
vhdl_ls build that implements the corresponding LSP requests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a VHDL Hierarchy activity-bar view that renders the project's design instantiation tree. Picking a top entity opens a quick-pick pre-populated from the language server with real top candidates first (deepest subtree first), so the intended top of the design typically sits at the top of the list. The chosen top is persisted to
vhdlls.topEntityand reloaded on the next session.Depends on the companion language-server PR: VHDL-LS/rust_hdl#461. Until a
vhdl_lsrelease ships with that PR, the auto-downloaded server will return method-not-found and the view will display a notice instead of failing silently.Why
Hierarchy overview is one of the most-requested features for any HDL editor. Standard LSP doesn't have a notion of design hierarchy, so the server PR adds two custom requests; this PR consumes them.
What's added
Contributions (
package.json)vhdlls.showHierarchy,vhdlls.setHierarchyTop,vhdlls.refreshHierarchyvhdlHierarchyContainerin the activity barvhdlHierarchyview inside it, with refresh and edit-top buttons in the title barvhdlls.topEntity(string, e.g.work.top)UX
vhdl/designHierarchyCandidates, splits results into "Top candidates (no incoming instantiations)" and "Other entities", sorts deepest-first within each section, and shows each entry with depth + instance count + file path. Free-text input is supported as a fallback (last item: "Type a custom entity name...").instance_label : library.entity(architecture)with an icon per kind (top, bound component, unbound component, configuration, unresolved). Clicking opens the file at the instantiation site; for the top node, at the entity declaration. Notes (multi-architecture warning, cycle, unbound) appear in the tooltip.vhdlls.topEntityto Workspace settings (or User if no workspace is open). On next session the view auto-loads.vhdl_lsdoesn't implement the requests (LSPMethodNotFound, -32601), the view shows a notice telling the user to update or pointvhdlls.languageServerUserPathat a newer build, rather than just failing.Implementation notes
TreeElementunion to keep status-message rows separate from real instantiation nodes (no overloaded constructor).LspLocationinterface that matches the on-the-wire JSON shape (server sendsurias a string, not a deserialisedUri).LanguageClientis injected through the provider; no module-level globals.Version bumped to 0.8.0; CHANGELOG and README updated with a new "Design Hierarchy" section.
Test plan
npm run compilecleanvhdl_ls(no hierarchy support) the view shows the "method not found" notice and the picker shows the warning toast instead of erroring