mirror of https://github.com/microsoft/vscode.git
parent
b2d86aa98d
commit
cc1eecb9f0
|
@ -82,16 +82,16 @@ export abstract class AbstractMcpResourceManagementService extends Disposable im
|
|||
private initialize(): Promise<void> {
|
||||
if (!this.initializePromise) {
|
||||
this.initializePromise = (async () => {
|
||||
this.local = await this.populateLocalServer();
|
||||
this.local = await this.populateLocalServers();
|
||||
this.startWatching();
|
||||
})();
|
||||
}
|
||||
return this.initializePromise;
|
||||
}
|
||||
|
||||
private async populateLocalServer(): Promise<Map<string, ILocalMcpServer>> {
|
||||
private async populateLocalServers(): Promise<Map<string, ILocalMcpServer>> {
|
||||
this.logService.trace('AbstractMcpResourceManagementService#populateLocalServers', this.mcpResource.toString());
|
||||
const local = new Map<string, ILocalMcpServer>();
|
||||
this.logService.info('MCP Management Service: fetchInstalled', this.mcpResource.toString());
|
||||
try {
|
||||
const scannedMcpServers = await this.mcpResourceScannerService.scanMcpServers(this.mcpResource, this.target);
|
||||
if (scannedMcpServers.servers) {
|
||||
|
@ -118,7 +118,7 @@ export abstract class AbstractMcpResourceManagementService extends Disposable im
|
|||
|
||||
protected async updateLocal(): Promise<void> {
|
||||
try {
|
||||
const current = await this.populateLocalServer();
|
||||
const current = await this.populateLocalServers();
|
||||
|
||||
const added: ILocalMcpServer[] = [];
|
||||
const updated: ILocalMcpServer[] = [];
|
||||
|
|
|
@ -258,9 +258,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
let value: { token: string; authenticationProviderId: string } | undefined = undefined;
|
||||
if (current) {
|
||||
try {
|
||||
this.logService.trace('Settings Sync: Updating the token for the account', current.accountName);
|
||||
const token = current.token;
|
||||
this.traceOrInfo('Settings Sync: Token updated for the account', current.accountName);
|
||||
value = { token, authenticationProviderId: current.authenticationProviderId };
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
|
@ -269,19 +267,11 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
|||
await this.userDataSyncAccountService.updateAccount(value);
|
||||
}
|
||||
|
||||
private traceOrInfo(msg: string, ...args: any[]): void {
|
||||
if (this.environmentService.isBuilt) {
|
||||
this.logService.info(msg, ...args);
|
||||
} else {
|
||||
this.logService.trace(msg, ...args);
|
||||
}
|
||||
}
|
||||
|
||||
private updateAccountStatus(accountStatus: AccountStatus): void {
|
||||
this.logService.trace(`Settings Sync: Updating the account status to ${accountStatus}`);
|
||||
if (this._accountStatus !== accountStatus) {
|
||||
const previous = this._accountStatus;
|
||||
this.traceOrInfo(`Settings Sync: Account status changed from ${previous} to ${accountStatus}`);
|
||||
this.logService.info(`Settings Sync: Account status changed from ${previous} to ${accountStatus}`);
|
||||
|
||||
this._accountStatus = accountStatus;
|
||||
this.accountStatusContext.set(accountStatus);
|
||||
|
|
Loading…
Reference in New Issue