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

JsonSyntaxException on startup #546

Open
SrDum opened this issue Jan 15, 2024 · 6 comments
Open

JsonSyntaxException on startup #546

SrDum opened this issue Jan 15, 2024 · 6 comments
Labels
bug Something isn't working editor support Support for any non-VSCode editors/language clients

Comments

@SrDum
Copy link

SrDum commented Jan 15, 2024

Full log follows: lsp.log

This is happening after a clean build (and trying to use it with nvim, using lspconfig). Worth noting that just running the server outside of nvim (while not spamming me with erros like nvim did), still gives teh first warning that seems to be the root cause, that being the line
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
Now, full disclosure, It's completely possible this is somehow an error on my part while building, but I have already retried multiple times following the readme.md to the letter.

Thanks in advance for any assistence.

@fwcd fwcd added bug Something isn't working editor support Support for any non-VSCode editors/language clients labels Jan 15, 2024
@fwcd
Copy link
Owner

fwcd commented Jan 15, 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.

@SrDum
Copy link
Author

SrDum commented Jan 15, 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?

@fwcd
Copy link
Owner

fwcd commented Jan 15, 2024

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

@SrDum
Copy link
Author

SrDum commented Jan 15, 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.

@xsh005
Copy link

xsh005 commented Jan 25, 2024

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

edit: linux machine + neovim 10 nightly

@fwy
Copy link

fwy commented Jan 31, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor support Support for any non-VSCode editors/language clients
Projects
None yet
Development

No branches or pull requests

4 participants