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

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

Closed
glennsarti opened this issue Apr 21, 2021 · 0 comments · Fixed by #301
Closed

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

glennsarti opened this issue Apr 21, 2021 · 0 comments · Fixed by #301
Labels
bug Something isn't working

Comments

@glennsarti
Copy link
Contributor

As per puppetlabs/puppet-vscode#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

@glennsarti glennsarti added the bug Something isn't working label Apr 21, 2021
glennsarti added a commit to glennsarti/puppet-editor-services that referenced this issue Apr 21, 2021
Previously, the hover provider would return a Hover object with null contents
which is not allowed by the Language Server Protocol.  This commit updates
Editor Services to instead return nil when an error occurs during the resolution.
glennsarti added a commit to glennsarti/puppet-editor-services that referenced this issue Apr 22, 2021
Previously, the hover provider would return a Hover object with null contents
which is not allowed by the Language Server Protocol.  This commit updates
Editor Services to instead return nil when an error occurs during the resolution.
glennsarti added a commit that referenced this issue Apr 23, 2021
@jpogran jpogran added this to the 1.3.0 Marketplace Release milestone Apr 30, 2021
scoiatael pushed a commit to scoiatael/puppet-editor-services that referenced this issue Jan 14, 2022
Previously, the hover provider would return a Hover object with null contents
which is not allowed by the Language Server Protocol.  This commit updates
Editor Services to instead return nil when an error occurs during the resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants