mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 21:06:57 +00:00
Rename options
This commit is contained in:
parent
6f121cd3ba
commit
1a853daec4
5 changed files with 28 additions and 30 deletions
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -396,8 +396,8 @@ export interface ITextModelCreationOptions {
|
|||
trimAutoWhitespace: boolean;
|
||||
defaultEOL: DefaultEndOfLine;
|
||||
isForSimpleWidget: boolean;
|
||||
hugeFileSize: number;
|
||||
hugeFileNumLines: number;
|
||||
largeFileSize: number;
|
||||
largeFileLineCount: number;
|
||||
}
|
||||
|
||||
export interface ITextModelUpdateOptions {
|
||||
|
|
|
@ -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 = (
|
||||
|
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue