Breakpoints on the node with decorator should start at actual syntax and not from decorators

This commit is contained in:
Sheetal Nandi
2015-11-19 16:34:38 -08:00
parent 858a99b4f1
commit 83e569e6c3
2 changed files with 38 additions and 59 deletions

View File

@@ -39,7 +39,10 @@ namespace ts.BreakpointResolver {
return spanInNode(tokenAtLocation);
function textSpan(startNode: Node, endNode?: Node) {
return createTextSpanFromBounds(startNode.getStart(sourceFile), (endNode || startNode).getEnd());
const start = startNode.decorators ?
skipTrivia(sourceFile.text, startNode.decorators.end) :
startNode.getStart(sourceFile);
return createTextSpanFromBounds(start, (endNode || startNode).getEnd());
}
function spanInNodeIfStartsOnSameLine(node: Node, otherwiseOnNode?: Node): TextSpan {