-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clickable links in terraform plan output #1448
Comments
I like the idea! 👍🏻
Is the assumption that we'd just treat any space-separated word in the terminal output as something that could be a resource address, or is there any way to detect what process generated the output and hook only into Terraform output? At the risk of thinking outside the box (box being the extension)... This could theoretically be a Core feature where the rendered plan/apply includes links such as Downsides?
Upsides?
|
Related:
|
I love this as I am currently importing a lot of resources and going back and forth is a chore |
This would be amazing to have in core actually. Is there a way where we can connect with core team and send a feature request and/or pull request? |
Problem Statement
If you run any command in a VS Code terminal window that outputs text with a link in it, VS Code renders the text as a clickable link. This works for web links as well as file paths.
A terraform plan output contains output that has the names/ids of the resources, which are directly related to the definitions in the configuration files being parsed.
Expected User Experience
If you run
terraform plan
in a VS Code terminal window and hover over a resource definition, it should indicate that it is a clickable link. Clicking the link opens the relevant file where the declaration is defined.This is similar to the 'Go to Definition' experience.
Proposal
We can register a new terminal link handler that implements the vscode.TerminalLinkProvider interface using the vscode.window.registerTerminalLinkProvider method that will trigger when a user hovers over a line in the terminal. After detecting a resource statement, a call to terraform-ls can return location information where the statement is defined. If nothing is found, the line is left unmodified.
The text was updated successfully, but these errors were encountered: