-
Notifications
You must be signed in to change notification settings - Fork 182
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
Display module hierarchy in the UI #698
Comments
Add terraform view container module view module tree view provider view menus module item module commands
Add terraform view container module view module tree view provider view menus module item module commands
Add terraform view container module view module tree view provider view menus module item module commands
Add terraform view container module view module tree view provider view menus module item module commands
To summarize what we discussed w/ @jpogran today for posterity: A question came up about what modules do we want to display in the UI. The initial idea was we would display just module calls of the module being edited, but it seems that the convention for similar tree views is to be relatively independent of the editor views and encompass the whole hierarchy of the top directory that is open in the workspace (whether or not any file from anywhere within the hierarchy is open). This opinion is supported mainly by Git Lens: https://gitlens.amod.io/#features where the extension would view all repositories within the hierarchy, as opposed to just the repository being edited. The latest version of the LS currently doesn't index all modules within the hierarchy, so if we are to pursue this idea of "high-level view" then we would need to change the implementation and do full indexing, so that we can actually obtain all modules and display all the data and avoid user-end confusion due to missing modules/data there. This may seem like a relatively simple change, but we still do need the module to have its own modules installed so that we can access the module manifest which contains metadata about all the modules in a readable format and more importantly would discover transitive dependencies. For example:
module "module-b" {
source = "github.com/hashicorp/module-b"
}
module "module-c" {
source = "github.com/hashicorp/module-c"
} Assuming we are editing While tracking uninitialized modules is a reasonable ask for some other reasons (such as go-to-definition for local submodules), it's not what we do currently in LS and would be a non-trivial amount of work to get it implemented at this moment. |
We can collect more feedback on this, but I would argue that maybe this is the difference between Explorer pane and a dedicated view with custom icon where a dedicated view is expected to be more high-level on the whole workspace, but the Explorer view can provide data relevant just to the directory in focus? At least it seems that's how the With that in mind I feel that the initial idea of displaying just modules relevant to the module in focus is not wrong if implemented in this way. However it does mean we should account for a few edge cases in the UI and display a corresponding (helpful) message:
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Use Cases
Many users use modules to abstract away conventions and common logic. They would benefit from knowing what modules does their module depend on and whether these modules have any other (transitive) module dependencies, all without having to browse through all the config files.
Expected User Experience
The expectation is that we'd use Tree View API, which would look approximately like this:
we may also consider adding the view directly under the Explorer menu, similar to this example from VS Code docs:
User would be able to see:
We may also consider implementing this as a WebView https://code.visualstudio.com/api/extension-guides/webview
Proposal
The text was updated successfully, but these errors were encountered: