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

Server Crash when asking for completion at the beginning of a line. #63

Closed
slrtbtfs opened this issue Nov 13, 2019 · 1 comment
Closed
Labels
bug Something isn't working crash (potential) crash of the language server

Comments

@slrtbtfs
Copy link
Member

Found by @metalmatze

Stacktace:

[Error - 3:09:45 PM] Request textDocument/completion failed.
extension.js:57
  Message: method "textDocument/completion" did not reply
  Code: -32603 
extension.js:57
panic: illegal line number

goroutine 10 [running]:

extension.js:49
go/token.(*File).LineStart(0xc00011a0c0, 0x2, 0x0)
	/usr/lib/golang/src/go/token/position.go:222 +0xf6
github.com/slrtbtfs/promql-lsp/langserver/cache.(*Document).ProtocolPositionToTokenPos(0xc000239c70, 0xa61100, 0xc00021c580, 0x3ff0000000000000, 0x0, 0x0, 0x0, 0x0)
	/home/slrtbtfs/git/github.com/slrtbtfs/promql-lsp/langserver/cache/position.go:89 +0x105
github.com/slrtbtfs/promql-lsp/langserver.(*Server).Completion(0xc000170a80, 0xa61100, 0xc000038c00, 0xc00021c5c0, 0xc00021c5c0, 0x0, 0x0)
	/home/slrtbtfs/git/github.com/slrtbtfs/promql-lsp/langserver/completion.go:40 +0x11a
github.com/slrtbtfs/promql-lsp/vendored/go-tools/lsp/protocol.serverHandler.Deliver(0xa704c0, 0xc000170a80, 0xa61100, 0xc000038c00, 0xc000038c40, 0x0, 0x1)
	/home/slrtbtfs/git/github.com/slrtbtfs/promql-lsp/vendored/go-tools/lsp/protocol/tsserver.go:310 +0x222a
github.com/slrtbtfs/promql-lsp/vendored/go-tools/jsonrpc2.(*Conn).Run.func1(0xc00002e300, 0xc000038c40, 0xc0001c06c0, 0xa61100, 0xc000038c00, 0x0, 0x0, 0xc000071280)
	/home/slrtbtfs/git/github.com/slrtbtfs/promql-lsp/vendored/go-tools/jsonrpc2/jsonrpc2.go:370 +0x170
created by github.com/slrtbtfs/promql-lsp/vendored/go-tools/jsonrpc2.(*Conn).Run
	/home/slrtbtfs/git/github.com/slrtbtfs/promql-lsp/vendored/go-tools/jsonrpc2/jsonrpc2.go:354 +0x877

extension.js:49
[Error - 3:09:45 PM] Connection to server got closed. Server will not be restarted.

This is a special case of the problem described in #22.

@slrtbtfs slrtbtfs changed the title Server Crash when asking for completion at the beginning start of a line. Server Crash when asking for completion at the beginning of a line. Nov 13, 2019
@slrtbtfs slrtbtfs added bug Something isn't working crash (potential) crash of the language server labels Nov 13, 2019
@slrtbtfs
Copy link
Member Author

The crash only happens if it is the last line in the file.

slrtbtfs added a commit that referenced this issue Nov 13, 2019
Signed-off-by: Tobias Guggenmos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash (potential) crash of the language server
Projects
None yet
Development

No branches or pull requests

1 participant