Skip to content

Commit

Permalink
Rename isTooLargeForHavingARichMode to isTooLargeForSyncing (#44897)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Apr 25, 2018
1 parent 3907d47 commit a4eedac
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/vs/editor/common/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,11 @@ export interface ITextModel {
tokenizeViewport(startLineNumber: number, endLineNumber: number): void;

/**
* Only basic mode supports allowed on this model because it is simply too large.
* (tokenization is allowed and other basic supports)
* This model is so large that it would not be a good idea to sync it over
* to web workers or other places.
* @internal
*/
isTooLargeForHavingARichMode(): boolean;
isTooLargeForSyncing(): boolean;

/**
* The file is so large, that even tokenization is disabled.
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/model/textModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ export class TextModel extends Disposable implements model.ITextModel {
return this._attachedEditorCount;
}

public isTooLargeForHavingARichMode(): boolean {
public isTooLargeForSyncing(): boolean {
return this._shouldSimplifyMode;
}

Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/services/modelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export interface IModelService {

export function shouldSynchronizeModel(model: ITextModel): boolean {
return (
!model.isTooLargeForHavingARichMode() && !model.isForSimpleWidget
!model.isTooLargeForSyncing() && !model.isForSimpleWidget
);
}
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/find/findController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
public getGlobalBufferTerm(): string {
if (this._editor.getConfiguration().contribInfo.find.globalFindClipboard
&& this._clipboardService
&& !this._editor.getModel().isTooLargeForHavingARichMode()
&& !this._editor.getModel().isTooLargeForSyncing()
) {
return this._clipboardService.readFindText();
}
Expand All @@ -357,7 +357,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
public setGlobalBufferTerm(text: string) {
if (this._editor.getConfiguration().contribInfo.find.globalFindClipboard
&& this._clipboardService
&& !this._editor.getModel().isTooLargeForHavingARichMode()
&& !this._editor.getModel().isTooLargeForSyncing()
) {
this._clipboardService.writeFindText(text);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/find/findModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class FindModelBoundToEditorModel {
if (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) {
let model = this._editor.getModel();

if (model.isTooLargeForHavingARichMode()) {
if (model.isTooLargeForSyncing()) {
this._startSearchingTimer.cancel();

this._startSearchingTimer.setIfNotSet(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ suite('MainThreadDocumentsAndEditors', () => {
this.timeout(1000 * 60); // increase timeout for this one test

const model = modelService.createModel(hugeModelString, null, null);
assert.ok(model.isTooLargeForHavingARichMode());
assert.ok(model.isTooLargeForSyncing());

assert.equal(deltas.length, 1);
const [delta] = deltas;
Expand Down

0 comments on commit a4eedac

Please sign in to comment.