-
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
Cannot start language server: Message: URI "" is not valid #158
Comments
same problem here. |
Hi folks, Am I right that when you triggered the command "Enable Terraform Language Server" from the command palette, that there was no We may need to look into the separation of enabling (in terms of toggling state in the config) and actually starting the server. I think it should only ever start when there is a relevant folder/file opened. |
Hello, |
|
I'm going to transfer this over to the VSCode repository, as I think the best course of action here would be preventing the VSCode extension from ever sending empty URI as part of initialization. There isn't much the server can do without a valid URI unless it would scan the whole filesystem - but even then it's unclear why would it be initialized when there is nothing for it to do at the time. |
I had a tf file open at the time. The problem has since stopped for me. I now can't get the code complete to work for tf files |
Actually I take what I said above back after re-reading some relevant codepaths. The client would regularly send empty URI when a single file is opened (as opposed to a directory), which is something we don't support yet, but hopefully will. That error message is however confusing, we should be returning entirely different one, so that may need fixing, before we implement single file support. |
For context the single file support is tracked under #32 but I will keep this issue open until we fix the confusing messaging around this. |
I opened VS, created new file, saved it as .tf then tried to start the LS. @radeksimko - you're saying it will work if I open a folder instead of a single file? EDIT: yes, using VS code's "open folder..." instead of "open file..." works. Also fails if you open with no workspace and use "new file..." |
@oising Generally only the simplest scenario currently works, which can be described as
#32 lists a number of scenarios which don't work yet (but will eventually, when we implement it). Vast majority of the ones we don't support yet is surfaced as "Workspace not initialized". That message can be misleading in many valid scenarios, but that is the current state of things. |
why was this case closed ? has this problem resolved ? |
I was able to resolve the same issue on my end by ensuring that my $PATH environment variable in my ~/.bash_profile file was fully-qualified (i.e. no ~ in the URI), that I opened the top-level folder container all the Terraform code within the repository in VSCode, and ensuring I had previously run |
Editing single files will be reported correctly from the next release (probably 0.4.0; to be released in coming days) as "Editing a single file is not yet supported. Please open a directory.". That is why this was closed as part of #172 (which the closing event mentions). Supporting single files as something yet to be solved as part of #32 |
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. |
Server Version
Terraform Version
Client Version
Terraform Configuration Files
Log Output
Expected Behavior
Language server should start.
Actual Behavior
Language server fails to start.
Steps to Reproduce
f1, "enable terraform language serve"
The text was updated successfully, but these errors were encountered: