Skip to content
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

Ask to terraform init an uninitialized workspace #106

Closed
paultyng opened this issue May 21, 2020 · 6 comments · Fixed by #257
Closed

Ask to terraform init an uninitialized workspace #106

paultyng opened this issue May 21, 2020 · 6 comments · Fixed by #257
Labels

Comments

@paultyng
Copy link
Contributor

https://microsoft.github.io/language-server-protocol/specification#window_showMessageRequest

The show message request is sent from a server to a client to ask the client to display a particular message in the user interface. In addition to the show message notification the request allows to pass actions and to wait for an answer from the client.

Not entirely sure about the UX on this, but may be worth exploring.

@paultyng
Copy link
Contributor Author

We should probably ask to initialize entirely uninitialized workspaces or when we get that error from the Terraform binary. But we may be able to be a bit proactive about it, when there are providers in source that are not initialized or maybe the local mirror directories change, etc.

@radeksimko
Copy link
Member

I think this might require some help from the language server in relation to #32 because the server will likely be the one that knows better/best where it's suitable to terraform init a particular directory.

@BertelBB
Copy link

Is it possible to disable the initialization?
It is breaking the hashicorp.terraform extension for me because I am opening a workspace in VSCode with multiple Terraform projects and the extension is trying to perform the initialization in the root directory of the workspace, which is not a Terraform project.

@radeksimko
Copy link
Member

The error will not be reported as per #171 from the next release (0.4.0; to be released in coming days). The schema is still necessary for most functionality (pretty much all except formatting), but we need to better understand where in the hierarchy could a folder be potentially initd, so we can hint this to the user - as opposed to just expect it in any directory that is being opened - that's what this issue is mainly about.

Supporting monorepo and other more complex hierarchies is something we plan to support as part of #32

@radeksimko
Copy link
Member

radeksimko commented Jun 22, 2020

As for the implementation details of this one, I realized that the JSON RPC library we use doesn't seem to support server->client requests. It can only send notifications (without waiting for response), such as window/showMessage via jrpc2.ServerPush().

(I tried sending showMessage to the client, which displayed the message in the UI, but showMessageRequest did nothing)

@ghost
Copy link

ghost commented Dec 20, 2020

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 context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants