本文整理匯總了TypeScript中vs/editor/common/model/model.Model.getDecorationOptions方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Model.getDecorationOptions方法的具體用法?TypeScript Model.getDecorationOptions怎麽用?TypeScript Model.getDecorationOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/model/model.Model
的用法示例。
在下文中一共展示了Model.getDecorationOptions方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('issue #4317: editor.setDecorations doesn\'t update the hover message', () => {
let model = new Model('Hello world!', Model.DEFAULT_CREATION_OPTIONS, null);
let ids = model.deltaDecorations([], [{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 100,
endColumn: 1
},
options: {
htmlMessage: [{
markdown: 'hello1'
}]
}
}]);
ids = model.deltaDecorations(ids, [{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 100,
endColumn: 1
},
options: {
htmlMessage: [{
markdown: 'hello2'
}]
}
}]);
let actualDecoration = model.getDecorationOptions(ids[0]);
assert.equal(actualDecoration.htmlMessage[0].markdown, 'hello2');
model.dispose();
});
示例2:
return ids.map((id) => {
return {
range: model.getDecorationRange(id),
id: model.getDecorationOptions(id).className
};
});