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

dap-debub templates fails with error Expected BEGIN_ARRAY but w as BEGIN_OBJECT at path $.environmentVariables #63

Open
Jeronimo-GL opened this issue Dec 6, 2021 · 0 comments

Comments

@Jeronimo-GL
Copy link

On a scala project, if you have modules in the SBT, when you do a dap-debug it fail with the following error in emacs:

lsp-workspace-command-execute: ‘workspace/executeCommand’ with ‘debug-adapter-start’ failed.

(error "The connected server(s) does not support method workspace/executeCommand.

If I look into .metals/metals.log I find this error

dic. 06, 2021 1:22:28 P. M. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
GRAVE: Internal error: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but w
as BEGIN_OBJECT at path $.environmentVariables
java.util.concurrent.CompletionException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expecte
d BEGIN_ARRAY but was BEGIN_OBJECT at path $.environmentVariables
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
        at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.apply(FutureConvertersImpl.scala:29)
        at scala.concurrent.java8.FuturesConvertersImpl$CF.apply(FutureConvertersImpl.scala:26)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
        at scala.concurrent.BatchingExecutor$Batch.processBatch$1(BatchingExecutor.scala:67)
        at scala.concurrent.BatchingExecutor$Batch.$anonfun$run$1(BatchingExecutor.scala:82)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
        at scala.concurrent.BatchingExecutor$Batch.run(BatchingExecutor.scala:59)
        at scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:875)
        at scala.concurrent.BatchingExecutor.execute(BatchingExecutor.scala:110)
        at scala.concurrent.BatchingExecutor.execute$(BatchingExecutor.scala:107)
        at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:873)
        at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:72)
        at scala.concurrent.impl.Promise$KeptPromise$Kept.onComplete(Promise.scala:372)
        at scala.concurrent.impl.Promise$KeptPromise$Kept.onComplete$(Promise.scala:371)
        at scala.concurrent.impl.Promise$KeptPromise$Failed.onComplete(Promise.scala:387)
        at scala.concurrent.Promise.tryCompleteWith(Promise.scala:75)
        at scala.concurrent.Promise.tryCompleteWith$(Promise.scala:73)
        at scala.concurrent.impl.Promise$DefaultPromise.tryCompleteWith(Promise.scala:187)
        at scala.concurrent.Promise.completeWith(Promise.scala:67)
        at scala.concurrent.Promise.completeWith$(Promise.scala:67)
        at scala.concurrent.impl.Promise$DefaultPromise.completeWith(Promise.scala:187)
        at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:44)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJ
ECT at path $.environmentVariables
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:22
6)
        at com.google.gson.Gson.fromJson(Gson.java:963)
        at com.google.gson.Gson.fromJson(Gson.java:1034)
        at com.google.gson.Gson.fromJson(Gson.java:1006)
        at scala.meta.internal.metals.JsonParser$XtensionSerializedAsJson.$anonfun$as$1(JsonParser.scala:33)
        at scala.util.Try$.apply(Try.scala:213)
        at scala.meta.internal.metals.JsonParser$XtensionSerializedAsJson.as(JsonParser.scala:33)
        at scala.meta.internal.metals.debug.DebugProvider.parseSessionName(DebugProvider.scala:504)
        at scala.meta.internal.metals.debug.DebugProvider.start(DebugProvider.scala:88)
        at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$executeCommand$14(MetalsLanguageServer.scala:1742)
        at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
        at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
        ... 4 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at path $.environmentVariables
        at com.google.gson.internal.bind.JsonTreeReader.expect(JsonTreeReader.java:163)
        at com.google.gson.internal.bind.JsonTreeReader.beginArray(JsonTreeReader.java:72)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80
)
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61
)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:22
2)
        ... 15 more

I have tried both launch.json templates and elisp templates. I have tried templates with and without the environment variables section.

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

No branches or pull requests

1 participant