mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Add longer grace period for diagnostics to catch up when existing errors should have been fixed by claude
This commit is contained in:
parent
7a9088a2d3
commit
4ee88c5de7
1 changed files with 15 additions and 2 deletions
|
|
@ -58,10 +58,23 @@ class DiagnosticsMonitor {
|
|||
return currentDiagnostics
|
||||
}
|
||||
|
||||
return this.waitForUpdatedDiagnostics()
|
||||
let timeout = 300
|
||||
|
||||
// if diagnostics contain existing errors (since the check above didn't trigger) then it's likely claude just did something that should have fixed the error, so we'll give a longer grace period for diagnostics to catch up
|
||||
const hasErrorsOrWarnings = currentDiagnostics.some(([_, diagnostics]) =>
|
||||
diagnostics.some(
|
||||
(d) =>
|
||||
d.severity === vscode.DiagnosticSeverity.Error || d.severity === vscode.DiagnosticSeverity.Warning
|
||||
)
|
||||
)
|
||||
if (hasErrorsOrWarnings) {
|
||||
timeout = 5_000
|
||||
}
|
||||
|
||||
return this.waitForUpdatedDiagnostics(timeout)
|
||||
}
|
||||
|
||||
private async waitForUpdatedDiagnostics(timeout: number = 300): Promise<FileDiagnostics> {
|
||||
private async waitForUpdatedDiagnostics(timeout: number): Promise<FileDiagnostics> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const timer = setTimeout(() => {
|
||||
cleanup()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue