Skip to content

Commit b1b611f

Browse files
Add undefined to return type
1 parent b17b7b9 commit b1b611f

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/harness/harnessLanguageService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ namespace Harness.LanguageService {
492492
getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: ts.FormatCodeOptions): ts.TextChange[] {
493493
return unwrapJSONCallResult(this.shim.getFormattingEditsAfterKeystroke(fileName, position, key, JSON.stringify(options)));
494494
}
495-
getDocCommentTemplateAtPosition(fileName: string, position: number): ts.TextInsertion {
495+
getDocCommentTemplateAtPosition(fileName: string, position: number): ts.TextInsertion | undefined {
496496
return unwrapJSONCallResult(this.shim.getDocCommentTemplateAtPosition(fileName, position));
497497
}
498498
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean {

src/services/jsDoc.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ namespace ts.JsDoc {
189189
* @param position The (character-indexed) position in the file where the check should
190190
* be performed.
191191
*/
192-
export function getDocCommentTemplateAtPosition(newLine: string, sourceFile: SourceFile, position: number): TextInsertion {
192+
193+
export function getDocCommentTemplateAtPosition(newLine: string, sourceFile: SourceFile, position: number): TextInsertion | undefined {
193194
// Check if in a context where we don't want to perform any insertion
194195
if (isInString(sourceFile, position) || isInComment(sourceFile, position) || hasDocComment(sourceFile, position)) {
195196
return undefined;

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ namespace ts {
17911791
}
17921792
}
17931793

1794-
function getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion {
1794+
function getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion | undefined {
17951795
return JsDoc.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position);
17961796
}
17971797

0 commit comments

Comments
 (0)