-
Notifications
You must be signed in to change notification settings - Fork 130
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
Expose Terraform-related options via native LSP "InitializationOptions" #240
Comments
@radeksimko is this open for external first time contributors to this project? I'd like to work on this. |
Hi @danishprakash |
This comment has been minimized.
This comment has been minimized.
@radeksimko thanks for the info. I've implemented the changes for PS. the relevant client changes required to test these changes end to end are here. |
It looks reasonable at first sight. We usually prefer to just raise the PR straight away (at this stage) as we can discuss on the relevant LOC there instead of abstractly pointing to it from here. |
Reopening until remaining 2 options are added. |
And I take back what I said about |
Sure, will look into those. Thanks for the help! |
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. |
Current Version
Use-cases
Currently we only expose
rootModulePaths
in "LSP native" configuration:terraform-ls/internal/settings/settings.go
Lines 11 to 13 in a1ff20f
Some runtime settings which we don't strictly need to know before the server is actually initialized is still exposed via CLI flags only, e.g. all Terraform-related options:
terraform-ls/commands/serve_command.go
Lines 43 to 47 in a1ff20f
We execute Terraform after the initialization, so these settings would be better suited for the LSP native configuration, which in the long run could also be modified at runtime via
workspace/didChangeConfiguration
.Attempted Solutions
Keep using flags
Proposal
We can expose the configuration as
terraformExecPath
,terraformExecTimeout
andterraformLogPath
.terraform-ls/internal/settings/settings.go
Lines 15 to 18 in a1ff20f
I wouldn't go as far as removing the existing flags in favour of LSP settings yet, but I would document that as the preferred way of configuring these options and I would only allow one of these ways of configuring any option at a time. i.e. I would error out the initialization if the same settings is provided via flag and LSP.
The text was updated successfully, but these errors were encountered: