From a08d18af579b0c492e98dd2d9c16358c1c3b2d67 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Tue, 15 Aug 2017 12:01:43 -0700 Subject: [PATCH] consolidate isInComment and getRangeOfEnclosingComment --- src/services/utilities.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 5336d47c1f..160ef6db45 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -867,9 +867,9 @@ namespace ts { export function isInComment( sourceFile: SourceFile, position: number, - tokenAtPosition = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false), + tokenAtPosition?: Node, predicate?: (c: CommentRange) => boolean): boolean { - return !!formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ false, tokenAtPosition, predicate); + return !!formatting.getRangeOfEnclosingComment(sourceFile, position, /*onlyMultiLine*/ false, /*precedingToken*/ undefined, tokenAtPosition, predicate); } export function hasDocComment(sourceFile: SourceFile, position: number) {