Skip to content

Commit e7b9c03

Browse files
committed
Rename diffEditor.maximumComputationTime to diffEditor.maxComputationTime
1 parent 0a55dcf commit e7b9c03

10 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/vs/editor/browser/widget/diffEditorWidget.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
203203
private _originalIsEditable: boolean;
204204

205205
private _renderSideBySide: boolean;
206-
private _maximumComputationTime: number;
206+
private _maxComputationTime: number;
207207
private _renderIndicators: boolean;
208208
private _enableSplitViewResizing: boolean;
209209
private _strategy!: IDiffEditorWidgetStyle;
@@ -253,10 +253,10 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
253253
this._renderSideBySide = options.renderSideBySide;
254254
}
255255

256-
// maximumComputationTime
257-
this._maximumComputationTime = 5000;
258-
if (typeof options.maximumComputationTime !== 'undefined') {
259-
this._maximumComputationTime = options.maximumComputationTime;
256+
// maxComputationTime
257+
this._maxComputationTime = 5000;
258+
if (typeof options.maxComputationTime !== 'undefined') {
259+
this._maxComputationTime = options.maxComputationTime;
260260
}
261261

262262
// ignoreTrimWhitespace
@@ -630,8 +630,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
630630
}
631631
}
632632

633-
if (typeof newOptions.maximumComputationTime !== 'undefined') {
634-
this._maximumComputationTime = newOptions.maximumComputationTime;
633+
if (typeof newOptions.maxComputationTime !== 'undefined') {
634+
this._maxComputationTime = newOptions.maxComputationTime;
635635
if (this._isVisible) {
636636
this._beginUpdateDecorationsSoon();
637637
}
@@ -982,7 +982,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
982982
return;
983983
}
984984

985-
this._editorWorkerService.computeDiff(currentOriginalModel.uri, currentModifiedModel.uri, this._ignoreTrimWhitespace, this._maximumComputationTime).then((result) => {
985+
this._editorWorkerService.computeDiff(currentOriginalModel.uri, currentModifiedModel.uri, this._ignoreTrimWhitespace, this._maxComputationTime).then((result) => {
986986
if (currentToken === this._diffComputationToken
987987
&& currentOriginalModel === this.originalEditor.getModel()
988988
&& currentModifiedModel === this.modifiedEditor.getModel()

src/vs/editor/common/config/commonEditorConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,10 @@ const editorConfiguration: IConfigurationNode = {
462462
default: 750,
463463
description: nls.localize('codeActionsOnSaveTimeout', "Timeout in milliseconds after which the code actions that are run on save are cancelled.")
464464
},
465-
'diffEditor.maximumComputationTime': {
465+
'diffEditor.maxComputationTime': {
466466
type: 'number',
467467
default: 5000,
468-
description: nls.localize('maximumComputationTime', "Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")
468+
description: nls.localize('maxComputationTime', "Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")
469469
},
470470
'diffEditor.renderSideBySide': {
471471
type: 'boolean',

src/vs/editor/common/config/editorOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ export interface IDiffEditorOptions extends IEditorOptions {
542542
* Timeout in milliseconds after which diff computation is cancelled.
543543
* Defaults to 5000.
544544
*/
545-
maximumComputationTime?: number;
545+
maxComputationTime?: number;
546546
/**
547547
* Compute the diff by ignoring leading/trailing whitespace
548548
* Defaults to true.

src/vs/editor/common/diff/diffComputer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export interface IDiffComputerOpts {
279279
shouldPostProcessCharChanges: boolean;
280280
shouldIgnoreTrimWhitespace: boolean;
281281
shouldMakePrettyDiff: boolean;
282-
maximumComputationTime: number;
282+
maxComputationTime: number;
283283
}
284284

285285
export class DiffComputer {
@@ -305,8 +305,8 @@ export class DiffComputer {
305305
this.original = new LineSequence(originalLines);
306306
this.modified = new LineSequence(modifiedLines);
307307

308-
this.continueLineDiff = createContinueProcessingPredicate(opts.maximumComputationTime);
309-
this.continueCharDiff = createContinueProcessingPredicate(opts.maximumComputationTime === 0 ? 0 : Math.min(opts.maximumComputationTime, 5000)); // never run after 5s for character changes...
308+
this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);
309+
this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...
310310
}
311311

312312
public computeDiff(): IDiffComputerResult {

src/vs/editor/common/services/editorSimpleWorker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable {
377377

378378
// ---- BEGIN diff --------------------------------------------------------------------------
379379

380-
public async computeDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean, maximumComputationTime: number): Promise<IDiffComputationResult | null> {
380+
public async computeDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null> {
381381
const original = this._getModel(originalUrl);
382382
const modified = this._getModel(modifiedUrl);
383383
if (!original || !modified) {
@@ -391,7 +391,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable {
391391
shouldPostProcessCharChanges: true,
392392
shouldIgnoreTrimWhitespace: ignoreTrimWhitespace,
393393
shouldMakePrettyDiff: true,
394-
maximumComputationTime: maximumComputationTime
394+
maxComputationTime: maxComputationTime
395395
});
396396

397397
const diffResult = diffComputer.computeDiff();
@@ -433,7 +433,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable {
433433
shouldPostProcessCharChanges: false,
434434
shouldIgnoreTrimWhitespace: ignoreTrimWhitespace,
435435
shouldMakePrettyDiff: true,
436-
maximumComputationTime: 1000
436+
maxComputationTime: 1000
437437
});
438438
return diffComputer.computeDiff().changes;
439439
}

src/vs/editor/common/services/editorWorkerService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface IEditorWorkerService {
2222
_serviceBrand: undefined;
2323

2424
canComputeDiff(original: URI, modified: URI): boolean;
25-
computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maximumComputationTime: number): Promise<IDiffComputationResult | null>;
25+
computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null>;
2626

2727
canComputeDirtyDiff(original: URI, modified: URI): boolean;
2828
computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): Promise<IChange[] | null>;

src/vs/editor/common/services/editorWorkerServiceImpl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker
8282
return (canSyncModel(this._modelService, original) && canSyncModel(this._modelService, modified));
8383
}
8484

85-
public computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maximumComputationTime: number): Promise<IDiffComputationResult | null> {
86-
return this._workerManager.withWorker().then(client => client.computeDiff(original, modified, ignoreTrimWhitespace, maximumComputationTime));
85+
public computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null> {
86+
return this._workerManager.withWorker().then(client => client.computeDiff(original, modified, ignoreTrimWhitespace, maxComputationTime));
8787
}
8888

8989
public canComputeDirtyDiff(original: URI, modified: URI): boolean {
@@ -409,9 +409,9 @@ export class EditorWorkerClient extends Disposable {
409409
});
410410
}
411411

412-
public computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maximumComputationTime: number): Promise<IDiffComputationResult | null> {
412+
public computeDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean, maxComputationTime: number): Promise<IDiffComputationResult | null> {
413413
return this._withSyncedResources([original, modified]).then(proxy => {
414-
return proxy.computeDiff(original.toString(), modified.toString(), ignoreTrimWhitespace, maximumComputationTime);
414+
return proxy.computeDiff(original.toString(), modified.toString(), ignoreTrimWhitespace, maxComputationTime);
415415
});
416416
}
417417

src/vs/editor/test/common/diff/diffComputer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function assertDiff(originalLines: string[], modifiedLines: string[], expectedCh
5656
shouldPostProcessCharChanges,
5757
shouldIgnoreTrimWhitespace,
5858
shouldMakePrettyDiff: true,
59-
maximumComputationTime: 0
59+
maxComputationTime: 0
6060
});
6161
let changes = diffComputer.computeDiff().changes;
6262

src/vs/monaco.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2945,7 +2945,7 @@ declare namespace monaco.editor {
29452945
* Timeout in milliseconds after which diff computation is cancelled.
29462946
* Defaults to 5000.
29472947
*/
2948-
maximumComputationTime?: number;
2948+
maxComputationTime?: number;
29492949
/**
29502950
* Compute the diff by ignoring leading/trailing whitespace
29512951
* Defaults to true.

src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class DiffEditorHelperContribution extends Disposable implements IEditorContribu
8888
this._configurationService.updateValue('diffEditor.ignoreTrimWhitespace', false, ConfigurationTarget.USER);
8989
}
9090
if (this._state === WidgetState.HintTimeout) {
91-
this._configurationService.updateValue('diffEditor.maximumComputationTime', 0, ConfigurationTarget.USER);
91+
this._configurationService.updateValue('diffEditor.maxComputationTime', 0, ConfigurationTarget.USER);
9292
}
9393
}
9494

0 commit comments

Comments
 (0)