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

Noisy error on textDocument/hover ("position outside of [...] body") #1922

Open
1 task
krobelus opened this issue Jan 9, 2025 · 0 comments
Open
1 task
Labels
bug Something isn't working

Comments

@krobelus
Copy link

krobelus commented Jan 9, 2025

Language Server Version

0.36.3

Terraform Version

v1.10.2

Client Version

Kakoune

Terraform Configuration

terraform {
}

Steps to Reproduce

Reproduced in Kakoune (with kakoune-lsp) but should be reproducible in any editor

  1. open the above file, move the cursor the opening brace
  2. run textDocument/hover (:lsp-hover in Kakoune)

Expected Behavior

no error should be shown, the response should be {"jsonrpc":"2.0","id":213,"result":null}
since there is nothing interesting at the cursor position

Actual Behavior

observe that the error 'test.tf (1,11): position outside of "terraform" body' is prominently shown
terraform-ls returns {"jsonrpc":"2.0","id":8,"error":{"code":-32098,"message":"test.tf (1,11): position outside of \"terraform\" body"}}
which is rightfully shown as error because that's what it is.

Here's a slice of logs from the *debug* buffer:

LSP: DEBG To server terraform-ls: {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":10,"line":0},"textDocument":{"uri":"file:///home/johannes/git/kakoune-lsp/t/test.tf"}},"id":8}
LSP: INFO Language server stderr: 2025/01/09 09:51:20 opts.go:215: Received request batch of size 1 (qlen=0)
LSP: INFO Language server stderr: 2025/01/09 09:51:20 opts.go:215: Dequeued request batch of length 1 (qlen=0)
LSP: INFO Language server stderr: 2025/01/09 09:51:20 rpc_logger.go:32: Incoming request for "textDocument/hover" (ID 8): {"position":{"character":10,"line":0},"textDocument":{"uri":"file:///home/johannes/git/kakoune-lsp/t/test.tf"}}
LSP: INFO Language server stderr: 2025/01/09 09:51:20 hover.go:41: Looking for hover data at "test.tf" -> hcl.Pos{Line:1, Column:11, Byte:10}
LSP: INFO Language server stderr: 2025/01/09 09:51:20 hover.go:43: received hover data: (*lang.HoverData)(nil)
LSP: INFO Language server stderr: 2025/01/09 09:51:20 rpc_logger.go:48: Error for "textDocument/hover" (ID 8): [-32098] test.tf (1,11): position outside of "terraform" body
LSP: INFO Language server stderr: 2025/01/09 09:51:20 opts.go:215: Completed 1 requests [883.584µs elapsed]
LSP: DEBG From server terraform-ls: {"jsonrpc":"2.0","id":8,"error":{"code":-32098,"message":"test.tf (1,11): position outside of \"terraform\" body"}}
LSP: ERRO Error response from server terraform-ls: Failure { jsonrpc: Some(V2), error: Error { code: ServerError(-32098), message: "test.tf (1,11): position outside of \"terraform\" body", data: None }, id: Num(8) }
LSP: ERRO language server terraform-ls error: 'test.tf (1,11): position outside of "terraform" body'

Gist

No response

Workarounds

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@krobelus krobelus added the bug Something isn't working label Jan 9, 2025
@krobelus krobelus changed the title Noisy error on textDocuemnt/hover Noisy error on textDocument/hover ("position outside of [...] body") Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant