Skip to content

Commit

Permalink
Expose TextModel.isTooLargeForTokenization() (#30180)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Jul 6, 2017
1 parent 1401c30 commit c95d90d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/vs/editor/common/editorCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,12 @@ export interface ITextModel {
*/
isTooLargeForHavingARichMode(): boolean;

/**
* The file is so large, that even tokenization is disabled.
* @internal
*/
isTooLargeForTokenization(): boolean;

/**
* Search the model.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
Expand Down
7 changes: 5 additions & 2 deletions src/vs/editor/common/model/textModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class TextModel implements editorCommon.ITextModel {
protected _mightContainRTL: boolean;
protected _mightContainNonBasicASCII: boolean;

private _shouldSimplifyMode: boolean;
private readonly _shouldSimplifyMode: boolean;
protected readonly _isTooLargeForTokenization: boolean;

constructor(rawTextSource: IRawTextSource, creationOptions: editorCommon.ITextModelCreationOptions) {
Expand Down Expand Up @@ -131,10 +131,13 @@ export class TextModel implements editorCommon.ITextModel {
}

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

public isTooLargeForTokenization(): boolean {
return this._isTooLargeForTokenization;
}

public getOptions(): editorCommon.TextModelResolvedOptions {
this._assertNotDisposed();
return this._options;
Expand Down

0 comments on commit c95d90d

Please sign in to comment.