File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed
Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -3238,26 +3238,25 @@ module ts {
32383238
32393239 function getJavaScriptCompletionEntries ( ) : CompletionEntry [ ] {
32403240 let entries : CompletionEntry [ ] = [ ] ;
3241- let allIdentifiers : Map < string > = { } ;
3241+ let allNames : Map < string > = { } ;
3242+ let target = program . getCompilerOptions ( ) . target ;
32423243
32433244 for ( let sourceFile of program . getSourceFiles ( ) ) {
32443245 let nameTable = getNameTable ( sourceFile ) ;
32453246 for ( let name in nameTable ) {
3246- allIdentifiers [ name ] = name ;
3247- }
3248- }
3249-
3250- var target = program . getCompilerOptions ( ) . target ;
3251- for ( let name in allIdentifiers ) {
3252- let displayName = getCompletionEntryDisplayName ( name , target , /*performCharacterChecks:*/ true ) ;
3253- if ( displayName ) {
3254- // Use '1' so that all javascript identifier entries sort after Symbol entries.
3255- entries . push ( {
3256- name : displayName ,
3257- kind : ScriptElementKind . warning ,
3258- kindModifiers : "" ,
3259- sortText : "1"
3260- } ) ;
3247+ if ( ! allNames [ name ] ) {
3248+ allNames [ name ] = name ;
3249+ let displayName = getCompletionEntryDisplayName ( name , target , /*performCharacterChecks:*/ true ) ;
3250+ if ( displayName ) {
3251+ let entry = {
3252+ name : displayName ,
3253+ kind : ScriptElementKind . warning ,
3254+ kindModifiers : "" ,
3255+ sortText : "1"
3256+ } ;
3257+ entries . push ( entry ) ;
3258+ }
3259+ }
32613260 }
32623261 }
32633262
You can’t perform that action at this time.
0 commit comments