diff --git a/client/src/main.ts b/client/src/main.ts index a30e50b2..b3ba0399 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -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 | undefined = Math.max(0, vscode.workspace.getConfiguration('anycode').get('symbolIndexSize', 500)); + let size: number = Math.max(0, vscode.workspace.getConfiguration('anycode').get('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(); @@ -183,12 +183,7 @@ async function _startServer(extensionUri: vscode.Uri, supportedLanguages: Suppor hasFullWorkspaceContents = hasFullWorkspaceContents && (await remoteHubApi.hasWorkspaceContents(folder.uri)); } } - if (hasFullWorkspaceContents) { - size = undefined; - } else { - size += 1; - } - let init = Promise.resolve(vscode.workspace.findFiles(langPattern, exclude, size).then(async uris => { + let init = Promise.resolve(vscode.workspace.findFiles(langPattern, exclude, hasFullWorkspaceContents ? undefined : size + 1).then(async uris => { console.info(`FOUND ${uris.length} files for ${langPattern}`); const t1 = performance.now(); @@ -200,7 +195,7 @@ async function _startServer(extensionUri: vscode.Uri, supportedLanguages: Suppor "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } } */ - telemetry.sendTelemetryEvent('init', undefined, { numOfFiles: uris.length, indexSize: size ?? -1, duration: performance.now() - t1 }); + telemetry.sendTelemetryEvent('init', undefined, { numOfFiles: uris.length, indexSize: hasFullWorkspaceContents ? -1 : size, duration: performance.now() - t1 }); })); // stop on server-end diff --git a/package.json b/package.json index b630b717..108d838e 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "properties": { "anycode.symbolIndexSize": { "type": "number", - "default": 100, + "default": 500, "minimum": 0, "markdownDescription": "Size of the index that is used for features like symbol search and go to definition." },