consolidate isInComment and getRangeOfEnclosingComment
This commit is contained in:
parent
a209db7bb6
commit
a08d18af57
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue