@@ -1797,7 +1797,7 @@ namespace ts {
1797
1797
let outputText : string ;
1798
1798
1799
1799
// Create a compilerHost object to allow the compiler to read and write files
1800
- var compilerHost : CompilerHost = {
1800
+ let compilerHost : CompilerHost = {
1801
1801
getSourceFile : ( fileName , target ) => fileName === inputFileName ? sourceFile : undefined ,
1802
1802
writeFile : ( name , text , writeByteOrderMark ) => {
1803
1803
Debug . assert ( outputText === undefined , "Unexpected multiple outputs for the file: " + name ) ;
@@ -1810,7 +1810,7 @@ namespace ts {
1810
1810
getNewLine : ( ) => newLine
1811
1811
} ;
1812
1812
1813
- var program = createProgram ( [ inputFileName ] , options , compilerHost ) ;
1813
+ let program = createProgram ( [ inputFileName ] , options , compilerHost ) ;
1814
1814
1815
1815
addRange ( /*to*/ diagnostics , /*from*/ program . getSyntacticDiagnostics ( sourceFile ) ) ;
1816
1816
addRange ( /*to*/ diagnostics , /*from*/ program . getOptionsDiagnostics ( ) ) ;
@@ -3084,7 +3084,7 @@ namespace ts {
3084
3084
* accurately aggregate locals from the closest containing scope.
3085
3085
*/
3086
3086
function getScopeNode ( initialToken : Node , position : number , sourceFile : SourceFile ) {
3087
- var scope = initialToken ;
3087
+ let scope = initialToken ;
3088
3088
while ( scope && ! positionBelongsToNode ( scope , position , sourceFile ) ) {
3089
3089
scope = scope . parent ;
3090
3090
}
@@ -3485,10 +3485,10 @@ namespace ts {
3485
3485
3486
3486
function getCompletionEntriesFromSymbols ( symbols : Symbol [ ] ) : CompletionEntry [ ] {
3487
3487
let start = new Date ( ) . getTime ( ) ;
3488
- var entries : CompletionEntry [ ] = [ ] ;
3488
+ let entries : CompletionEntry [ ] = [ ] ;
3489
3489
3490
3490
if ( symbols ) {
3491
- var nameToSymbol : Map < Symbol > = { } ;
3491
+ let nameToSymbol : Map < Symbol > = { } ;
3492
3492
for ( let symbol of symbols ) {
3493
3493
let entry = createCompletionEntry ( symbol , location ) ;
3494
3494
if ( entry ) {
@@ -3522,13 +3522,13 @@ namespace ts {
3522
3522
let symbol = forEach ( symbols , s => getCompletionEntryDisplayNameForSymbol ( s , target , /*performCharacterChecks:*/ false ) === entryName ? s : undefined ) ;
3523
3523
3524
3524
if ( symbol ) {
3525
- let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind ( symbol , getValidSourceFile ( fileName ) , location , location , SemanticMeaning . All ) ;
3525
+ let { displayParts , documentation , symbolKind } = getSymbolDisplayPartsDocumentationAndSymbolKind ( symbol , getValidSourceFile ( fileName ) , location , location , SemanticMeaning . All ) ;
3526
3526
return {
3527
3527
name : entryName ,
3528
- kind : displayPartsDocumentationsAndSymbolKind . symbolKind ,
3529
3528
kindModifiers : getSymbolModifiers ( symbol ) ,
3530
- displayParts : displayPartsDocumentationsAndSymbolKind . displayParts ,
3531
- documentation : displayPartsDocumentationsAndSymbolKind . documentation
3529
+ kind : symbolKind ,
3530
+ displayParts,
3531
+ documentation
3532
3532
} ;
3533
3533
}
3534
3534
}
@@ -4203,7 +4203,7 @@ namespace ts {
4203
4203
}
4204
4204
4205
4205
if ( type . flags & TypeFlags . Union ) {
4206
- var result : DefinitionInfo [ ] = [ ] ;
4206
+ let result : DefinitionInfo [ ] = [ ] ;
4207
4207
forEach ( ( < UnionType > type ) . types , t => {
4208
4208
if ( t . symbol ) {
4209
4209
addRange ( /*to*/ result , /*from*/ getDefinitionFromSymbol ( t . symbol , node ) ) ;
@@ -4303,7 +4303,7 @@ namespace ts {
4303
4303
function getSyntacticDocumentHighlights ( node : Node ) : DocumentHighlights [ ] {
4304
4304
let fileName = sourceFile . fileName ;
4305
4305
4306
- var highlightSpans = getHighlightSpans ( node ) ;
4306
+ let highlightSpans = getHighlightSpans ( node ) ;
4307
4307
if ( ! highlightSpans || highlightSpans . length === 0 ) {
4308
4308
return undefined ;
4309
4309
}
@@ -4881,17 +4881,17 @@ namespace ts {
4881
4881
}
4882
4882
4883
4883
function findRenameLocations ( fileName : string , position : number , findInStrings : boolean , findInComments : boolean ) : RenameLocation [ ] {
4884
- var referencedSymbols = findReferencedSymbols ( fileName , position , findInStrings , findInComments ) ;
4884
+ let referencedSymbols = findReferencedSymbols ( fileName , position , findInStrings , findInComments ) ;
4885
4885
return convertReferences ( referencedSymbols ) ;
4886
4886
}
4887
4887
4888
4888
function getReferencesAtPosition ( fileName : string , position : number ) : ReferenceEntry [ ] {
4889
- var referencedSymbols = findReferencedSymbols ( fileName , position , /*findInStrings:*/ false , /*findInComments:*/ false ) ;
4889
+ let referencedSymbols = findReferencedSymbols ( fileName , position , /*findInStrings:*/ false , /*findInComments:*/ false ) ;
4890
4890
return convertReferences ( referencedSymbols ) ;
4891
4891
}
4892
4892
4893
4893
function findReferences ( fileName : string , position : number ) : ReferencedSymbol [ ] {
4894
- var referencedSymbols = findReferencedSymbols ( fileName , position , /*findInStrings:*/ false , /*findInComments:*/ false ) ;
4894
+ let referencedSymbols = findReferencedSymbols ( fileName , position , /*findInStrings:*/ false , /*findInComments:*/ false ) ;
4895
4895
4896
4896
// Only include referenced symbols that have a valid definition.
4897
4897
return filter ( referencedSymbols , rs => ! ! rs . definition ) ;
@@ -5190,7 +5190,7 @@ namespace ts {
5190
5190
}
5191
5191
} ) ;
5192
5192
5193
- var definition : DefinitionInfo = {
5193
+ let definition : DefinitionInfo = {
5194
5194
containerKind : "" ,
5195
5195
containerName : "" ,
5196
5196
fileName : targetLabel . getSourceFile ( ) . fileName ,
@@ -5286,10 +5286,10 @@ namespace ts {
5286
5286
if ( referenceSymbol ) {
5287
5287
let referenceSymbolDeclaration = referenceSymbol . valueDeclaration ;
5288
5288
let shorthandValueSymbol = typeChecker . getShorthandAssignmentValueSymbol ( referenceSymbolDeclaration ) ;
5289
- var relatedSymbol = getRelatedSymbol ( searchSymbols , referenceSymbol , referenceLocation ) ;
5289
+ let relatedSymbol = getRelatedSymbol ( searchSymbols , referenceSymbol , referenceLocation ) ;
5290
5290
5291
5291
if ( relatedSymbol ) {
5292
- var referencedSymbol = getReferencedSymbol ( relatedSymbol ) ;
5292
+ let referencedSymbol = getReferencedSymbol ( relatedSymbol ) ;
5293
5293
referencedSymbol . references . push ( getReferenceEntryFromNode ( referenceLocation ) ) ;
5294
5294
}
5295
5295
/* Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment
@@ -5299,7 +5299,7 @@ namespace ts {
5299
5299
* position of property accessing, the referenceEntry of such position will be handled in the first case.
5300
5300
*/
5301
5301
else if ( ! ( referenceSymbol . flags & SymbolFlags . Transient ) && searchSymbols . indexOf ( shorthandValueSymbol ) >= 0 ) {
5302
- var referencedSymbol = getReferencedSymbol ( shorthandValueSymbol ) ;
5302
+ let referencedSymbol = getReferencedSymbol ( shorthandValueSymbol ) ;
5303
5303
referencedSymbol . references . push ( getReferenceEntryFromNode ( referenceSymbolDeclaration . name ) ) ;
5304
5304
}
5305
5305
}
@@ -5309,8 +5309,8 @@ namespace ts {
5309
5309
return ;
5310
5310
5311
5311
function getReferencedSymbol ( symbol : Symbol ) : ReferencedSymbol {
5312
- var symbolId = getSymbolId ( symbol ) ;
5313
- var index = symbolToIndex [ symbolId ] ;
5312
+ let symbolId = getSymbolId ( symbol ) ;
5313
+ let index = symbolToIndex [ symbolId ] ;
5314
5314
if ( index === undefined ) {
5315
5315
index = result . length ;
5316
5316
symbolToIndex [ symbolId ] = index ;
@@ -5397,7 +5397,7 @@ namespace ts {
5397
5397
}
5398
5398
} ) ;
5399
5399
5400
- var definition = getDefinition ( searchSpaceNode . symbol ) ;
5400
+ let definition = getDefinition ( searchSpaceNode . symbol ) ;
5401
5401
return [ { definition, references } ] ;
5402
5402
}
5403
5403
@@ -5592,7 +5592,7 @@ namespace ts {
5592
5592
// If the reference symbol is an alias, check if what it is aliasing is one of the search
5593
5593
// symbols.
5594
5594
if ( isImportOrExportSpecifierImportSymbol ( referenceSymbol ) ) {
5595
- var aliasedSymbol = typeChecker . getAliasedSymbol ( referenceSymbol ) ;
5595
+ let aliasedSymbol = typeChecker . getAliasedSymbol ( referenceSymbol ) ;
5596
5596
if ( searchSymbols . indexOf ( aliasedSymbol ) >= 0 ) {
5597
5597
return aliasedSymbol ;
5598
5598
}
@@ -6908,7 +6908,7 @@ namespace ts {
6908
6908
}
6909
6909
6910
6910
function convertClassifications ( classifications : Classifications , text : string ) : ClassificationResult {
6911
- var entries : ClassificationInfo [ ] = [ ] ;
6911
+ let entries : ClassificationInfo [ ] = [ ] ;
6912
6912
let dense = classifications . spans ;
6913
6913
let lastEnd = 0 ;
6914
6914
0 commit comments