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

[Bug] Cannot read property 'capabilities' of null when running GHDL-LS LSP Server #2859

Closed
pidgeon777 opened this issue Jan 31, 2021 · 2 comments

Comments

@pidgeon777
Copy link

Result from CocInfo

## versions

vim version: NVIM v0.4.4
node version: v14.15.4
coc.nvim version: 0.0.80-50544406f0
coc.nvim directory: C:\Neovim\config\nvim\plugged\coc.nvim
term: undefined
platform: win32

## Log of coc.nvim

2021-01-31T15:54:27.641 INFO (pid:24080) [services] - registered service "languageserver.ghdlLS"
2021-01-31T15:54:27.883 INFO (pid:24080) [plugin] - coc.nvim 0.0.80-50544406f0 initialized with node: v14.15.4 after 308ms
2021-01-31T15:54:30.772 INFO (pid:24080) [attach] - receive notification: showInfo []

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

  • Create file mini.vim with:
" -----------------------------
" Paths
" -----------------------------

let s:ghdl_p      = 'C:\GHDL\bin'
let s:ghdl_ls_p   = 'C:\Users\pcuser\.local\bin'

if (has('win32') || has('win64'))
 if !executable('ghdl')
   if (isdirectory(s:ghdl_p))
     let $PATH .= ';' . s:ghdl_p
   endif
 endif

 if !executable('ghdl-ls')
   if (isdirectory(s:ghdl_ls_p))
     let $PATH .= ';' . s:ghdl_ls_p
   endif
 endif

endif

" -----------------------------

set nocompatible
set runtimepath^=C:\Neovim\config\nvim\plugged\coc.nvim
filetype plugin indent on
syntax on
set hidden
  • Start (neo)vim with command: vim -u mini.vim

  • Operate vim.

My coc-settings.json:

{
	"suggest.autoTrigger": "always",

	"diagnostic.messageDelay": 0,

	"suggest.triggerCompletionWait" : 30,
	"signature.triggerSignatureWait": 200,

	"languageserver": {
		"ghdlLS": {
			"enable": true,
			"trace.server": "verbose",
			"command": "ghdl-ls",
			"filetypes": [
				"vhdl"
			],
                        "trace.server": "verbose"
		}
	},

	"snippets.userSnippetsDirectory": "$VIMCONFIG/UltiSnips"
}

LSP server config file hdl-prj.json:

{
    "options": {
        "ghdl_analysis": [
            "--workdir=work",
            "--ieee=synopsys",
            "-fexplicit"
        ]
    },
    "files": [
        { "file": "C:/VHDL/entity.vhd", "language": "vhdl" }
    ]
}

hdl-prj.json path:

C:\Test\hdl-prj.json

set pwd? result in Neovim:

C:\Test

ghdl-ls manual execution test in Neovim:

:!ghdl-ls --version
ghdl-ls 1.0-dev

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:

[coc.nvim] Caught exception while handling initialize, see VHDL language server output for details.
[coc.nvim] Cannot read property 'capabilities' of null
[coc.nvim] Server languageserver.ghdlLS failed to start: TypeError: Cannot read property 'capabilities' of null

CocCommand workspace.showOutput shows an empty buffer.

@pidgeon777
Copy link
Author

Also discussed in main ghdl-ls repository:

ghdl/ghdl-language-server#73

@pidgeon777
Copy link
Author

I have been able to solve my issue, please refer to the aforementioned link.

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

1 participant