Skip to content

Commit dcbc634

Browse files
Kapil Borledaviwil
Kapil Borle
authored andcommitted
Handle help completion result when null is returned
1 parent a213b17 commit dcbc634

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/features/HelpCompletion.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,7 @@ class HelpCompletionProvider {
154154
triggerPosition: triggerStartPos,
155155
blockComment: this.triggerFinderBlockComment.found
156156
}).then(result => {
157-
if (result === undefined) {
158-
return;
159-
}
160-
161-
let content = result.content;
162-
if (content === undefined) {
157+
if (result == null || result.content == null) {
163158
return;
164159
}
165160

@@ -169,7 +164,7 @@ class HelpCompletionProvider {
169164

170165
// Trim the leading whitespace (used by the rule for indentation) as VSCode takes care of the indentation.
171166
// Trim the last empty line and join the strings.
172-
let text = content.map(x => x.trimLeft()).slice(0, -1).join(this.getEOL(doc.eol));
167+
let text = result.content.map(x => x.trimLeft()).slice(0, -1).join(this.getEOL(doc.eol));
173168
editor.insertSnippet(new SnippetString(text), replaceRange);
174169
});
175170
}

0 commit comments

Comments
 (0)