Skip to content

Kotlin Language Server Crashes on Neovim Due to JSON Parsing Error (Expected BEGIN_OBJECT but was BEGIN_ARRAY) #648

@aehabdelouadoud

Description

@aehabdelouadoud

I'm encountering a crash when using kotlin-language-server with Neovim. The error suggests a JsonSyntaxException, where the server expects a BEGIN_OBJECT but encounters a BEGIN_ARRAY.

Environment:

  • Neovim version:
    NVIM v0.10.4
    Build type: RelWithDebInfo
    LuaJIT 2.1.1736781742
    Run "nvim -V1 -v" for more info
  • Operating System: Arch Linux

Steps to Reproduce:

  1. Start Neovim with kotlin-language-server configured.
  2. Open a Kotlin file.
  3. The server crashes with the following error.

Error Log:

   Error  12:20:10 AM msg_show.lua_error Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/client.lua:588: RPC[Error] code_name = InternalError, message = "Internal error." data = "java.util.concurrent.CompletionException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $\n\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)\n\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:840)\nCaused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $\n\tat com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397)\n\tat com.google.gson.Gson.fromJson(Gson.java:1227)\n\tat com.google.gson.Gson.fromJson(Gson.java:1329)\n\tat com.google.gson.Gson.fromJson(Gson.java:1271)\n\tat org.javacs.kt.ConfigurationKt.getStoragePath(Configuration.kt:81)\n\tat org.javacs.kt.KotlinLanguageServer.initialize$lambda$6(KotlinLanguageServer.kt:97)\n\tat org.javacs.kt.util.AsyncExecutor.compute$lambda$2(AsyncExecutor.kt:19)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)\n\t... 3 more\nCaused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $\n\tat com.google.gson.internal.bind.JsonTreeReader.expect(JsonTreeReader.java:165)\n\tat com.google.gson.internal.bind.JsonTreeReader.beginObject(JsonTreeReader.java:89)\n\tat com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:386)\n\t... 10 more\n"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions