fix: downgrade console.error to console.debug in DocumentHistoryTracker.push()#12017
Open
octo-patch wants to merge 1 commit intocontinuedev:mainfrom
Open
fix: downgrade console.error to console.debug in DocumentHistoryTracker.push()#12017octo-patch wants to merge 1 commit intocontinuedev:mainfrom
octo-patch wants to merge 1 commit intocontinuedev:mainfrom
Conversation
…er.push() When onDidChangeVisibleTextEditors fires, deleteChain() calls push() on the DocumentHistoryTracker for the previous request filepath. Because onDidOpenTextDocument is currently disabled (pending PR continuedev#8364 merge), documents are never pre-added via addDocument(), so push() always takes the fallback path and logs a console.error on every editor switch. The fallback in push() already handles this gracefully by calling addDocument(), making the error log misleading noise. Downgrade it to console.debug so it remains accessible for debugging without polluting the Extension Host output. Fixes continuedev#11919
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11919
Problem
Every time a user switches between text editors,
onDidChangeVisibleTextEditorsfires, which callsdeleteChain(), which callsDocumentHistoryTracker.push()for the previously active file.Because
onDidOpenTextDocumentis currently disabled (pending merge of a related PR), documents are never pre-registered viaaddDocument(). Sopush()always hits its fallback branch and logs:This error appears on every editor switch, flooding the Extension Host output with misleading noise.
Solution
The
push()fallback already handles the missing-document case correctly by callingaddDocument()— no data is lost and no functionality is broken. Theconsole.erroris therefore misleading. This PR downgrades it toconsole.debug(with a slightly more descriptive message) so the event remains visible for debugging without polluting the Extension Host console for normal users.Testing
Summary by cubic
Downgraded console.error to console.debug in DocumentHistoryTracker.push() to stop noisy “Document not found in AST tracker” messages on editor switches. Behavior is unchanged (missing documents are still auto-added), logs stay useful for debugging, and this resolves #11919.
Written for commit 38334b1. Summary will update on new commits.