Skip to content

Commit 85cca76

Browse files
committed
remove console logs
1 parent 875ca01 commit 85cca76

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,11 @@ export class CppProperties {
309309

310310
private onConfigurationsChanged(): void {
311311
if (this.Configurations) {
312-
console.log('onConfigurationsChanged');
313312
this.configurationsChanged.fire(this);
314313
}
315314
}
316315

317316
private onSelectionChanged(): void {
318-
console.log('onSelectionChanged ', this.CurrentConfigurationIndex);
319317
this.selectionChanged.fire(this.CurrentConfigurationIndex);
320318
void this.handleSquiggles().catch(logAndReturn.undefined);
321319
}
@@ -1116,10 +1114,7 @@ export class CppProperties {
11161114

11171115
private compileCommandsFileWatcherTimer?: NodeJS.Timeout;
11181116

1119-
// Dispose existing and loop through cpp and populate with each file (exists or not) as you go.
1120-
// paths are expected to have variables resolved already
11211117
public updateCompileCommandsFileWatcher(): void {
1122-
console.log("updateCompileCommandsFileWatcher called");
11231118
// close the existing watcher if it exists
11241119
this.compileCommandsFileWatcher?.close();
11251120
this.compileCommandsFileWatcher = undefined;
@@ -1128,7 +1123,6 @@ export class CppProperties {
11281123
// if so, avoid setting up a `compile_commands.json` file watcher to avoid unnessary parsing
11291124
// by the language server
11301125
if (this.CurrentConfiguration?.configurationProvider && !this.configurationProviderFailedToProvide) {
1131-
console.log("Skipping compile_commands.json file watcher setup as configuration provider is set");
11321126
return;
11331127
}
11341128

@@ -1138,7 +1132,6 @@ export class CppProperties {
11381132
// Wait 1 second after a change to allow time for the write to finish.
11391133
clearInterval(this.compileCommandsFileWatcherTimer);
11401134
this.compileCommandsFileWatcherTimer = setTimeout(() => {
1141-
console.log("file watcher triggered for compile_commands.json");
11421135
this.onCompileCommandsChanged(path);
11431136
clearInterval(this.compileCommandsFileWatcherTimer);
11441137
this.compileCommandsFileWatcherTimer = undefined;
@@ -1147,7 +1140,6 @@ export class CppProperties {
11471140
// linux based systems lose track of the file (inode deleted)
11481141
// we need to close the watcher and wait until file is created again
11491142
if (eventType === "rename") {
1150-
console.log("compile_commands.json was renamed or deleted, closing watcher");
11511143
this.compileCommandsFileWatcher?.close();
11521144
this.compileCommandsFileWatcher = undefined;
11531145
this.compileCommandsFile = undefined;
@@ -1159,11 +1151,9 @@ export class CppProperties {
11591151
// either file not created or too many watchers
11601152
// rely on polling until the file is created
11611153
// then, file watching will be attempted again
1162-
console.log("failed to watch compile_commands.json", e);
11631154
this.compileCommandsFileWatcher?.close();
11641155
this.compileCommandsFileWatcher = undefined;
11651156
}
1166-
console.log("file watcher finished");
11671157
}
11681158

11691159
// onBeforeOpen will be called after c_cpp_properties.json have been created (if it did not exist), but before the document is opened.
@@ -2330,53 +2320,36 @@ export class CppProperties {
23302320
*/
23312321
public checkCompileCommands(): void {
23322322
if (this.compileCommandsFileWatcher !== undefined) {
2333-
console.log("Skipping check for compileCommands file changes, file watcher is active.");
23342323
return;
23352324
}
23362325
if (this.CurrentConfiguration?.configurationProvider && !this.configurationProviderFailedToProvide) {
2337-
console.log("Skipping check for compileCommands file changes, configuration provider is set and not forced.");
23382326
return;
23392327
}
23402328
const compileCommands: string | undefined = this.CurrentConfiguration?.compileCommands;
23412329
if (compileCommands === undefined) {
2342-
console.log("Skipping check for compileCommands file changes, compileCommands is not set.");
23432330
return;
23442331
}
23452332

2346-
console.log("Manually checking for compileCommands file changes.");
23472333
const compileCommandsFile: string | undefined = this.resolvePath(compileCommands);
23482334
try {
23492335
const stats = fs.statSync(compileCommandsFile);
23502336
if (this.compileCommandsFile === undefined || stats.mtime > this.compileCommandsFileWatcherFallbackTime) {
23512337
this.compileCommandsFileWatcherFallbackTime = new Date();
2352-
console.log("checkCompileCommands(): compileCommands file changed");
23532338
this.onCompileCommandsChanged(compileCommandsFile);
23542339
this.compileCommandsFile = compileCommandsFile; // File created.
23552340
}
23562341
}
23572342
catch (err: any) {
23582343
if (err.code === "ENOENT" && this.compileCommandsFile) {
2359-
console.log("checkCompileCommands(): compileCommands file deleted");
23602344
this.onCompileCommandsChanged(compileCommandsFile);
23612345
this.compileCommandsFile = undefined; // File deleted
23622346
}
23632347
}
2364-
console.log("checkCompileCommands(): done");
23652348

23662349
const providerInsufficient: boolean = !this.CurrentConfiguration?.configurationProvider || this.configurationProviderFailedToProvide;
23672350
if (this.compileCommandsFile !== undefined && providerInsufficient) {
2368-
console.log("try to watch compileCommands file");
23692351
this.updateCompileCommandsFileWatcher();
23702352
}
2371-
else {
2372-
// debug which condition was not met
2373-
if (this.compileCommandsFile === undefined) {
2374-
console.log("compileCommandsFile is undefined");
2375-
}
2376-
if (this.CurrentConfiguration?.configurationProvider) {
2377-
console.log("configurationProvider is set");
2378-
}
2379-
}
23802353
}
23812354

23822355
dispose(): void {

0 commit comments

Comments
 (0)