Skip to content

Commit b93df1c

Browse files
committed
exclude common folders from list of large folders, microsoft#4256
1 parent c92c3cf commit b93df1c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

extensions/typescript/src/utils/projectStatus.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ export function create(client: ITypescriptServiceClient, memento: vscode.Memento
105105
let largeRoots = computeLargeRoots(configFileName, fileNames).map(f => `'/${f}/'`).join(', ');
106106

107107
currentHint = {
108-
message: localize('hintExclude', "For better performance exclude folders with many files, like: {0}...", largeRoots),
108+
message: largeRoots.length > 0
109+
? localize('hintExclude', "For better performance exclude folders with many files, like: {0}", largeRoots)
110+
: localize('hintExclude.generic', "For better performance exclude folders with many files."),
109111
options: [{
110112
title: localize('open', "Configure Excludes"),
111113
execute: () => {
@@ -120,7 +122,7 @@ export function create(client: ITypescriptServiceClient, memento: vscode.Memento
120122
};
121123
item.tooltip = currentHint.message;
122124
item.text = localize('large.label', "Configure Excludes");
123-
item.tooltip = localize('large.tooltip', "Too many files in a project might result in bad performance. Exclude folders with many files, like: {0}...", largeRoots);
125+
item.tooltip = localize('hintExclude.tooltip', "For better performance exclude folders with many files.");
124126
item.color = '#0CFF00';
125127
item.show();
126128
client.logTelemetry('js.hintProjectExcludes');
@@ -160,7 +162,10 @@ function computeLargeRoots(configFileName:string, fileNames: string[]): string[]
160162
for (let key in roots) {
161163
data.push({ root: key, count: roots[key] });
162164
}
163-
data.sort((a, b) => b.count - a.count);
165+
166+
data
167+
.sort((a, b) => b.count - a.count)
168+
.filter(s => s.root === 'src' || s.root === 'test' || s.root === 'tests');
164169

165170
let result: string[] = [];
166171
let sum = 0;

0 commit comments

Comments
 (0)