Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more logging for when loadWorkspaceContents isn't used #185624

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions extensions/typescript-language-features/src/extension.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,16 @@ async function preload(logger: Logger): Promise<void> {

const workspaceUri = vscode.workspace.workspaceFolders?.[0].uri;
if (!workspaceUri || workspaceUri.scheme !== 'vscode-vfs' || workspaceUri.authority !== 'github') {
return undefined;
logger.info(`Skipped loading workspace contents for repository ${workspaceUri?.toString()}`);
return;
}

try {
const remoteHubApi = await RemoteRepositories.getApi();
if (remoteHubApi.loadWorkspaceContents !== undefined) {
if (await remoteHubApi.loadWorkspaceContents(workspaceUri)) {
logger.info(`Successfully loaded workspace content for repository ${workspaceUri.toString()}`);
} else {
logger.info(`Failed to load workspace content for repository ${workspaceUri.toString()}`);
}

if (await remoteHubApi.loadWorkspaceContents?.(workspaceUri)) {
logger.info(`Successfully loaded workspace content for repository ${workspaceUri.toString()}`);
} else {
logger.info(`Failed to load workspace content for repository ${workspaceUri.toString()}`);
}
} catch (error) {
logger.info(`Loading workspace content for repository ${workspaceUri.toString()} failed: ${error instanceof Error ? error.toString() : 'Unknown reason'}`);
Expand Down