ghdl / ghdl-language-server

Language server based on ghdl
MIT License
90 stars 8 forks source link

TypeError: textDocument_didChange() #14

Closed befedo closed 5 years ago

befedo commented 5 years ago

Hi there,

At first: Thanks for the effort your putting in this project, a language server for VHDL is really impressive!

I'm using CoC as a solution to hook language servers into my editor. In the CoC configuration they where defined like below:

  "languageserver": {
    "vhdl": {
      "command": "ghdl-ls",
      "filetypes": ["vhdl"],
      "trace.server": "verbose",
      "rootPatterns": ["hdl-prj.json"],
    }
  }

Everithing works as expected (goto definition, linting, ... havn't tested much more) but when I save a buffer in the editor textDocument_didChange() receives an unexpected keyword:

2019-08-02 15:17:10,500 [ERROR] Uncaught error
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.7/site-packages/vhdl_langserver/main.py", line 116, in main
    server.run()
  File "/home/user/.local/lib/python3.7/site-packages/vhdl_langserver/lsp.py", line 98, in run
    reply = self.handle(msg)
  File "/home/user/.local/lib/python3.7/site-packages/vhdl_langserver/lsp.py", line 116, in handle
    response = fmethod(**params)
TypeError: textDocument_didChange() got an unexpected keyword argument 'bufnr'
[Error  - 3:17:10 PM] /home/user/.local/bin/ghdl-ls exited with code: 1
[Error  - 3:17:10 PM] Connection to server got closed. Server will not be restarted.

I don't know if this should/can be resolved or if it's from the CoC implementation.

I've also noticed there's a VSCode Client and CoC extensions could be derived from VSCode extensions. But I'm not such an expert in writing extensions in Java Script, thus I kepp my hand off that part.

Thanks for your effort and time!

tgingold commented 5 years ago

As far as I know, bufnr is not an argument specified by the LSP. It should simply be ignored.

befedo commented 5 years ago

@tgingold Thanks for the quick fix.

tgingold commented 5 years ago

I'd guess you might similar errors for other methods.