You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure which part of the extension exactly decides which files to watch and send as part of didChangeWatchedFiles, but I noticed that it's attempting to report files in the Terraform cache to the server: https://gist.github.com/radeksimko/12e7d68005a95b87c2b4fd813354f888
I believe that .terraform should be excluded from these events (from being watched), because:
Editing cached modules is not a practice we should be encouraging, so the server does not intend to support editing these files
Even if there is some server logic which relies on .terraform contents, the server will likely always prefer watching and interpreting it directly from the disk, because it cannot rely on every server to watch hidden directories for essential functions. (some LSP plugins leave this as user-configurable, which leaves a lot of room for error)
It can generate a lot of requests when terraform init runs
This is somewhat related to hashicorp/terraform-ls#137
The server doesn't support workspace/didChangeWatchedFiles yet and so it can generate more errors than expected as a result of the above.
This adds the `.terraform` cache directory to the file watcher exclude list by default. A user can override this by configuring `files.watcherExclude` in their user or workspace settings file.
Closes#405
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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
I'm not sure which part of the extension exactly decides which files to watch and send as part of
didChangeWatchedFiles
, but I noticed that it's attempting to report files in the Terraform cache to the server:https://gist.github.com/radeksimko/12e7d68005a95b87c2b4fd813354f888
I believe that
.terraform
should be excluded from these events (from being watched), because:.terraform
contents, the server will likely always prefer watching and interpreting it directly from the disk, because it cannot rely on every server to watch hidden directories for essential functions. (some LSP plugins leave this as user-configurable, which leaves a lot of room for error)terraform init
runsThis is somewhat related to hashicorp/terraform-ls#137
The server doesn't support
workspace/didChangeWatchedFiles
yet and so it can generate more errors than expected as a result of the above.We may consider offloading watching to the client by dynamic registration of paths per https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeWatchedFiles but I think that
.terraform
should be excluded by default.Related: hashicorp/terraform-ls#867
The text was updated successfully, but these errors were encountered: