Fix excessive console logging + remove unnecessary try catch (#5860)
This commit is contained in:
parent
344ee29f77
commit
9ac62565a0
|
@ -83,16 +83,11 @@ async function getIdeStatusMessageWithFiles(ideClient: IdeClient): Promise<{
|
|||
switch (connection.status) {
|
||||
case IDEConnectionStatus.Connected: {
|
||||
let content = `🟢 Connected to ${ideClient.getDetectedIdeDisplayName()}`;
|
||||
try {
|
||||
const context = await ideContext.getIdeContext();
|
||||
const context = ideContext.getIdeContext();
|
||||
const openFiles = context?.workspaceState?.openFiles;
|
||||
|
||||
if (openFiles && openFiles.length > 0) {
|
||||
content += formatFileList(openFiles);
|
||||
}
|
||||
} catch (_e) {
|
||||
// Ignore
|
||||
}
|
||||
return {
|
||||
messageType: 'info',
|
||||
content,
|
||||
|
|
|
@ -211,16 +211,16 @@ export class IdeClient {
|
|||
this.state.status === IDEConnectionStatus.Disconnected &&
|
||||
status === IDEConnectionStatus.Disconnected;
|
||||
|
||||
// Only update details if the state wasn't already disconnected, so that
|
||||
// the first detail message is preserved.
|
||||
// Only update details & log to console if the state wasn't already
|
||||
// disconnected, so that the first detail message is preserved.
|
||||
if (!isAlreadyDisconnected) {
|
||||
this.state = { status, details };
|
||||
}
|
||||
|
||||
if (status === IDEConnectionStatus.Disconnected) {
|
||||
if (logToConsole) {
|
||||
logger.error(details);
|
||||
}
|
||||
}
|
||||
|
||||
if (status === IDEConnectionStatus.Disconnected) {
|
||||
logger.debug(details);
|
||||
ideContext.clearIdeContext();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue