@@ -85,11 +85,6 @@ export async function activate(context: vscode.ExtensionContext) {
8585 const diagnosticCollection = vscode . languages . createDiagnosticCollection ( "Cppcheck" ) ;
8686 context . subscriptions . push ( diagnosticCollection ) ;
8787
88- // set up a map of timers per document URI for debounce for continuous analysis triggers
89- // I.e. document has been changed -> DEBOUNCE_MS time passed since last change -> run cppcheck
90- const debounceTimers : Map < string , NodeJS . Timeout > = new Map ( ) ;
91- const DEBOUNCE_MS = 1000 ;
92-
9388 async function handleDocument ( document : vscode . TextDocument ) {
9489 // Only process C/C++ files.
9590 if ( ! [ "c" , "cpp" ] . includes ( document . languageId ) ) {
@@ -155,27 +150,6 @@ export async function activate(context: vscode.ExtensionContext) {
155150 ) ;
156151 }
157152
158- // TODO: Reimplement continuous analysis. Requires cppcheck update (expected in 2.20)
159- async function handleDocumentContinuous ( e : vscode . TextDocumentChangeEvent ) {
160- const document : vscode . TextDocument = e . document ;
161- const uriKey = document . uri . toString ( ) ;
162-
163- // clear any existing timer for this document
164- if ( debounceTimers . has ( uriKey ) ) {
165- clearTimeout ( debounceTimers . get ( uriKey ) ! ) ;
166- }
167-
168- // schedule a new run
169- const timer = setTimeout ( async ( ) => {
170- debounceTimers . delete ( uriKey ) ;
171- await handleDocument ( document ) ;
172- } , DEBOUNCE_MS ) ;
173- debounceTimers . set ( uriKey , timer ) ;
174- }
175-
176- // Run cppcheck when document is changed, with debounce
177- // vscode.workspace.onDidChangeTextDocument(handleDocumentContinuous, null, context.subscriptions);
178-
179153 // Listen for file saves.
180154 vscode . workspace . onDidSaveTextDocument ( handleDocument , null , context . subscriptions ) ;
181155
0 commit comments