-
Notifications
You must be signed in to change notification settings - Fork 131
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
Watch provider changes to cache schema #16
Comments
The reason we should consider implementing this method is because under certain conditions it would limit the number of file-watchers running alongside each other, potentially even monitoring the same files, which is suboptimal. The LSP's assumption is that there will usually be less clients than servers and so centralisation of such logic can save resources. I decided not to implement it initially though, because we can't afford just having invalid cache when the client doesn't implement that method, so having a built-in watcher seems like a necessary baseline to start with. We can however add this later to provide some resource relief to those who use clients that support this.
There are actually two things I mixed up. Firstly there is path for custom provider binaries - which seems to be always The second one, which is the one LS should actually be interested in is the path to the plugin cache which can be set via CLI config file or ENV variable We can revisit this later. Importantly this does NOT mean we wouldn't support third party plugins - these can be installed into the appropriate location and will get picked up by |
Obtaining schema is expensive and can take ~1 second even on a smaller provider such as
github
.We should consider caching the schema as part of
initialize
and invalidating the cache whenever the provider changes (as the schema it would output may changed).Possibly related to https://github.com/radeksimko/terraform-ls/issues/15 - we might be able to watch for
.terraform
directory changes, but we need to reflect the reality of LSP clients not supportingworkspace/didChangeWatchedFiles
, such as Sublime TextWe also might want to account for users storing providers outside of current work directory - i.e. we can just error out if there is no
.terraform
repository and noTF_PLUGIN_DIR
ENV variableThe text was updated successfully, but these errors were encountered: