puppetlabs / puppet-editor-services

Puppet Language Server for editors
Apache License 2.0
46 stars 21 forks source link

Hover method should return null not, contents => null #300

Closed glennsarti closed 3 years ago

glennsarti commented 3 years ago

As per https://github.com/puppetlabs/puppet-vscode/issues/742

VSCode is seeing the following when the language server returns nothing from a hover:

Hover throws an error. Intellisense isn't working either.

[2021-04-13 14:47:12.689] [exthost] [error] TypeError: Cannot read property 'kind' of null
    at asHoverContent (/home/mhj/.vscode-server/extensions/puppet.puppet-vscode-1.2.0/node_modules/vscode-languageclient/lib/protocolConverter.js:101:27)
    at asHover (/home/mhj/.vscode-server/extensions/puppet.puppet-vscode-1.2.0/node_modules/vscode-languageclient/lib/protocolConverter.js:134:31)

And debug log from editor services

---
E, [2021-04-13T14:47:12.685510 #17879] ERROR -- : (textDocument/hover) dsc_sqlsetup is not a valid puppet type, class or defined type
D, [2021-04-13T14:47:12.687138 #17879] DEBUG -- : --- OUTBOUND
{"jsonrpc":"2.0","id":5,"result":{"contents":null}}
---

As per the Language Client Spec, the LSP should return null OR a HoverResult with a non-null contents