Code Monkey home page Code Monkey logo

Comments (7)

fwy avatar fwy commented on June 17, 2024 6

I had the same JSON-related error when first trying this language server with neovim on Windows, and after a little debugging found that setting the init_options.storagePath property to a valid directory fixed it.

init_options = {
    storagePath = util.path.join(vim.env.XDG_DATA_HOME, "nvim-data"),
},

'util' is require('lspconfig/util'), and the environment variable plus the 'nvim-data' segment references a location on my machine. After starting the language server in neovim, I can see that the file kls_database.db is created there and the fatal error is gone.

Using the default init_options by omitting this property from my lua configuration did not help.

from kotlin-language-server.

xsh005 avatar xsh005 commented on June 17, 2024 3

@SrDum using the default config for init_options solves this for me, previously I was using init_options = {}

edit: linux machine + neovim 10 nightly

from kotlin-language-server.

fwcd avatar fwcd commented on June 17, 2024

The SLF4J warning is fine (maybe not fine, but expected 😄).

A delegate object is null, jsonrpc methods of 'public default org.eclipse.lsp4j.services.NotebookDocumentService org.eclipse.lsp4j.services.LanguageServer.getNotebookDocumentService()' are ignored

This is interesting. We don't provide this method, but the client shouldn't call it either since we don't advertise it in the server capabilities.

Internal error: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $

The JSON error confuses me. I'd wager a guess and say that it's generally some misconfiguration on the client-side.

from kotlin-language-server.

SrDum avatar SrDum commented on June 17, 2024

The SLF4J warning is fine (maybe not fine, but expected 😄).

A delegate object is null, jsonrpc methods of 'public default org.eclipse.lsp4j.services.NotebookDocumentService org.eclipse.lsp4j.services.LanguageServer.getNotebookDocumentService()' are ignored

This is interesting. We don't provide this method, but the client shouldn't call it either since we don't advertise it in the server capabilities.

Internal error: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at path $

The JSON error confuses me. I'd wager a guess and say that it's generally some misconfiguration on the client-side.

I don't doubt it. How would I go about troubleshooting this?

from kotlin-language-server.

fwcd avatar fwcd commented on June 17, 2024

Consult with the docs/maintainers of the language client you're using or try another client and see if the issues persist.

from kotlin-language-server.

SrDum avatar SrDum commented on June 17, 2024

Consult with the docs/maintainers of the language client you're using or try another client and see if the issues persist.

Alright, thank you.

from kotlin-language-server.

RimuhRimu avatar RimuhRimu commented on June 17, 2024

I'm getting some sort of JSON error too on a fresh install, I haven't been able to find out what's going on:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp.lua:1308: RPC[Error] code_name = InternalError, message = "Internal error." data = "java.util.concurrent.CompletionException: java.lang.ExceptionInInitializerError\n\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)\n\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base/java.lang.Thread.run(Unknown Source)\nCaused by: java.lang.ExceptionInInitializerError\n\tat org.javacs.kt.classpath.BackupClassPathResolverKt.findLocalArtifactDirUsingMaven(BackupClassPathResolver.kt:88)\n\tat org.javacs.kt.classpath.BackupClassPathResolverKt.findLocalArtifact(BackupClassPathResolver.kt:25)\n\tat org.javacs.kt.classpath.BackupClassPathResolverKt.findKotlinStdlib(BackupClassPathResolver.kt:21)\n\tat org.javacs.kt.classpath.WithStdlibResolverKt.wrapWithStdlib(WithStdlibResolver.kt:42)\n\tat org.javacs.kt.classpath.WithStdlibResolverKt.wrapWithStdlibEntries(WithStdlibResolver.kt:17)\n\tat org.javacs.kt.classpath.WithStdlibResolverKt.access$wrapWithStdlibEntries(WithStdlibResolver.kt:1)\n\tat org.javacs.kt.classpath.WithStdlibResolver.getClasspathOrEmpty(WithStdlibResolver.kt:9)\n\tat org.javacs.kt.classpath.FirstNonEmptyClassPathResolver.getClasspathOrEmpty(ClassPathResolver.kt:75)\n\tat org.javacs.kt.CompilerClassPath.refresh(CompilerClassPath.kt:57)\n\tat org.javacs.kt.CompilerClassPath.refresh$default(CompilerClassPath.kt:47)\n\tat org.javacs.kt.CompilerClassPath.addWorkspaceRoot(CompilerClassPath.kt:120)\n\tat org.javacs.kt.KotlinLanguageServer$initialize$1.invoke(KotlinLanguageServer.kt:129)\n\tat org.javacs.kt.KotlinLanguageServer$initialize$1.invoke(KotlinLanguageServer.kt:74)\n\tat org.javacs.kt.util.AsyncExecutor.compute$lambda$2(AsyncExecutor.kt:19)\n\t... 4 more\nCaused by: org.javacs.kt.util.KotlinLSException: No repositories found at $MAVEN_REPOSITORY, $MAVEN_HOME, $M2_HOME or $HOME/.m2\n\tat org.javacs.kt.classpath.HomeKt.<clinit>(Home.kt:22)\n\t... 18 more\n"
stack traceback:
	[C]: in function 'assert'
	/usr/share/nvim/runtime/lua/vim/lsp.lua:1308: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

from kotlin-language-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.