vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

hover.contents can be empty

Open fstanis opened this issue 4 years ago • 0 comments

From #835: it seems that some users (myself included) sometimes get TypeError: Cannot read property 'value' of undefined at SignatureHelpProvider.hoverToSignatureHelp which may or may not be causing IntelliSense to fail.

Seems the culprit is on this line:

https://github.com/rust-lang/vscode-rust/blob/c957ad5ff0eee266e9b2506ad3367fcef1f17cab/src/providers/signatureHelpProvider.ts#L114

The only way that'd be caused is if hover.contents is an empty array (in which case hover.contents[0] returns undefined and hover.contents[0].value throws). I'm not sure if this is an expected behavior for hover? If so, sounds like an easy fix to add an array length check.

fstanis avatar Nov 17 '20 02:11 fstanis