mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
if preceding token cannot be found - scan from the beginning of enclosing node
This commit is contained in:
@@ -238,7 +238,8 @@ module ts.formatting {
|
||||
}
|
||||
|
||||
var precedingToken = findPrecedingToken(enclosingNode.pos, sourceFile);
|
||||
return precedingToken ? precedingToken.end : originalRange.pos;
|
||||
// no preceding token found - start from the beginning of enclosing node
|
||||
return precedingToken ? precedingToken.end : enclosingNode.pos;
|
||||
}
|
||||
|
||||
function formatSpan(originalRange: TextRange,
|
||||
|
||||
Reference in New Issue
Block a user