Skip to content

Commit 7f8893b

Browse files
authored
Add more logging for when loadWorkspaceContents isn't used (microsoft#185624)
1 parent 2baf8c5 commit 7f8893b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

extensions/typescript-language-features/src/extension.browser.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,16 @@ async function preload(logger: Logger): Promise<void> {
109109

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

115116
try {
116117
const remoteHubApi = await RemoteRepositories.getApi();
117-
if (remoteHubApi.loadWorkspaceContents !== undefined) {
118-
if (await remoteHubApi.loadWorkspaceContents(workspaceUri)) {
119-
logger.info(`Successfully loaded workspace content for repository ${workspaceUri.toString()}`);
120-
} else {
121-
logger.info(`Failed to load workspace content for repository ${workspaceUri.toString()}`);
122-
}
123-
118+
if (await remoteHubApi.loadWorkspaceContents?.(workspaceUri)) {
119+
logger.info(`Successfully loaded workspace content for repository ${workspaceUri.toString()}`);
120+
} else {
121+
logger.info(`Failed to load workspace content for repository ${workspaceUri.toString()}`);
124122
}
125123
} catch (error) {
126124
logger.info(`Loading workspace content for repository ${workspaceUri.toString()} failed: ${error instanceof Error ? error.toString() : 'Unknown reason'}`);

0 commit comments

Comments
 (0)