@@ -1933,7 +1933,9 @@ module ts {
1933
1933
current = child ;
1934
1934
continue outer;
1935
1935
}
1936
- if ( child . end > position ) break ;
1936
+ if ( child . end > position ) {
1937
+ break ;
1938
+ }
1937
1939
}
1938
1940
return current ;
1939
1941
}
@@ -2160,13 +2162,22 @@ module ts {
2160
2162
return undefined ;
2161
2163
}
2162
2164
2163
- if ( node . kind !== SyntaxKind . Identifier &&
2164
- ! isLiteralNameOfPropertyDeclarationOrIndexAccess ( node ) &&
2165
- ! isNameOfExternalModuleImportOrDeclaration ( node ) ) {
2166
- return undefined ;
2165
+ if ( node . kind === SyntaxKind . Identifier ||
2166
+ isLiteralNameOfPropertyDeclarationOrIndexAccess ( node ) ||
2167
+ isNameOfExternalModuleImportOrDeclaration ( node ) ) {
2168
+ return getReferencesForNode ( node , [ sourceFile ] ) ;
2167
2169
}
2168
2170
2169
- return getReferencesForNode ( node , [ sourceFile ] ) ;
2171
+ switch ( node . kind ) {
2172
+ }
2173
+
2174
+ return undefined ;
2175
+
2176
+ function keywordsToReferenceEntries ( keywords : Node [ ] ) : ReferenceEntry [ ] {
2177
+ return keywords . map ( keyword =>
2178
+ new ReferenceEntry ( filename , TypeScript . TextSpan . fromBounds ( keyword . getStart ( ) , keyword . end ) , /* isWriteAccess */ false )
2179
+ ) ;
2180
+ }
2170
2181
}
2171
2182
2172
2183
function getReferencesAtPosition ( filename : string , position : number ) : ReferenceEntry [ ] {
@@ -2284,13 +2295,13 @@ module ts {
2284
2295
var container = getContainerNode ( declarations [ i ] ) ;
2285
2296
2286
2297
if ( scope && scope !== container ) {
2287
- // Diffrent declarations have diffrent containers, bail out
2298
+ // Different declarations have different containers, bail out
2288
2299
return undefined ;
2289
2300
}
2290
2301
2291
2302
if ( container . kind === SyntaxKind . SourceFile && ! isExternalModule ( < SourceFile > container ) ) {
2292
2303
// This is a global variable and not an external module, any declaration defined
2293
- // withen this scope is visible outside the file
2304
+ // within this scope is visible outside the file
2294
2305
return undefined ;
2295
2306
}
2296
2307
0 commit comments