@@ -15,7 +15,7 @@ namespace ts.BreakpointResolver {
1515 }
1616
1717 let tokenAtLocation = getTokenAtPosition ( sourceFile , position ) ;
18- let lineOfPosition = sourceFile . getLineAndCharacterOfPosition ( position ) . line ;
18+ const lineOfPosition = sourceFile . getLineAndCharacterOfPosition ( position ) . line ;
1919 if ( sourceFile . getLineAndCharacterOfPosition ( tokenAtLocation . getStart ( sourceFile ) ) . line > lineOfPosition ) {
2020 // Get previous token if the token is returned starts on new line
2121 // eg: let x =10; |--- cursor is here
@@ -216,7 +216,7 @@ namespace ts.BreakpointResolver {
216216 return spanInNodeIfStartsOnSameLine ( findPrecedingToken ( node . pos , sourceFile ) ) ;
217217
218218 case SyntaxKind . CommaToken :
219- return spanInPreviousNode ( node )
219+ return spanInPreviousNode ( node ) ;
220220
221221 case SyntaxKind . OpenBraceToken :
222222 return spanInOpenBraceToken ( node ) ;
@@ -259,13 +259,13 @@ namespace ts.BreakpointResolver {
259259 if ( isArrayLiteralOrObjectLiteralDestructuringPattern ( node ) ) {
260260 return spanInArrayLiteralOrObjectLiteralDestructuringPattern ( < DestructuringPattern > node ) ;
261261 }
262-
262+
263263 // Set breakpoint on identifier element of destructuring pattern
264264 // a or ...c or d: x from
265265 // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern
266266 if ( ( node . kind === SyntaxKind . Identifier ||
267- node . kind == SyntaxKind . SpreadElementExpression ||
268- node . kind === SyntaxKind . PropertyAssignment ||
267+ node . kind == SyntaxKind . SpreadElementExpression ||
268+ node . kind === SyntaxKind . PropertyAssignment ||
269269 node . kind === SyntaxKind . ShorthandPropertyAssignment ) &&
270270 isArrayLiteralOrObjectLiteralDestructuringPattern ( node . parent ) ) {
271271 return textSpan ( node ) ;
@@ -325,14 +325,14 @@ namespace ts.BreakpointResolver {
325325 break ;
326326 }
327327 }
328-
328+
329329 // If this is name of property assignment, set breakpoint in the initializer
330330 if ( node . parent . kind === SyntaxKind . PropertyAssignment &&
331- ( < PropertyDeclaration > node . parent ) . name === node &&
331+ ( < PropertyDeclaration > node . parent ) . name === node &&
332332 ! isArrayLiteralOrObjectLiteralDestructuringPattern ( node . parent . parent ) ) {
333333 return spanInNode ( ( < PropertyDeclaration > node . parent ) . initializer ) ;
334334 }
335-
335+
336336 // Breakpoint in type assertion goes to its operand
337337 if ( node . parent . kind === SyntaxKind . TypeAssertionExpression && ( < TypeAssertion > node . parent ) . type === node ) {
338338 return spanInNextNode ( ( < TypeAssertion > node . parent ) . type ) ;
@@ -370,7 +370,7 @@ namespace ts.BreakpointResolver {
370370 }
371371
372372 function textSpanFromVariableDeclaration ( variableDeclaration : VariableDeclaration ) : TextSpan {
373- let declarations = variableDeclaration . parent . declarations ;
373+ const declarations = variableDeclaration . parent . declarations ;
374374 if ( declarations && declarations [ 0 ] === variableDeclaration ) {
375375 // First declaration - include let keyword
376376 return textSpan ( findPrecedingToken ( variableDeclaration . pos , sourceFile , variableDeclaration . parent ) , variableDeclaration ) ;
@@ -386,7 +386,7 @@ namespace ts.BreakpointResolver {
386386 if ( variableDeclaration . parent . parent . kind === SyntaxKind . ForInStatement ) {
387387 return spanInNode ( variableDeclaration . parent . parent ) ;
388388 }
389-
389+
390390 // If this is a destructuring pattern, set breakpoint in binding pattern
391391 if ( isBindingPattern ( variableDeclaration . name ) ) {
392392 return spanInBindingPattern ( < BindingPattern > variableDeclaration . name ) ;
@@ -400,7 +400,7 @@ namespace ts.BreakpointResolver {
400400 return textSpanFromVariableDeclaration ( variableDeclaration ) ;
401401 }
402402
403- let declarations = variableDeclaration . parent . declarations ;
403+ const declarations = variableDeclaration . parent . declarations ;
404404 if ( declarations && declarations [ 0 ] !== variableDeclaration ) {
405405 // If we cannot set breakpoint on this declaration, set it on previous one
406406 // Because the variable declaration may be binding pattern and
@@ -425,8 +425,8 @@ namespace ts.BreakpointResolver {
425425 return textSpan ( parameter ) ;
426426 }
427427 else {
428- let functionDeclaration = < FunctionLikeDeclaration > parameter . parent ;
429- let indexOfParameter = indexOf ( functionDeclaration . parameters , parameter ) ;
428+ const functionDeclaration = < FunctionLikeDeclaration > parameter . parent ;
429+ const indexOfParameter = indexOf ( functionDeclaration . parameters , parameter ) ;
430430 if ( indexOfParameter ) {
431431 // Not a first parameter, go to previous parameter
432432 return spanInParameterDeclaration ( functionDeclaration . parameters [ indexOfParameter - 1 ] ) ;
@@ -459,7 +459,7 @@ namespace ts.BreakpointResolver {
459459 }
460460
461461 function spanInFunctionBlock ( block : Block ) : TextSpan {
462- let nodeForSpanInBlock = block . statements . length ? block . statements [ 0 ] : block . getLastToken ( ) ;
462+ const nodeForSpanInBlock = block . statements . length ? block . statements [ 0 ] : block . getLastToken ( ) ;
463463 if ( canFunctionHaveSpanInWholeDeclaration ( < FunctionLikeDeclaration > block . parent ) ) {
464464 return spanInNodeIfStartsOnSameLine ( block . parent , nodeForSpanInBlock ) ;
465465 }
@@ -493,7 +493,7 @@ namespace ts.BreakpointResolver {
493493 function spanInInitializerOfForLike ( forLikeStatement : ForStatement | ForOfStatement | ForInStatement ) : TextSpan {
494494 if ( forLikeStatement . initializer . kind === SyntaxKind . VariableDeclarationList ) {
495495 // Declaration list - set breakpoint in first declaration
496- let variableDeclarationList = < VariableDeclarationList > forLikeStatement . initializer ;
496+ const variableDeclarationList = < VariableDeclarationList > forLikeStatement . initializer ;
497497 if ( variableDeclarationList . declarations . length > 0 ) {
498498 return spanInNode ( variableDeclarationList . declarations [ 0 ] ) ;
499499 }
@@ -519,7 +519,7 @@ namespace ts.BreakpointResolver {
519519
520520 function spanInBindingPattern ( bindingPattern : BindingPattern ) : TextSpan {
521521 // Set breakpoint in first binding element
522- let firstBindingElement = forEach ( bindingPattern . elements ,
522+ const firstBindingElement = forEach ( bindingPattern . elements ,
523523 element => element . kind !== SyntaxKind . OmittedExpression ? element : undefined ) ;
524524
525525 if ( firstBindingElement ) {
@@ -616,7 +616,7 @@ namespace ts.BreakpointResolver {
616616 default :
617617 if ( isArrayLiteralOrObjectLiteralDestructuringPattern ( node . parent ) ) {
618618 // Breakpoint in last binding element or binding pattern if it contains no elements
619- let objectLiteral = < ObjectLiteralExpression > node . parent ;
619+ const objectLiteral = < ObjectLiteralExpression > node . parent ;
620620 return textSpan ( lastOrUndefined ( objectLiteral . properties ) || objectLiteral ) ;
621621 }
622622 return spanInNode ( node . parent ) ;
@@ -633,7 +633,7 @@ namespace ts.BreakpointResolver {
633633 default :
634634 if ( isArrayLiteralOrObjectLiteralDestructuringPattern ( node . parent ) ) {
635635 // Breakpoint in last binding element or binding pattern if it contains no elements
636- let arrayLiteral = < ArrayLiteralExpression > node . parent ;
636+ const arrayLiteral = < ArrayLiteralExpression > node . parent ;
637637 return textSpan ( lastOrUndefined ( arrayLiteral . elements ) || arrayLiteral ) ;
638638 }
639639
@@ -686,7 +686,7 @@ namespace ts.BreakpointResolver {
686686 function spanInColonToken ( node : Node ) : TextSpan {
687687 // Is this : specifying return annotation of the function declaration
688688 if ( isFunctionLike ( node . parent ) ||
689- node . parent . kind === SyntaxKind . PropertyAssignment ||
689+ node . parent . kind === SyntaxKind . PropertyAssignment ||
690690 node . parent . kind === SyntaxKind . Parameter ) {
691691 return spanInPreviousNode ( node ) ;
692692 }
0 commit comments