Skip to content

Commit 3d54096

Browse files
committed
deal with an error in resolveAndSplit when too many paths are found in the glob
1 parent c6daabb commit 3d54096

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,8 +1731,13 @@ export class CppProperties {
17311731
* @returns The result of the operation and the time it took to complete in seconds.
17321732
*/
17331733
private async timeOperation<T>(operation: () => Promise<T | undefined>): Promise<{ result: T | undefined; duration: number }> {
1734+
let result: T | undefined;
17341735
const start = process.hrtime();
1735-
const result = await Promise.resolve(operation());
1736+
try {
1737+
result = await operation();
1738+
} catch {
1739+
// Suppress errors
1740+
}
17361741
const diff = process.hrtime(start);
17371742
const duration = diff[0] + diff[1] / 1e9; // diff[0] is in seconds, diff[1] is in nanoseconds
17381743
return { result, duration };

0 commit comments

Comments
 (0)