@@ -15,7 +15,8 @@ import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configur
1515
1616const enum WidgetState {
1717 Hidden ,
18- HintWhitespace
18+ HintWhitespace ,
19+ HintTimeout
1920}
2021
2122class DiffEditorHelperContribution extends Disposable implements IEditorContribution {
@@ -47,6 +48,9 @@ class DiffEditorHelperContribution extends Disposable implements IEditorContribu
4748 if ( this . _diffEditor . ignoreTrimWhitespace && diffComputationResult . changes . length === 0 && ! diffComputationResult . identical ) {
4849 return WidgetState . HintWhitespace ;
4950 }
51+ if ( diffComputationResult . quitEarly ) {
52+ return WidgetState . HintTimeout ;
53+ }
5054 return WidgetState . Hidden ;
5155 }
5256
@@ -71,12 +75,21 @@ class DiffEditorHelperContribution extends Disposable implements IEditorContribu
7175 this . _helperWidgetListener = this . _helperWidget . onClick ( ( ) => this . _onDidClickHelperWidget ( ) ) ;
7276 this . _helperWidget . render ( ) ;
7377 }
78+
79+ if ( this . _state === WidgetState . HintTimeout ) {
80+ this . _helperWidget = this . _instantiationService . createInstance ( FloatingClickWidget , this . _diffEditor . getModifiedEditor ( ) , nls . localize ( 'hintTimeout' , "Remove diff computation timeout" ) , null ) ;
81+ this . _helperWidgetListener = this . _helperWidget . onClick ( ( ) => this . _onDidClickHelperWidget ( ) ) ;
82+ this . _helperWidget . render ( ) ;
83+ }
7484 }
7585
7686 private _onDidClickHelperWidget ( ) : void {
7787 if ( this . _state === WidgetState . HintWhitespace ) {
7888 this . _configurationService . updateValue ( 'diffEditor.ignoreTrimWhitespace' , false , ConfigurationTarget . USER ) ;
7989 }
90+ if ( this . _state === WidgetState . HintTimeout ) {
91+ this . _configurationService . updateValue ( 'diffEditor.maximumComputationTime' , 0 , ConfigurationTarget . USER ) ;
92+ }
8093 }
8194
8295 dispose ( ) : void {
0 commit comments