@@ -923,7 +923,7 @@ namespace ts.Completions {
923
923
}
924
924
else if ( isStartingCloseTag ) {
925
925
const tagName = ( < JsxElement > contextToken . parent . parent ) . openingElement . tagName ;
926
- const tagSymbol = typeChecker . getSymbolAtLocation ( tagName ) ;
926
+ const tagSymbol = Debug . assertDefined ( typeChecker . getSymbolAtLocation ( tagName ) ) ;
927
927
928
928
if ( ! typeChecker . isUnknownSymbol ( tagSymbol ) ) {
929
929
symbols = [ tagSymbol ] ;
@@ -971,7 +971,7 @@ namespace ts.Completions {
971
971
972
972
if ( symbol . flags & ( SymbolFlags . Module | SymbolFlags . Enum ) ) {
973
973
// Extract module or enum members
974
- const exportedSymbols = typeChecker . getExportsOfModule ( symbol ) ;
974
+ const exportedSymbols = Debug . assertEachDefined ( typeChecker . getExportsOfModule ( symbol ) ) ;
975
975
const isValidValueAccess = ( symbol : Symbol ) => typeChecker . isValidPropertyAccess ( < PropertyAccessExpression > ( node . parent ) , symbol . name ) ;
976
976
const isValidTypeAccess = ( symbol : Symbol ) => symbolCanBeReferencedAtTypeLocation ( symbol ) ;
977
977
const isValidAccess = isRhsOfImportDeclaration ?
@@ -1111,7 +1111,7 @@ namespace ts.Completions {
1111
1111
1112
1112
const symbolMeanings = SymbolFlags . Type | SymbolFlags . Value | SymbolFlags . Namespace | SymbolFlags . Alias ;
1113
1113
1114
- symbols = typeChecker . getSymbolsInScope ( scopeNode , symbolMeanings ) ;
1114
+ symbols = Debug . assertEachDefined ( typeChecker . getSymbolsInScope ( scopeNode , symbolMeanings ) ) ;
1115
1115
1116
1116
// Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions`
1117
1117
if ( options . includeInsertTextCompletions && scopeNode . kind !== SyntaxKind . SourceFile ) {
@@ -2248,13 +2248,13 @@ namespace ts.Completions {
2248
2248
*/
2249
2249
function getPropertiesForCompletion ( type : Type , checker : TypeChecker , isForAccess : boolean ) : Symbol [ ] {
2250
2250
if ( ! ( type . flags & TypeFlags . Union ) ) {
2251
- return type . getApparentProperties ( ) ;
2251
+ return Debug . assertEachDefined ( type . getApparentProperties ( ) ) ;
2252
2252
}
2253
2253
2254
2254
const { types } = type as UnionType ;
2255
2255
// If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals.
2256
2256
const filteredTypes = isForAccess ? types : types . filter ( memberType =>
2257
2257
! ( memberType . flags & TypeFlags . Primitive || checker . isArrayLikeType ( memberType ) || typeHasCallOrConstructSignatures ( memberType , checker ) ) ) ;
2258
- return checker . getAllPossiblePropertiesOfTypes ( filteredTypes ) ;
2258
+ return Debug . assertEachDefined ( checker . getAllPossiblePropertiesOfTypes ( filteredTypes ) ) ;
2259
2259
}
2260
2260
}
0 commit comments