Skip to content

Commit

Permalink
reset hasFullWorkspaceContents when remote hub or its API isn't ava…
Browse files Browse the repository at this point in the history
…ilable, #9
  • Loading branch information
jrieken committed Nov 16, 2021
1 parent 910cb13 commit 17ed3ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async function _startServer(extensionUri: vscode.Uri, supportedLanguages: Suppor
...Object.keys(vscode.workspace.getConfiguration('files', null).get('exclude') ?? {})
].join(',')}}`;

let size: number = Math.max(0, vscode.workspace.getConfiguration('anycode').get<number>('symbolIndexSize', 500));
const size: number = Math.max(0, vscode.workspace.getConfiguration('anycode').get<number>('symbolIndexSize', 500));
// do not set a maxResults limit if RemoteHub has the full workspace contents
const remoteHub = vscode.extensions.getExtension('GitHub.remoteHub') ?? vscode.extensions.getExtension('GitHub.remoteHub-insiders');
const remoteHubApi = await remoteHub?.activate();
Expand All @@ -182,6 +182,8 @@ async function _startServer(extensionUri: vscode.Uri, supportedLanguages: Suppor
for (const folder of vscode.workspace.workspaceFolders) {
hasFullWorkspaceContents = hasFullWorkspaceContents && (await remoteHubApi.hasWorkspaceContents(folder.uri));
}
} else {
hasFullWorkspaceContents = false;
}
let init = Promise.resolve(vscode.workspace.findFiles(langPattern, exclude, hasFullWorkspaceContents ? undefined : size + 1).then(async uris => {
console.info(`FOUND ${uris.length} files for ${langPattern}`);
Expand Down

0 comments on commit 17ed3ad

Please sign in to comment.