Skip to content

Commit

Permalink
Handle null hover (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
castwide committed Sep 29, 2022
1 parent 2ffd03c commit 96a9e05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/language-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ export function makeLanguageClient(configuration: solargraph.Configuration): Lan
// @ts-ignore HACK: It's a promise, but TypeScript doesn't recognize it
promise['then']((hover: Hover) => {
let contents: MarkdownString[] = [];
hover.contents.forEach((orig) => {
// @ts-ignore for some reason I can't determine
contents.push(convertDocumentation(orig.value));
});
if (hover) {
hover.contents.forEach((orig) => {
// @ts-ignore for some reason I can't determine
contents.push(convertDocumentation(orig.value));
});
}
resolve(new Hover(contents));
});
});
Expand Down

0 comments on commit 96a9e05

Please sign in to comment.