Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Plugin breaks when goto definition is used with a source file from jar #5

Open
tgodzik opened this issue Oct 21, 2019 · 3 comments
Open

Comments

@tgodzik
Copy link
Contributor

tgodzik commented Oct 21, 2019

I was playing around with the Metals Eclipse plugin nad it seems that some new version broke goto definition. After doing go to definition on an outside symbol it goes to .metals/readonly and the server stops responding altogether. The only messages we get it seem is something about broken Json RPC messages:

SEVERE: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
	at com.google.gson.Gson.fromJson(Gson.java:900)
	at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:119)
	at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:114)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:92)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:55)
	at com.google.gson.Gson.fromJson(Gson.java:888)
	... 10 more

Oct 21, 2019 9:59:42 PM org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer fireError
{"jtent-Length: 725der Content-Length in input "

"
{"jtent-Length: 725ateException: Missing header Content-Length in input "

"
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:91)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@mundacho Any idea what might be going on and where we can look?

I was planning on showing a bit of Eclipse integration during EclipseCon.

@mundacho
Copy link
Contributor

mundacho commented Oct 22, 2019

Hello, I'm traveling right now. However the problem there seems to be with lps4e or LSP4j, when I'm back (next week) I'll check in the LSP4e-dev mailing lists to see if I can get some hints. If you can. I think Mickael Istria from the LSP4e mailing list might be able to throw some light on the issue at least.

@mundacho
Copy link
Contributor

Hello, I'm back. Do you have some project where I can reproduce this problem?

@tgodzik
Copy link
Contributor Author

tgodzik commented Oct 30, 2019

This was on a very simple project like: https://github.com/tgodzik/metals-sample
Walked around the code for a while and clicked goto definition on outside symbols Some/Int etc.
Might be a flake, haven't managed to get to the bottom of that. Looks like some kind of encoding issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants