feat(cdk-explorer): add cdk/getConstructTree LSP route#1746
Merged
megha-narayanan merged 2 commits intoJul 22, 2026
Conversation
Exposes the source-decorated construct tree (flattened, one entry per tree path) via a custom LSP request so a client can overlay source links and an open-template action without re-implementing source resolution. The server already builds this tree for hover, definition, and CodeLens; onGetConstructTree serializes the cached tree in pre-order. Each entry carries sourceLocation, templateFile, and templateOffset (the resource block offset, resolved via cloud-assembly-api template ranges, each template parsed once). Returns no-assembly before synth. Tests cover the flattened pre-order tree, templateOffset placement, and the no-assembly case.
megha-narayanan
temporarily deployed
to
automation
July 21, 2026 17:29 — with
GitHub Actions
Inactive
megha-narayanan
had a problem deploying
to
automation
July 21, 2026 17:29 — with
GitHub Actions
Failure
megha-narayanan
requested a deployment
to
integ-approval
July 21, 2026 17:29 — with
GitHub Actions
Waiting
megha-narayanan
marked this pull request as ready for review
July 21, 2026 17:34
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1746 +/- ##
==========================================
+ Coverage 89.59% 89.64% +0.04%
==========================================
Files 78 78
Lines 11796 11847 +51
Branches 1657 1664 +7
==========================================
+ Hits 10569 10620 +51
Misses 1198 1198
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rix0rrr
approved these changes
Jul 22, 2026
megha-narayanan
enabled auto-merge
July 22, 2026 14:26
megha-narayanan
disabled auto-merge
July 22, 2026 14:27
megha-narayanan
had a problem deploying
to
integ-approval
July 22, 2026 14:32 — with
GitHub Actions
Failure
megha-narayanan
enabled auto-merge
July 22, 2026 14:33
Contributor
|
@mergify queue |
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.
Exposes the source-decorated construct tree over the language server so a client can overlay source links onto its own tree without re-implementing resolution. The server already builds this tree for hover, definition, and CodeLens; this adds a
cdk/getConstructTreerequest that serializes it.Each entry is flattened and keyed by construct path (as in tree.json), carrying the resolved source location, the template file, and the character offset of the resource's block in that template.
cachedIndex), so source locations and template files are exactly what hover and definition use. There is no second resolver to drift.Fixes #
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license