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

initial draft for inline value text support #702

Closed
wants to merge 3 commits into from

Conversation

bastiandoetsch
Copy link
Contributor

@bastiandoetsch bastiandoetsch commented Jun 21, 2023

  • supports getting inline values via textdocument/inlineValue
  • refreshes via workspace/inlineValue/refresh
  • registers the client capability
  • implements a code mining provider for inline values

@bastiandoetsch
Copy link
Contributor Author

bastiandoetsch commented Jun 21, 2023

Parsing of InlineValue[] array from LS fails right now. The array contains InlineValueText objects. I suspect a bug from LSP4j, as I can't find the error in the json received.

Input for parsing:

{"jsonrpc":"2.0","id":"2","result":[{"range":{"start":{"line":1,"character":0},"end":{"line":1,"character":2147483647}},"text":"IaC Test InlineValue"}]}

Exception:

Jun 21, 2023 12:53:34 PM org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer fireError
SEVERE: Ambiguous Either type: token BEGIN_OBJECT matches both alternatives.
com.google.gson.JsonParseException: Ambiguous Either type: token BEGIN_OBJECT matches both alternatives.
	at org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.create(EitherTypeAdapter.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.read(EitherTypeAdapter.java:177)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.read(EitherTypeAdapter.java:40)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapter.read(CollectionTypeAdapter.java:114)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapter.read(CollectionTypeAdapter.java:40)
	at com.google.gson.Gson.fromJson(Gson.java:1227)
	at com.google.gson.Gson.fromJson(Gson.java:1186)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.fromJson(MessageTypeAdapter.java:345)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.parseResult(MessageTypeAdapter.java:190)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:125)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:57)
	at com.google.gson.Gson.fromJson(Gson.java:1227)
	at com.google.gson.Gson.fromJson(Gson.java:1186)
	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.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

@bastiandoetsch
Copy link
Contributor Author

@angelozerr thought this may perhaps interest you.

@bastiandoetsch
Copy link
Contributor Author

Looks like the bug in LSP4j is gonna be fixed soon.

@mickaelistria
Copy link
Contributor

What's the status here?

@bastiandoetsch
Copy link
Contributor Author

I'm waiting for the next LSP4j release to be integrated into LSP4e, then I rebase against main and promote the PR from draft :)

@bastiandoetsch
Copy link
Contributor Author

See eclipse-lsp4j/lsp4j#753

@mickaelistria
Copy link
Contributor

OK, feel free to add to your PR a commit for LSP4E to use latest (2-days old IIRC) LSP4J release.

@jonahgraham
Copy link
Contributor

OK, feel free to add to your PR a commit for LSP4E to use latest (2-days old IIRC) LSP4J release.

That LSP4J release was a maintenance release and does not include the referenced fix.

@bastiandoetsch
Copy link
Contributor Author

Yeah, just checked. It's tagged with the 0.22.0 milestone.

@bastiandoetsch
Copy link
Contributor Author

Still waiting for LSP4j - I've asked when the 0.22.0 release is gonna happen.

@bastiandoetsch
Copy link
Contributor Author

Exciting times - as 0.22.0 was released last night, this can be picked up again.

@mickaelistria
Copy link
Contributor

@bastiandoetsch Cool, feel free to 1st submit a PR moving LSP4E to use LSP4J 0.22, so this can then be worked more efficiently.

@jonahgraham
Copy link
Contributor

@bastiandoetsch Cool, feel free to 1st submit a PR moving LSP4E to use LSP4J 0.22, so this can then be worked more efficiently.

@bastiandoetsch the move to LSP4J 0.22 has been done now by @akurtakov in #919

@bastiandoetsch
Copy link
Contributor Author

Looking into it once more now :)

@eclipsewebmaster eclipsewebmaster deleted the branch eclipse:master May 21, 2024 14:09
@mickaelistria
Copy link
Contributor

The initial target branch master was deleted and replaced by main, so this PR got closed automatically. If this is still relevant, please re-create this PR targetting the main branch.

@bastiandoetsch
Copy link
Contributor Author

Yeah, I'll reopen - I've just been a bit busy ;)

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

Successfully merging this pull request may close these issues.

None yet

4 participants