@@ -35,7 +35,7 @@ import { Viewlet } from 'vs/workbench/browser/viewlet';
35
35
import { Match , FileMatch , SearchModel , FileMatchOrMatch , IChangeEvent , ISearchWorkbenchService } from 'vs/workbench/parts/search/common/searchModel' ;
36
36
import { QueryBuilder } from 'vs/workbench/parts/search/common/searchQuery' ;
37
37
import { MessageType , InputBox } from 'vs/base/browser/ui/inputbox/inputBox' ;
38
- import { getExcludes , ISearchProgressItem , ISearchComplete , ISearchQuery , IQueryOptions , ISearchConfiguration } from 'vs/platform/search/common/search' ;
38
+ import { getExcludes , ISearchComplete , ISearchQuery , IQueryOptions , ISearchConfiguration } from 'vs/platform/search/common/search' ;
39
39
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService' ;
40
40
import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
41
41
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
@@ -988,10 +988,7 @@ export class SearchViewlet extends Viewlet {
988
988
private onQueryTriggered ( query : ISearchQuery , excludePattern : string , includePattern : string ) : void {
989
989
this . viewModel . cancelSearch ( ) ;
990
990
991
- // Progress total is 100.0% for more progress bar granularity
992
- let progressTotal = 1000 ;
993
- let progressRunner = this . progressService . show ( progressTotal ) ;
994
- let progressWorked = 0 ;
991
+ let progressRunner = this . progressService . show ( /*infinite=*/ true ) ;
995
992
996
993
this . loading = true ;
997
994
this . searchWidget . searchInput . clearMessage ( ) ;
@@ -1015,14 +1012,7 @@ export class SearchViewlet extends Viewlet {
1015
1012
let isDone = false ;
1016
1013
let onComplete = ( completed ?: ISearchComplete ) => {
1017
1014
isDone = true ;
1018
-
1019
- // Complete up to 100% as needed
1020
- if ( completed ) {
1021
- progressRunner . worked ( progressTotal - progressWorked ) ;
1022
- setTimeout ( ( ) => progressRunner . done ( ) , 200 ) ;
1023
- } else {
1024
- progressRunner . done ( ) ;
1025
- }
1015
+ progressRunner . done ( ) ;
1026
1016
1027
1017
this . onSearchResultsChanged ( ) . then ( ( ) => autoExpand ( true ) ) ;
1028
1018
this . viewModel . replaceString = this . searchWidget . getReplaceValue ( ) ;
@@ -1126,18 +1116,7 @@ export class SearchViewlet extends Viewlet {
1126
1116
}
1127
1117
} ;
1128
1118
1129
- let total : number = 0 ;
1130
- let worked : number = 0 ;
1131
1119
let visibleMatches = 0 ;
1132
- let onProgress = ( p : ISearchProgressItem ) => {
1133
- // Progress
1134
- if ( p . total ) {
1135
- total = p . total ;
1136
- }
1137
- if ( p . worked ) {
1138
- worked = p . worked ;
1139
- }
1140
- } ;
1141
1120
1142
1121
// Handle UI updates in an interval to show frequent progress and results
1143
1122
let uiRefreshHandle = setInterval ( ( ) => {
@@ -1146,28 +1125,6 @@ export class SearchViewlet extends Viewlet {
1146
1125
return ;
1147
1126
}
1148
1127
1149
- // Progress bar update
1150
- let fakeProgress = true ;
1151
- if ( total > 0 && worked > 0 ) {
1152
- let ratio = Math . round ( ( worked / total ) * progressTotal ) ;
1153
- if ( ratio > progressWorked ) { // never show less progress than what we have already
1154
- progressRunner . worked ( ratio - progressWorked ) ;
1155
- progressWorked = ratio ;
1156
- fakeProgress = false ;
1157
- }
1158
- }
1159
-
1160
- // Fake progress up to 90%, or when actual progress beats it
1161
- const fakeMax = 900 ;
1162
- const fakeMultiplier = 12 ;
1163
- if ( fakeProgress && progressWorked < fakeMax ) {
1164
- // Linearly decrease the rate of fake progress.
1165
- // 1 is the smallest allowed amount of progress.
1166
- const fakeAmt = Math . round ( ( fakeMax - progressWorked ) / fakeMax * fakeMultiplier ) || 1 ;
1167
- progressWorked += fakeAmt ;
1168
- progressRunner . worked ( fakeAmt ) ;
1169
- }
1170
-
1171
1128
// Search result tree update
1172
1129
const fileCount = this . viewModel . searchResult . fileCount ( ) ;
1173
1130
if ( visibleMatches !== fileCount ) {
@@ -1188,7 +1145,7 @@ export class SearchViewlet extends Viewlet {
1188
1145
1189
1146
this . searchWidget . setReplaceAllActionState ( false ) ;
1190
1147
// this.replaceService.disposeAllReplacePreviews();
1191
- this . viewModel . search ( query ) . done ( onComplete , onError , onProgress ) ;
1148
+ this . viewModel . search ( query ) . done ( onComplete , onError ) ;
1192
1149
}
1193
1150
1194
1151
private updateSearchResultCount ( ) : void {
0 commit comments