@@ -244,7 +244,6 @@ namespace ts.Completions {
244
244
propertyAccessToConvert : PropertyAccessExpression | undefined ,
245
245
isJsxInitializer : IsJsxInitializer | undefined ,
246
246
preferences : UserPreferences ,
247
- isFulfilled : boolean
248
247
) : CompletionEntry | undefined {
249
248
let insertText : string | undefined ;
250
249
let replacementSpan : TextSpan | undefined ;
@@ -291,7 +290,6 @@ namespace ts.Completions {
291
290
isRecommended : trueOrUndefined ( isRecommendedCompletionMatch ( symbol , recommendedCompletion , typeChecker ) ) ,
292
291
insertText,
293
292
replacementSpan,
294
- isFulfilled
295
293
} ;
296
294
}
297
295
@@ -343,17 +341,17 @@ namespace ts.Completions {
343
341
}
344
342
345
343
let sortText = symbolToSortTextMap && symbolToSortTextMap [ getSymbolId ( symbol ) ] ;
346
- let isFulfilled = false ;
347
344
if ( ! sortText ) {
348
- fulfilledSymbols && fulfilledSymbols . forEach ( fulfilledSymbol => {
349
- if ( fulfilledSymbol . name === symbol . name ) {
350
- sortText = SortText . LocationPriorityFulfilled ;
351
- isFulfilled = true ;
352
- }
353
- } ) ;
345
+ if ( fulfilledSymbols && fulfilledSymbols . length > 0 ) {
346
+ fulfilledSymbols . forEach ( fulfilledSymbol => {
347
+ if ( fulfilledSymbol . name === symbol . name ) {
348
+ sortText = SortText . LocationPriorityFulfilled ;
349
+ }
350
+ } ) ;
351
+ }
354
352
}
355
353
if ( ! sortText ) {
356
- sortText = SymbolDisplay . getSymbolModifiers ( symbol ) === ' optional' ? SortText . LocationPriorityOptional : SortText . LocationPriority ;
354
+ sortText = SymbolDisplay . getSymbolModifiers ( symbol ) === " optional" ? SortText . LocationPriorityOptional : SortText . LocationPriority ;
357
355
}
358
356
359
357
const entry = createCompletionEntry (
@@ -369,7 +367,6 @@ namespace ts.Completions {
369
367
propertyAccessToConvert ,
370
368
isJsxInitializer ,
371
369
preferences ,
372
- isFulfilled
373
370
) ;
374
371
if ( ! entry ) {
375
372
continue ;
@@ -1519,14 +1516,16 @@ namespace ts.Completions {
1519
1516
if ( typeMembers && typeMembers . length > 0 ) {
1520
1517
// Add filtered items to the completion list
1521
1518
symbols = filterObjectMembersList ( typeMembers , Debug . assertDefined ( existingMembers ) ) ;
1522
- existingMembers && existingMembers . forEach ( member => {
1523
- if ( member . kind === SyntaxKind . SpreadAssignment ) {
1524
- const expression = ( < SpreadAssignment > member ) . expression ;
1525
- const symbol = typeChecker . getSymbolAtLocation ( expression ) ;
1526
- const type = symbol && typeChecker . getTypeOfSymbolAtLocation ( symbol , expression ) ;
1527
- fulfilledSymbols = type && ( < ObjectType > type ) . properties ;
1528
- }
1529
- } ) ;
1519
+ if ( existingMembers && existingMembers . length > 0 ) {
1520
+ existingMembers . forEach ( member => {
1521
+ if ( member . kind === SyntaxKind . SpreadAssignment ) {
1522
+ const expression = ( < SpreadAssignment > member ) . expression ;
1523
+ const symbol = typeChecker . getSymbolAtLocation ( expression ) ;
1524
+ const type = symbol && typeChecker . getTypeOfSymbolAtLocation ( symbol , expression ) ;
1525
+ fulfilledSymbols = type && ( < ObjectType > type ) . properties ;
1526
+ }
1527
+ } ) ;
1528
+ }
1530
1529
}
1531
1530
return GlobalsSearch . Success ;
1532
1531
}
0 commit comments