@@ -2,21 +2,21 @@ module ts.NavigateTo {
22 type RawNavigateToItem = { name : string ; fileName : string ; matchKind : PatternMatchKind ; isCaseSensitive : boolean ; declaration : Declaration } ;
33
44 export function getNavigateToItems ( program : Program , cancellationToken : CancellationTokenObject , searchValue : string , maxResultCount : number ) : NavigateToItem [ ] {
5- var patternMatcher = createPatternMatcher ( searchValue ) ;
6- var rawItems : RawNavigateToItem [ ] = [ ] ;
5+ let patternMatcher = createPatternMatcher ( searchValue ) ;
6+ let rawItems : RawNavigateToItem [ ] = [ ] ;
77
88 // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[]
99 forEach ( program . getSourceFiles ( ) , sourceFile => {
1010 cancellationToken . throwIfCancellationRequested ( ) ;
1111
12- var declarations = sourceFile . getNamedDeclarations ( ) ;
12+ let declarations = sourceFile . getNamedDeclarations ( ) ;
1313 for ( let declaration of declarations ) {
1414 var name = getDeclarationName ( declaration ) ;
1515 if ( name !== undefined ) {
1616
1717 // First do a quick check to see if the name of the declaration matches the
1818 // last portion of the (possibly) dotted name they're searching for.
19- var matches = patternMatcher . getMatchesForLastSegmentOfPattern ( name ) ;
19+ let matches = patternMatcher . getMatchesForLastSegmentOfPattern ( name ) ;
2020
2121 if ( ! matches ) {
2222 continue ;
@@ -25,7 +25,7 @@ module ts.NavigateTo {
2525 // It was a match! If the pattern has dots in it, then also see if hte
2626 // declaration container matches as well.
2727 if ( patternMatcher . patternContainsDots ) {
28- var containers = getContainers ( declaration ) ;
28+ let containers = getContainers ( declaration ) ;
2929 if ( ! containers ) {
3030 return undefined ;
3131 }
@@ -37,8 +37,8 @@ module ts.NavigateTo {
3737 }
3838 }
3939
40- var fileName = sourceFile . fileName ;
41- var matchKind = bestMatchKind ( matches ) ;
40+ let fileName = sourceFile . fileName ;
41+ let matchKind = bestMatchKind ( matches ) ;
4242 rawItems . push ( { name, fileName, matchKind, isCaseSensitive : allMatchesAreCaseSensitive ( matches ) , declaration } ) ;
4343 }
4444 }
@@ -49,7 +49,7 @@ module ts.NavigateTo {
4949 rawItems = rawItems . slice ( 0 , maxResultCount ) ;
5050 }
5151
52- var items = map ( rawItems , createNavigateToItem ) ;
52+ let items = map ( rawItems , createNavigateToItem ) ;
5353
5454 return items ;
5555
@@ -67,13 +67,13 @@ module ts.NavigateTo {
6767 }
6868
6969 function getDeclarationName ( declaration : Declaration ) : string {
70- var result = getTextOfIdentifierOrLiteral ( declaration . name ) ;
70+ let result = getTextOfIdentifierOrLiteral ( declaration . name ) ;
7171 if ( result !== undefined ) {
7272 return result ;
7373 }
7474
7575 if ( declaration . name . kind === SyntaxKind . ComputedPropertyName ) {
76- var expr = ( < ComputedPropertyName > declaration . name ) . expression ;
76+ let expr = ( < ComputedPropertyName > declaration . name ) . expression ;
7777 if ( expr . kind === SyntaxKind . PropertyAccessExpression ) {
7878 return ( < PropertyAccessExpression > expr ) . name . text ;
7979 }
@@ -97,7 +97,7 @@ module ts.NavigateTo {
9797
9898 function tryAddSingleDeclarationName ( declaration : Declaration , containers : string [ ] ) {
9999 if ( declaration && declaration . name ) {
100- var text = getTextOfIdentifierOrLiteral ( declaration . name ) ;
100+ let text = getTextOfIdentifierOrLiteral ( declaration . name ) ;
101101 if ( text !== undefined ) {
102102 containers . unshift ( text ) ;
103103 }
@@ -117,7 +117,7 @@ module ts.NavigateTo {
117117 //
118118 // [X.Y.Z]() { }
119119 function tryAddComputedPropertyName ( expression : Expression , containers : string [ ] , includeLastPortion : boolean ) : boolean {
120- var text = getTextOfIdentifierOrLiteral ( expression ) ;
120+ let text = getTextOfIdentifierOrLiteral ( expression ) ;
121121 if ( text !== undefined ) {
122122 if ( includeLastPortion ) {
123123 containers . unshift ( text ) ;
@@ -126,7 +126,7 @@ module ts.NavigateTo {
126126 }
127127
128128 if ( expression . kind === SyntaxKind . PropertyAccessExpression ) {
129- var propertyAccess = < PropertyAccessExpression > expression ;
129+ let propertyAccess = < PropertyAccessExpression > expression ;
130130 if ( includeLastPortion ) {
131131 containers . unshift ( propertyAccess . name . text ) ;
132132 }
@@ -138,7 +138,7 @@ module ts.NavigateTo {
138138 }
139139
140140 function getContainers ( declaration : Declaration ) {
141- var containers : string [ ] = [ ] ;
141+ let containers : string [ ] = [ ] ;
142142
143143 // First, if we started with a computed property name, then add all but the last
144144 // portion into the container array.
@@ -164,10 +164,10 @@ module ts.NavigateTo {
164164
165165 function bestMatchKind ( matches : PatternMatch [ ] ) {
166166 Debug . assert ( matches . length > 0 ) ;
167- var bestMatchKind = PatternMatchKind . camelCase ;
167+ let bestMatchKind = PatternMatchKind . camelCase ;
168168
169169 for ( let match of matches ) {
170- var kind = match . kind ;
170+ let kind = match . kind ;
171171 if ( kind < bestMatchKind ) {
172172 bestMatchKind = kind ;
173173 }
@@ -177,7 +177,7 @@ module ts.NavigateTo {
177177 }
178178
179179 // This means "compare in a case insensitive manner."
180- var baseSensitivity : Intl . CollatorOptions = { sensitivity : "base" } ;
180+ let baseSensitivity : Intl . CollatorOptions = { sensitivity : "base" } ;
181181 function compareNavigateToItems ( i1 : RawNavigateToItem , i2 : RawNavigateToItem ) {
182182 // TODO(cyrusn): get the gamut of comparisons that VS already uses here.
183183 // Right now we just sort by kind first, and then by name of the item.
@@ -189,8 +189,8 @@ module ts.NavigateTo {
189189 }
190190
191191 function createNavigateToItem ( rawItem : RawNavigateToItem ) : NavigateToItem {
192- var declaration = rawItem . declaration ;
193- var container = < Declaration > getContainerNode ( declaration ) ;
192+ let declaration = rawItem . declaration ;
193+ let container = < Declaration > getContainerNode ( declaration ) ;
194194 return {
195195 name : rawItem . name ,
196196 kind : getNodeKind ( declaration ) ,
0 commit comments