feat: support source tracing for python#1674
Merged
megha-narayanan merged 5 commits intoJun 29, 2026
Merged
Conversation
Parse jsii host-language (Python/Java) creation-stack frames in the source resolver and remove the TypeScript-only diagnostics gate, so go-to-definition and policy violations work for non-TypeScript CDK apps synthed with JSII_HOST_STACK_TRACES=1. Verified end to end against jsii 1.137.0 and aws-cdk-lib 2.260.0.
Co-authored-by: Otavio Macedo <288203+otaviomacedo@users.noreply.github.com>
otaviomacedo
approved these changes
Jun 29, 2026
normalizeHostFrame preserves a real host column and clamps the 0 'unavailable' sentinel to 1. Update the test to expect the column unchanged and refresh the stale 0-indexed comments.
jsii's Java runtime sends only a bare source filename (getFileName()) with no path, so Java frames can't be located without source-root reconstruction. Ship Python source tracing only; track Java as a follow-up.
1 task
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.
Add utilities to source resolver to parse jsii host-language creation-stack frames for Python, and drop the TypeScript-only diagnostics gate. Go-to-definition (source → template, and reverse) and policy-violation diagnostics now work for Python apps, not just TypeScript.
Requires synthing with
JSII_HOST_STACK_TRACES=1(opt-in; jsii 1.137+ / aws-cdk-lib 2.260+). Auto-enabling it for LSP-triggered synth is a follow-up. Java support separated into new PR due to FQN path parsing complexities.Example:

Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license