You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constassertion=Debug.assertDefined(findAncestor(token,(n): n is AsExpression|TypeAssertion=>isAsExpression(n)||isTypeAssertion(n)));
17
+
constassertion=Debug.assertDefined(findAncestor(token,(n): n is AsExpression|TypeAssertion=>isAsExpression(n)||isTypeAssertion(n)),"Expected to find an assertion expression");
Copy file name to clipboardExpand all lines: src/services/codefixes/annotateWithTypeFromJSDoc.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -60,8 +60,8 @@ namespace ts.codefix {
60
60
}
61
61
}
62
62
else{
63
-
constjsdocType=Debug.assertDefined(getJSDocType(decl));// If not defined, shouldn't have been an error to fix
64
-
Debug.assert(!decl.type);// If defined, shouldn't have been an error to fix.
63
+
constjsdocType=Debug.assertDefined(getJSDocType(decl),"A JSDocType for this declaration should exist");// If not defined, shouldn't have been an error to fix
64
+
Debug.assert(!decl.type,"The JSDocType decl should have a type");// If defined, shouldn't have been an error to fix.
changes.delete(sourceFile,Debug.assertDefined(cast(token.parent,isDeclarationWithTypeParameterChildren).typeParameters,"The type parameter to delete should exist"));
121
121
}
122
122
123
123
// Sometimes the diagnostic span is an entire ImportDeclaration, so we should remove the whole thing.
@@ -231,7 +231,7 @@ namespace ts.codefix {
231
231
// Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused.
232
232
const{ parameters }=parent;
233
233
constindex=parameters.indexOf(p);
234
-
Debug.assert(index!==-1);
234
+
Debug.assert(index!==-1,"The parameter should already be in the list");
Debug.assert(entry.defaultImport===undefined||entry.defaultImport===symbolName,"(Add to Existing) Default import should be missing or match symbolName");
Debug.assert(entry.namespaceLikeImport===undefined||entry.namespaceLikeImport.name===symbolName,"Namespacelike import shoudl be missing or match symbolName");
returnaliased&&getDefaultExportInfoWorker(aliased,Debug.assertDefined(aliased.parent,"Alias targets of default exports must have a parent"),checker,compilerOptions);
0 commit comments