提交 1cdf4aec 编写于 作者: A Alex Dima

Have the default be TextBufferType.LinesArray, add VSCODE_PIECE_TREE env

上级 1c32b21d
......@@ -37,15 +37,21 @@ import { LinesTextBufferBuilder } from 'vs/editor/common/model/linesTextBuffer/l
import { PieceTreeTextBufferBuilder } from 'vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder';
import { ChunksTextBufferBuilder } from 'vs/editor/common/model/chunksTextBuffer/chunksTextBufferBuilder';
export enum TextBufferType {
LinesArray,
PieceTree,
Chunks
}
// Here is the master switch for the text buffer implementation:
const USE_PIECE_TREE_IMPLEMENTATION = true;
const USE_CHUNKS_TEXT_BUFFER = false;
export const OPTIONS = {
TEXT_BUFFER_IMPLEMENTATION: TextBufferType.LinesArray
};
function createTextBufferBuilder() {
if (USE_PIECE_TREE_IMPLEMENTATION) {
if (OPTIONS.TEXT_BUFFER_IMPLEMENTATION === TextBufferType.PieceTree) {
return new PieceTreeTextBufferBuilder();
}
if (USE_CHUNKS_TEXT_BUFFER) {
if (OPTIONS.TEXT_BUFFER_IMPLEMENTATION === TextBufferType.Chunks) {
return new ChunksTextBufferBuilder();
}
return new LinesTextBufferBuilder();
......
......@@ -12,4 +12,11 @@ import './electron-browser/toggleMinimap';
import './electron-browser/toggleMultiCursorModifier';
import './electron-browser/toggleRenderControlCharacter';
import './electron-browser/toggleRenderWhitespace';
import './electron-browser/toggleWordWrap';
\ No newline at end of file
import './electron-browser/toggleWordWrap';
import { OPTIONS, TextBufferType } from 'vs/editor/common/model/textModel';
// Configure text buffer implementation
if (process.env['VSCODE_PIECE_TREE']) {
console.log(`Using TextBufferType.PieceTree (env variable VSCODE_PIECE_TREE)`);
OPTIONS.TEXT_BUFFER_IMPLEMENTATION = TextBufferType.PieceTree;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册