@@ -1039,64 +1039,81 @@ export class Program {
10391039 /**
10401040 * Get syntactic (parse) diagnostics for a specific file or all files.
10411041 * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
1042+ * Get syntactic (parse) diagnostics for specific files or all files.
1043+ * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
10421044 */
1043- async getSyntacticDiagnostics ( file ?: DocumentIdentifier ) : Promise < readonly Diagnostic [ ] > {
1045+ async getSyntacticDiagnostics ( file ?: DocumentIdentifier | readonly DocumentIdentifier [ ] ) : Promise < readonly Diagnostic [ ] > {
1046+ const files = file === undefined ? undefined
1047+ : Array . isArray ( file ) ? file
1048+ : [ file ] ;
10441049 const data = await this . client . apiRequest < Diagnostic [ ] > ( "getSyntacticDiagnostics" , {
10451050 snapshot : this . snapshotId ,
10461051 project : this . project . id ,
1047- ... ( file !== undefined ? { file } : { } ) ,
1052+ files ,
10481053 } ) ;
10491054 return data ?? [ ] ;
10501055 }
10511056
10521057 /**
1053- * Get binder diagnostics for a specific file or all files.
1054- * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
1058+ * Get binder diagnostics for specific files or all files.
1059+ * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
10551060 */
1056- async getBindDiagnostics ( file ?: DocumentIdentifier ) : Promise < readonly Diagnostic [ ] > {
1061+ async getBindDiagnostics ( file ?: DocumentIdentifier | readonly DocumentIdentifier [ ] ) : Promise < readonly Diagnostic [ ] > {
1062+ const files = file === undefined ? undefined
1063+ : Array . isArray ( file ) ? file
1064+ : [ file ] ;
10571065 const data = await this . client . apiRequest < Diagnostic [ ] > ( "getBindDiagnostics" , {
10581066 snapshot : this . snapshotId ,
10591067 project : this . project . id ,
1060- ... ( file !== undefined ? { file } : { } ) ,
1068+ files ,
10611069 } ) ;
10621070 return data ?? [ ] ;
10631071 }
10641072
10651073 /**
1066- * Get semantic (type-check) diagnostics for a specific file or all files.
1067- * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
1074+ * Get semantic (type-check) diagnostics for specific files or all files.
1075+ * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
10681076 */
1069- async getSemanticDiagnostics ( file ?: DocumentIdentifier ) : Promise < readonly Diagnostic [ ] > {
1077+ async getSemanticDiagnostics ( file ?: DocumentIdentifier | readonly DocumentIdentifier [ ] ) : Promise < readonly Diagnostic [ ] > {
1078+ const files = file === undefined ? undefined
1079+ : Array . isArray ( file ) ? file
1080+ : [ file ] ;
10701081 const data = await this . client . apiRequest < Diagnostic [ ] > ( "getSemanticDiagnostics" , {
10711082 snapshot : this . snapshotId ,
10721083 project : this . project . id ,
1073- ... ( file !== undefined ? { file } : { } ) ,
1084+ files ,
10741085 } ) ;
10751086 return data ?? [ ] ;
10761087 }
10771088
10781089 /**
1079- * Get suggestion diagnostics for a specific file or all files.
1080- * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
1090+ * Get suggestion diagnostics for specific files or all files.
1091+ * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
10811092 */
1082- async getSuggestionDiagnostics ( file ?: DocumentIdentifier ) : Promise < readonly Diagnostic [ ] > {
1093+ async getSuggestionDiagnostics ( file ?: DocumentIdentifier | readonly DocumentIdentifier [ ] ) : Promise < readonly Diagnostic [ ] > {
1094+ const files = file === undefined ? undefined
1095+ : Array . isArray ( file ) ? file
1096+ : [ file ] ;
10831097 const data = await this . client . apiRequest < Diagnostic [ ] > ( "getSuggestionDiagnostics" , {
10841098 snapshot : this . snapshotId ,
10851099 project : this . project . id ,
1086- ... ( file !== undefined ? { file } : { } ) ,
1100+ files ,
10871101 } ) ;
10881102 return data ?? [ ] ;
10891103 }
10901104
10911105 /**
1092- * Get declaration emit diagnostics for a specific file or all files.
1093- * @param file - Optional file to get diagnostics for. If omitted, returns diagnostics for all files.
1106+ * Get declaration emit diagnostics for specific files or all files.
1107+ * @param file - Optional file(s) to get diagnostics for. If omitted, returns diagnostics for all files.
10941108 */
1095- async getDeclarationDiagnostics ( file ?: DocumentIdentifier ) : Promise < readonly Diagnostic [ ] > {
1109+ async getDeclarationDiagnostics ( file ?: DocumentIdentifier | readonly DocumentIdentifier [ ] ) : Promise < readonly Diagnostic [ ] > {
1110+ const files = file === undefined ? undefined
1111+ : Array . isArray ( file ) ? file
1112+ : [ file ] ;
10961113 const data = await this . client . apiRequest < Diagnostic [ ] > ( "getDeclarationDiagnostics" , {
10971114 snapshot : this . snapshotId ,
10981115 project : this . project . id ,
1099- ... ( file !== undefined ? { file } : { } ) ,
1116+ files ,
11001117 } ) ;
11011118 return data ?? [ ] ;
11021119 }
0 commit comments