本文整理匯總了TypeScript中vs/editor/common/model/textModel.TextModel.getOptions方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TextModel.getOptions方法的具體用法?TypeScript TextModel.getOptions怎麽用?TypeScript TextModel.getOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/model/textModel.TextModel
的用法示例。
在下文中一共展示了TextModel.getOptions方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: withSplitLinesCollection
function withSplitLinesCollection(model: TextModel, wordWrap: 'on' | 'off' | 'wordWrapColumn' | 'bounded', wordWrapColumn: number, callback: (splitLinesCollection: SplitLinesCollection) => void): void {
let configuration = new TestConfiguration({
wordWrap: wordWrap,
wordWrapColumn: wordWrapColumn,
wrappingIndent: 'indent'
});
let factory = new CharacterHardWrappingLineMapperFactory(
configuration.editor.wrappingInfo.wordWrapBreakBeforeCharacters,
configuration.editor.wrappingInfo.wordWrapBreakAfterCharacters,
configuration.editor.wrappingInfo.wordWrapBreakObtrusiveCharacters
);
let linesCollection = new SplitLinesCollection(
model,
factory,
model.getOptions().tabSize,
configuration.editor.wrappingInfo.wrappingColumn,
configuration.editor.fontInfo.typicalFullwidthCharacterWidth / configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,
configuration.editor.wrappingInfo.wrappingIndent
);
callback(linesCollection);
configuration.dispose();
}
示例2: testGuessIndentation
function testGuessIndentation(defaultInsertSpaces:boolean, defaultTabSize:number, expectedInsertSpaces:boolean, expectedTabSize:number, text:string[], msg?:string): void {
var m = new TextModel([], TextModel.toRawText(text.join('\n'), {
tabSize: defaultTabSize,
insertSpaces: defaultInsertSpaces,
detectIndentation: true,
defaultEOL: DefaultEndOfLine.LF
}));
var r = m.getOptions();
m.dispose();
assert.equal(r.insertSpaces, expectedInsertSpaces, msg);
assert.equal(r.tabSize, expectedTabSize, msg);
}