-
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
Migrating from terraform.languageServer.rootModules
to VSC workspaces
#1543
Comments
Hi @Makeshift
This setting became deprecated and no-op already in 2.24.0 (in LS 0.29.0) which was released in August last year (to both stable and pre-release). Therefore I do not understand how the following is possible. 🤔
In case you are in fact migrating from version older than On the note of performance In general, this option was never expected to do anything different to what workspaces achieve today - that is to let the user explicitly index a folder. I recall that we have made other changes which are less related to the setting deprecation - specifically that we index not just the files within the given folder but recursively walk all nested folders and index any nested files. This may be what impacted the performance for some users. Indexing nested modules comes with some trade-offs and we could consider making the depth configurable. In terms of possible workarounds, before we find more permanent solutions to the performance issues, you could try to disable/enable the extension selectively for the individual workspaces and work across different workspaces. i.e. have one workspace for the root folder (where the extension remains disabled) + any number of separate ones for the individual Terraform modules (where the extension remains enabled). You may notice these options in the Extensions sidebar: I hope that helps! |
@radeksimko Thank you for your detailed response! It sounds like I may have been at the mercy of some caching, which could have confused me into thinking one configuration was working better than another. With some experimentation, I've gotten it to be seemingly stable, and I don't foresee anything quite as weird as my current heavily-nested project in the near future (I primarily use Terragrunt anyway, making interactions between stacks a lot simpler and making modules more... modular). I'll close this issue for the moment and if I encounter any more specific issues I'll open a new one with better detail. |
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. |
Description
To try and help alleviate some issues with insanely high CPU usage and slow responses from the extension (#1328, #1355, #1516 etc), I switched to the pre-release version of the extension.
I noticed that in the pre-release, the
terraform.languageServer.rootModules
is marked as deprecated and is a no-op, probably due to hashicorp/terraform-ls#704 and similar PRs. Based on my experimentation, the only way I'm able to make the extension vaguely useable and not kill my machine is to specifically set my two root modules with this setting (on the current released version, 2.27.0 with terraform-ls 0.31.3).Based on the Readme in this repository, it isn't clear how to migrate my project over to vscode workspaces in such a way that allows the extension to run correctly, and my workspace remaining easy to use. For reference, this is my approximate folder structure:
With this layout, I open
project
in vscode, and that's it. This is in my workspacessettings.json
:Is this layout insane, and therefore unsupported by the extension, or is there a migration path for removing
rootModules
and moving over to workspaces for this?The extension is usable at the moment with the
rootModules
setting. It is completely unusable and streams continuous noise into theHashiCorp Terraform
output log without the setting.Links
https://github.com/hashicorp/vscode-terraform/blob/main/README.md
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: