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

neovim - invalid_server_message every character input. #188

Closed
A-Lamia opened this issue May 5, 2023 · 9 comments
Closed

neovim - invalid_server_message every character input. #188

A-Lamia opened this issue May 5, 2023 · 9 comments

Comments

@A-Lamia
Copy link

A-Lamia commented May 5, 2023

Wanted to play around with Odin over the weekend so set everything up on neovim nightly / windows 10, I get an error every character input from the LSP about an INVALID_SERVER_MESSAGE not sure if anyone else has come across this issues on other LSP clients other then nvim-lsp, sort of annoying because the error message is blocking and there is no way to suppress it.

Could be that other LSP clients are handling the error if that's the case im not really sure where to actually bring up this problem.

Picture of the error:
image

EDIT: Just for a side note other then this issue the LSP is running and working to the little amount i can test it.

@DanielGavin
Copy link
Owner

That is the return message for methods ols do not support/disabled. What message is the client sending that is giving that response by ols? I use nvim lsp without issue.

You can disable some features in ols.json and that might be the features nvim expects.

@A-Lamia
Copy link
Author

A-Lamia commented May 6, 2023

Not using any settings everything is default.

basically it's an empty project with a single hellope.odin using mason and nvim-lspconfig.

@DanielGavin
Copy link
Owner

I can't reproduce it. You need to give me the log of the lsp client on debug level.

@A-Lamia
Copy link
Author

A-Lamia commented May 6, 2023

Here is a log bellow.

[INFO][2023-05-07 01:46:39] .../vim/lsp/rpc.lua:662	"Starting RPC client"	{  args = {},  cmd = "C:\\Users\\Lamia\\AppData\\Local\\nvim-data\\mason\\packages\\ols/ols-x86_64-pc-windows-msvc.exe",  extra = {    cwd = "X:/Projects/Odin/test"  }}
[DEBUG][2023-05-07 01:46:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      textDocument = {        callHierarchy = {          dynamicRegistration = false        },        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          isPreferredSupport = true,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = true,            deprecatedSupport = true,            documentationFormat = { "markdown", "plaintext" },            insertReplaceSupport = true,            labelDetailsSupport = true,            preselectSupport = true,            resolveSupport = {              properties = { "documentation", "detail", "additionalTextEdits" }            },            snippetSupport = true,            tagSupport = {              valueSet = { 1 }            }          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        foldingRange = {          dynamicRegistration = false,          lineFoldingOnly = true        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        semanticTokens = {          augmentsSyntaxTokens = true,          dynamicRegistration = false,          formats = { "relative" },          multilineTokenSupport = false,          overlappingTokenSupport = true,          requests = {            full = {              delta = true            },            range = false          },          serverCancelSupport = false,          tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" },          tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = true,          willSaveWaitUntil = true        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = true        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        didChangeWatchedFiles = {          dynamicRegistration = true,          relativePatternSupport = true        },        semanticTokens = {          refreshSupport = true        },        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.10.0"    },    initializationOptions = vim.empty_dict(),    processId = 21972,    rootPath = "X:\\Projects\\Odin\\test",    rootUri = "file:///X:/Projects/Odin/test",    trace = "off",    workspaceFolders = { {        name = "X:/Projects/Odin/test",        uri = "file:///X:/Projects/Odin/test"      } }  }}
[DEBUG][2023-05-07 01:46:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  id = 1,  jsonrpc = "2.0",  result = {    capabilities = {      completionProvider = {        completionItem = {          labelDetailsSupport = true        },        resolveProvider = false,        triggerCharacters = { ".", ">", "#", '"', "/", ":" }      },      definitionProvider = true,      documentFormattingProvider = true,      documentLinkProvider = {        resolveProvider = false      },      documentSymbolProvider = true,      hoverProvider = true,      inlayHintProvider = false,      referencesProvider = false,      renameProvider = false,      semanticTokensProvider = {        full = false,        legend = {          tokenModifiers = { "none", "declaration", "definition", "deprecated", "readonly" },          tokenTypes = { "namespace", "type", "enum", "struct", "parameter", "variable", "enumMember", "function", "member", "keyword", "modifier", "comment", "string", "number", "operator", "property", "method" }        },        range = false      },      signatureHelpProvider = {        retriggerCharacters = { "," },        triggerCharacters = { "(", "," }      },      textDocumentSync = {        change = 2,        openClose = true,        save = {          includeText = true        }      }    }  }}
[DEBUG][2023-05-07 01:46:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "initialized",  params = vim.empty_dict()}
[INFO][2023-05-07 01:46:39] .../lua/vim/lsp.lua:1345	"LSP[ols]"	"server_capabilities"	{  server_capabilities = {    completionProvider = {      completionItem = {        labelDetailsSupport = true      },      resolveProvider = false,      triggerCharacters = { ".", ">", "#", '"', "/", ":" }    },    definitionProvider = true,    documentFormattingProvider = true,    documentLinkProvider = {      resolveProvider = false    },    documentSymbolProvider = true,    hoverProvider = true,    inlayHintProvider = false,    referencesProvider = false,    renameProvider = false,    semanticTokensProvider = {      full = false,      legend = {        tokenModifiers = { "none", "declaration", "definition", "deprecated", "readonly" },        tokenTypes = { "namespace", "type", "enum", "struct", "parameter", "variable", "enumMember", "function", "member", "keyword", "modifier", "comment", "string", "number", "operator", "property", "method" }      },      range = false    },    signatureHelpProvider = {      retriggerCharacters = { "," },      triggerCharacters = { "(", "," }    },    textDocumentSync = {      change = 2,      openClose = true,      save = {        includeText = true      }    }  }}
[DEBUG][2023-05-07 01:46:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didOpen",  params = {    textDocument = {      languageId = "odin",      text = 'package main \r\n\r\nimport "core:fmt"\r\n\r\nmain :: proc() {\r\n    fmt.println("hellope!")\r\n}\r\n',      uri = "file:///X:/Projects/Odin/test/hellope.odin",      version = 0    }  }}
[DEBUG][2023-05-07 01:46:39] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "window/progress",  params = {}}
[DEBUG][2023-05-07 01:46:39] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  error = {    code = -32601,    message = ""  },  jsonrpc = "2.0"}
[ERROR][2023-05-07 01:46:39] .../lua/vim/lsp.lua:1086	"LSP[ols]"	"on_error"	{  code = "INVALID_SERVER_MESSAGE",  err = {    error = {      code = -32601,      message = ""    },    jsonrpc = "2.0"  }}
[DEBUG][2023-05-07 01:46:42] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        range = {          ["end"] = {            character = 1,            line = 6          },          start = {            character = 1,            line = 6          }        },        rangeLength = 0,        text = " "      } },    textDocument = {      uri = "file:///X:/Projects/Odin/test/hellope.odin",      version = 5    }  }}
[DEBUG][2023-05-07 01:46:42] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "window/progress",  params = {}}
[DEBUG][2023-05-07 01:46:42] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  error = {    code = -32601,    message = ""  },  jsonrpc = "2.0"}
[ERROR][2023-05-07 01:46:42] .../lua/vim/lsp.lua:1086	"LSP[ols]"	"on_error"	{  code = "INVALID_SERVER_MESSAGE",  err = {    error = {      code = -32601,      message = ""    },    jsonrpc = "2.0"  }}
[DEBUG][2023-05-07 01:46:45] .../vim/lsp/rpc.lua:284	"rpc.send"	{  jsonrpc = "2.0",  method = "window/progress",  params = {}}
[DEBUG][2023-05-07 01:46:45] .../vim/lsp/rpc.lua:387	"rpc.receive"	{  error = {    code = -32601,    message = ""  },  jsonrpc = "2.0"}

@DanielGavin
Copy link
Owner

Not sure why nvim is sending method window/progress, I'll try to stub it out, and see if that fixes it for you.

@A-Lamia
Copy link
Author

A-Lamia commented May 6, 2023

thanks 👌, looking forward to playing around with odin seems like a fun language.

@DanielGavin
Copy link
Owner

DanielGavin commented May 6, 2023

Pushed the change.

Yeah the language is nice and simple, which is the reason I like it. Also nice for graphics development, since they have all the APIs available.

@A-Lamia
Copy link
Author

A-Lamia commented May 6, 2023

perfect everything is good now, ill be closing this.

and yeah it's the reason why i want to learn it, feels super nice for just quickly building graphic tools, and unlike rust it feels a lot more simpler for building those tools.

@sigmaSd
Copy link

sigmaSd commented May 6, 2023

I opened an issue in neovim neovim/neovim#23511

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

3 participants