本文整理汇总了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);
}