-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Bug] Cannot read property 'capabilities' of null when running GHDL-LS LSP Server #73
Comments
Here is the issue created on coc.nvim repository: |
It looks like that's 'capabilities' from the client that generates the error.
Can you log the whole exchange ? Just use: `export GHDL_LS_TRACE=ghdl-ls`
This will create two files.
|
Pardon me, where should I put that command? For example:
and where should I expect the files to be generated? |
It's a shell command, so set the variable before invoking nvim.
The files are created in the current directory.
|
If you are using windows, you can also add the option '--trace-file=ghdl-ls' when invoking the ghdl-ls server.
|
Sorry, I just noticed your post. I'll try right now. |
ghdl-ls.in: Content-Length: 3023
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":17560,"rootPath":"C:\\Test","rootUri":"file:///c%3A/Test","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":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]},"tagSupport":{"valueSet":[1]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":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]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"contextSupport":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"activeParameterSupport":true,"parameterInformation":{"labelOffsetSupport":true}}},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":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]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]}},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"declaration":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"selectionRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"initializationOptions":{},"trace":"verbose","workspaceFolders":[],"clientInfo":{"name":"coc.nvim","version":"0.0.80"},"workDoneToken":"b17acdbd-f76c-47b8-b4cb-559c9513315f"}}Content-Length: 58
{"jsonrpc":"2.0","id":1,"method":"shutdown","params":null} ghdl-ls.out: Content-Length: 168
{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":1,"message":"Caught exception while handling initialize, see VHDL language server output for details."}}Content-Length: 38
{"jsonrpc":"2.0","id":0,"result":null}Content-Length: 38
{"jsonrpc":"2.0","id":1,"result":null} |
I have the impression you didn't install the libraries.
You should first install ghdl before installing the LSP server.
If this is the case, the error message has to be improved.
|
I already built GHDL through MSYS2. Here is some info regarding the built executable: C:\GHDL\bin>ghdl --version
GHDL 1.0-dev (tarball) [Dunoon edition]
Compiled with GNAT Version: 10.2.0
mcode code generator
Written by Tristan Gingold.
Copyright (C) 2003 - 2021 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\GHDL\bin>ghdl --disp-config
command_name: C:\GHDL\bin\ghdl.exe
command line prefix (--PREFIX): (not set)
environment prefix (GHDL_PREFIX): (not set)
exec prefix (from program name): C:\GHDL
library prefix: C:\GHDL\lib/ghdl
library directory: C:\GHDL\lib/ghdl
default library paths:
C:\GHDL\lib/ghdl\ieee\v93\
C:\GHDL\lib/ghdl\ I'm happy to provide all of the necessary info and conducts tests to solve this issue. I would really like to try the GHDL LSP Server on Neovim. |
The ghdl executable looks correctly built and installed.
But that's not the case for ghdl-ls.exe. It returns a weird prefix: /c/GHDL\lib\ghdl
|
So I suppose you configured ghdl using `--prefix=/c/GHDL`
You should try with a windows path: `--prefix=C:\\GHDL`
|
Ok, I tried some combinations and this worked:
I think the documentation should be updated too, where the
The great news is that I'm finally able to run ghdl-ls in Neovim, on my Windows machine. Here is the new command line prefix (--PREFIX): (not set)
environment prefix (GHDL_PREFIX): (not set)
exec prefix (from program name): C:\msys64\mingw64
library prefix: C:/GHDL\lib/ghdl
library directory: C:/GHDL\lib/ghdl and ghdl-ls 1.0.0rc3 Apparently and interestingly, it has been updated from 1.0-dev to 1.0.0rc3 in the last few hours. I've already conducted some tests, should I open a new issue to discuss them? In the meanwhile, my most sincere thanks for your help. |
@pidgeon777, on MSYS2, it should work without manually building GHDL: pacman -S mingw-w64-ghdl-llvm mingw-w64-python-pip
pip install git+https://github.com/ghdl/ghdl.git@$(ghdl version hash) You can open any other terminal/tool from there ( That's how I use the VSCode extension. |
We're trying to run ghdl-ls on Neovim with coc.nvim, one of its LSP clients.
An error occurs when doing that, we're trying to understand if this is a bug coc.nvim side or ghdl-ls side.
Here is the necessary info:
Result from CocInfo
Describe the bug
I defined a LSP entry in the coc-settings.json file, this involve running the ghdl-ls executable when analyzing VHDL files.
When one of those VHDL files is opened, coc.nvim detect it and start the ghdl-ls LSP Server, but an error is generated, the following:
Cannot read property 'capabilities' of null
I'm using other VHDL LSP Servers with success, which are currently disabled, but this issue only occurs when using ghdl-ls.
Reproduce the bug
mini.vim
with:Start (neo)vim with command:
vim -u mini.vim
Operate vim.
My
coc-settings.json
:LSP server config file
hdl-prj.json
:hdl-prj.json
path:set pwd? result in Neovim:
ghdl-ls manual execution test in Neovim:
The Issue
It occurs when I load the file added to the LSP config project, or any file of the VHDL type.
Coc.nvim returns:
CocCommand workspace.showOutput
shows an empty buffer.The text was updated successfully, but these errors were encountered: