Skip to content

Commit 84b92dc

Browse files
authored
Don't show the output window for "references may be missing" when the loggingLevel is less than Warning (#13068)
1 parent afb208d commit 84b92dc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Extension/src/LanguageServer/references.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import * as telemetry from '../telemetry';
1313
import { DefaultClient } from './client';
1414
import { PersistentState } from './persistentState';
1515
import { FindAllRefsView } from './referencesView';
16+
import { CppSettings } from './settings';
1617

1718
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
1819
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
@@ -469,19 +470,24 @@ export class ReferencesManager {
469470
}
470471

471472
if (this.referencesStartedWhileTagParsing) {
473+
const showLog: boolean = util.getNumericLoggingLevel(new CppSettings().loggingLevel) >= 3;
472474
const msg: string = localize("some.references.may.be.missing", "[Warning] Some references may be missing, because workspace parsing was incomplete when {0} was started.",
473475
referencesCommandModeToString(this.client.ReferencesCommandMode));
474476
if (this.client.ReferencesCommandMode === ReferencesCommandMode.Peek) {
475477
if (this.referencesChannel) {
476478
this.referencesChannel.appendLine(msg);
477479
this.referencesChannel.appendLine("");
478-
this.referencesChannel.show(true);
480+
if (showLog) {
481+
this.referencesChannel.show(true);
482+
}
479483
}
480484
} else if (this.client.ReferencesCommandMode === ReferencesCommandMode.Find) {
481485
const logChannel: vscode.OutputChannel = logger.getOutputChannel();
482486
logChannel.appendLine(msg);
483487
logChannel.appendLine("");
484-
logChannel.show(true);
488+
if (showLog) {
489+
logChannel.show(true);
490+
}
485491
}
486492
}
487493

0 commit comments

Comments
 (0)