提交 2e108cec 编写于 作者: R Rob Lourens

Fix #70045 by reverting some of #67269

上级 1f64c126
......@@ -67,7 +67,7 @@ export function collectLaunchConfigs(folder: string): Promise<WorkspaceStatItem[
});
}
export async function collectWorkspaceStats(folder: string, filter: string[]): Promise<WorkspaceStats> {
export function collectWorkspaceStats(folder: string, filter: string[]): Promise<WorkspaceStats> {
const configFilePatterns = [
{ 'tag': 'grunt.js', 'pattern': /^gruntfile\.js$/i },
{ 'tag': 'gulp.js', 'pattern': /^gulpfile\.js$/i },
......
......@@ -20,7 +20,6 @@ import { hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspa
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { joinPath } from 'vs/base/common/resources';
import { collectWorkspaceStats, WorkspaceStats as WorkspaceStatsType } from 'vs/base/node/stats';
const SshProtocolMatcher = /^([^@:]+@)?([^:]+):/;
const SshUrlMatcher = /^([^@:]+@)?([^:]+):(.+)$/;
......@@ -226,15 +225,10 @@ export class WorkspaceStats implements IWorkbenchContribution {
private report(): void {
// Workspace Tags
// Workspace Stats
this.resolveWorkspaceTags(this.windowService.getConfiguration(), rootFiles => this.handleWorkspaceFiles(rootFiles))
.then(tags => this.reportWorkspaceTags(tags), error => onUnexpectedError(error));
// Workspace file types, config files, and launch configs
this.getWorkspaceMetadata().then(stats => {
this.reportWorkspaceMetadata(stats);
});
// Cloud Stats
this.reportCloudStats();
......@@ -741,39 +735,4 @@ export class WorkspaceStats implements IWorkbenchContribution {
this.telemetryService.publicLog('resolveProxy.stats', { type });
}).then(undefined, onUnexpectedError);
}
/* __GDPR__
"workspace.metadata" : {
"fileTypes" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"configTypes" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"launchConfigs" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
}
*/
private reportWorkspaceMetadata(stats: WorkspaceStatsType[]): void {
for (let stat of stats) { // one event for each root folder in the workspace
this.telemetryService.publicLog('workspace.metadata', {
'fileTypes': stat.fileTypes,
'configTypes': stat.configFiles,
'launchConfigs': stat.launchConfigFiles
});
}
}
private getWorkspaceMetadata(): Promise<WorkspaceStatsType[]> {
const workspaceStatPromises: Promise<WorkspaceStatsType>[] = [];
const workspace = this.contextService.getWorkspace();
workspace.folders.forEach(folder => {
const folderUri = URI.revive(folder.uri);
if (folderUri.scheme === 'file') {
const folder = folderUri.fsPath;
workspaceStatPromises.push(collectWorkspaceStats(folder, ['node_modules', '.git']).then(async stats => {
return stats;
}));
}
});
return Promise.all(workspaceStatPromises).then((stats) => {
return stats;
});
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册