diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index 6ea7f0c2c28..3c463fe6c46 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -668,15 +668,15 @@ const editorConfiguration: IConfigurationNode = { 'default': true, 'description': nls.localize('ignoreTrimWhitespace', "Controls if the diff editor shows changes in leading or trailing whitespace as diffs") }, - 'editor.hugeFileSize': { + 'editor.largeFileSize': { 'type': 'number', - 'default': EDITOR_MODEL_DEFAULTS.hugeFileSize, - 'description': nls.localize('hugeFileSize', "Controls file size threshold in bytes beyond which special optimization rules are applied") + 'default': EDITOR_MODEL_DEFAULTS.largeFileSize, + 'description': nls.localize('largeFileSize', "Controls file size threshold in bytes beyond which special optimization rules are applied") }, - 'editor.hugeFileNumLines': { + 'editor.largeFileLineCount': { 'type': 'number', - 'default': EDITOR_MODEL_DEFAULTS.hugeFileNumLines, - 'description': nls.localize('hugeFileNumLines', "Controls file size threshold in terms of line count beyond which special optimization rules are applied") + 'default': EDITOR_MODEL_DEFAULTS.largeFileLineCount, + 'description': nls.localize('largeFileLineCount', "Controls file size threshold in terms of line count beyond which special optimization rules are applied") }, 'diffEditor.renderIndicators': { 'type': 'boolean', diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 6bac3b3fa5d..48d76961005 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -2205,8 +2205,8 @@ export const EDITOR_MODEL_DEFAULTS = { insertSpaces: true, detectIndentation: true, trimAutoWhitespace: true, - hugeFileSize: 20 * 1024 * 1024, // 20 MB - hugeFileNumLines: 300 * 1000 // 300K lines + largeFileSize: 20 * 1024 * 1024, // 20 MB + largeFileLineCount: 300 * 1000 // 300K lines }; /** diff --git a/src/vs/editor/common/model.ts b/src/vs/editor/common/model.ts index a9345fa3471..b8c7a186cae 100644 --- a/src/vs/editor/common/model.ts +++ b/src/vs/editor/common/model.ts @@ -396,8 +396,8 @@ export interface ITextModelCreationOptions { trimAutoWhitespace: boolean; defaultEOL: DefaultEndOfLine; isForSimpleWidget: boolean; - hugeFileSize: number; - hugeFileNumLines: number; + largeFileSize: number; + largeFileLineCount: number; } export interface ITextModelUpdateOptions { diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 55bdf285014..53d6bc2df0e 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -155,8 +155,6 @@ class TextModelSnapshot implements ITextSnapshot { export class TextModel extends Disposable implements model.ITextModel { private static readonly MODEL_SYNC_LIMIT = 50 * 1024 * 1024; // 50 MB - //private static readonly MODEL_TOKENIZATION_LIMIT = 20 * 1024 * 1024; // 20 MB - //private static readonly MANY_MANY_LINES = 300 * 1000; // 300K lines public static DEFAULT_CREATION_OPTIONS: model.ITextModelCreationOptions = { isForSimpleWidget: false, @@ -165,8 +163,8 @@ export class TextModel extends Disposable implements model.ITextModel { detectIndentation: false, defaultEOL: model.DefaultEndOfLine.LF, trimAutoWhitespace: EDITOR_MODEL_DEFAULTS.trimAutoWhitespace, - hugeFileSize: EDITOR_MODEL_DEFAULTS.hugeFileSize, - hugeFileNumLines: EDITOR_MODEL_DEFAULTS.hugeFileNumLines, + largeFileSize: EDITOR_MODEL_DEFAULTS.largeFileSize, + largeFileLineCount: EDITOR_MODEL_DEFAULTS.largeFileLineCount, }; public static createFromString(text: string, options: model.ITextModelCreationOptions = TextModel.DEFAULT_CREATION_OPTIONS, languageIdentifier: LanguageIdentifier = null, uri: URI = null): TextModel { @@ -291,8 +289,8 @@ export class TextModel extends Disposable implements model.ITextModel { // If a model is too large at construction time, it will never get tokenized, // under no circumstances. this._isTooLargeForTokenization = ( - (bufferTextLength > creationOptions.hugeFileSize) - || (bufferLineCount > creationOptions.hugeFileNumLines) + (bufferTextLength > creationOptions.largeFileSize) + || (bufferLineCount > creationOptions.largeFileLineCount) ); this._shouldSimplifyMode = ( diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index fc5554c392e..b189ac8390c 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -197,8 +197,8 @@ interface IRawConfig { insertSpaces?: any; detectIndentation?: any; trimAutoWhitespace?: any; - hugeFileSize?: any; - hugeFileNumLines?: any; + largeFileSize?: any; + largeFileLineCount?: any; }; } @@ -277,19 +277,19 @@ export class ModelServiceImpl implements IModelService { detectIndentation = (config.editor.detectIndentation === 'false' ? false : Boolean(config.editor.detectIndentation)); } - let hugeFileSize = EDITOR_MODEL_DEFAULTS.hugeFileSize; - if (config.editor && typeof config.editor.hugeFileSize !== 'undefined') { - let parsedHugeFileSize = parseInt(config.editor.hugeFileSize, 10); - if (!isNaN(parsedHugeFileSize)) { - hugeFileSize = parsedHugeFileSize; + let largeFileSize = EDITOR_MODEL_DEFAULTS.largeFileSize; + if (config.editor && typeof config.editor.largeFileSize !== 'undefined') { + let parsedlargeFileSize = parseInt(config.editor.largeFileSize, 10); + if (!isNaN(parsedlargeFileSize)) { + largeFileSize = parsedlargeFileSize; } } - let hugeFileNumLines = EDITOR_MODEL_DEFAULTS.hugeFileNumLines; - if (config.editor && typeof config.editor.hugeFileNumLines !== 'undefined') { - let parsedHugeFileNumLines = parseInt(config.editor.hugeFileNumLines, 10); - if (!isNaN(parsedHugeFileNumLines)) { - hugeFileNumLines = parsedHugeFileNumLines; + let largeFileLineCount = EDITOR_MODEL_DEFAULTS.largeFileLineCount; + if (config.editor && typeof config.editor.largeFileLineCount !== 'undefined') { + let parsedlargeFileLineCount = parseInt(config.editor.largeFileLineCount, 10); + if (!isNaN(parsedlargeFileLineCount)) { + largeFileLineCount = parsedlargeFileLineCount; } } @@ -300,8 +300,8 @@ export class ModelServiceImpl implements IModelService { detectIndentation: detectIndentation, defaultEOL: newDefaultEOL, trimAutoWhitespace: trimAutoWhitespace, - hugeFileSize: hugeFileSize, - hugeFileNumLines: hugeFileNumLines + largeFileSize: largeFileSize, + largeFileLineCount: largeFileLineCount }; }