-
-
Notifications
You must be signed in to change notification settings - Fork 902
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
terraform: lsp server can't find files #3713
Comments
cc @psibi |
Thanks for the detailed bug report @arcsteveio. Note that this is kind of a expected behavior and happens with Visual studio code too: The only difference is that visual studio doesn't show the errors whereas I will have to create a similar workaround like this to fix it later this week: #3111 |
Thank you @psibi. As you said I hadn't noticed this in Visual Studio Code. I appreciate all the work you've done so far! |
I don't think this is actually an expected behaviour. I've been getting the same error this morning on my Linux machine but not in VSCode (telling both to use the same binary). Tested it with Eglot as well (since I don't have it configured I had to provide the
I can sometimes get it to connect successfully after multiple disconnects/reconnects but I haven't figured out any way to get it to do so reliably enough to be usable. |
@jleechpe How are you testing it in VSCode ? I can confirm that I can reproduce in both lsp-mode as well as VS Code. |
Freshly installed visual-studio-code-bin on arch, added the terraform extension and tested... although now that I'm retesting it is refusing to work, which means I likely got one of those lucky circumstances (that I found once or twice in emacs as well) I don't get any completion (other than generic text completions) in VSCode ( Updated the upstream bug report to say so. |
@jleechpe Thanks for the upstream bug report. |
I'm also seeing this issue. When editing any Terraform file I'll get
errors constantly and it seems to be causing completion to break as well. |
@ashlineldridge If you check hashicorp/terraform-ls#1067 it looks like it's a problem with terraform-ls and symbolic links. As a workaround you can disable lock files in Emacs. Otherwise we'll need to wait for them to address the problem. It doesn't look like it's a problem with lsp-mode. |
Thank you, @arcsteveio 🙇🏼 |
@arcsteveio Can you confirm if this issue is still reproducible with terraform-ls 0.30.2 ? I have been using it for a couple of days and I haven't faced it yet. |
@psibi I tried out terraform-ls 0.30.2 and I can't reproduce the issue. I edit the terraform file and things still work. I think this is fixed. |
@arcsteveio Thanks for the confirmation. @jleechpe I will close this issue if you can confirm it too ? |
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
After starting to edit a Terraform file the LSP server starts sending errors like
rpc_logger.go:45: Error for "textDocument/documentLink" (ID 19): [-32098] main.tf: file not found
.The LSP server starts fine initially it's only after making changes to the file that the errors start. After the errors start the server doesn't seem to be able to find the file again and the LSP features stop working.
I have a feeling this is my configuration error but I'm a bit out of my depth here.
This is on Emacs 28.1 and lsp-mode-20220907.1223.
Steps to reproduce
I have lsp-mode setup with use-package as follows:
Expected behavior
The expected behavior is that the LSP server finds the file and provides LSP features.
Which Language Server did you use?
terraform-ls from Homebrew.
OS
MacOS
Error callstack
Anything else?
No response
The text was updated successfully, but these errors were encountered: