本文整理匯總了TypeScript中vs/editor/test/common/mocks/mockCodeEditor.mockCodeEditor函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript mockCodeEditor函數的具體用法?TypeScript mockCodeEditor怎麽用?TypeScript mockCodeEditor使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了mockCodeEditor函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setup
setup(function () {
contextKeys = new MockContextKeyService();
model = Model.createFromString('if\n $state\nfi');
editor = mockCodeEditor([], { model });
editor.setSelections([new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)]);
assert.equal(model.getEOL(), '\n');
});
示例2: setup
setup(() => {
reg = CodeActionProviderRegistry.register(languageIdentifier.language, {
provideCodeActions() {
return [{ id: 'test-command', title: 'test', arguments: [] }];
}
});
markerService = new MarkerService();
model = Model.createFromString('foobar foo bar\nfarboo far boo', undefined, languageIdentifier, uri);
editor = mockCodeEditor([], { model });
editor.setPosition({ lineNumber: 1, column: 1 });
});
示例3: setup
setup(function () {
model = Model.createFromString('function foo() {\n console.log(a);\n}');
editor = mockCodeEditor([], { model });
editor.setSelections([new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)]);
assert.equal(model.getEOL(), '\n');
});
示例4: setup
setup(() => {
markerService = new MarkerService();
editor = mockCodeEditor([], { model });
editor.setPosition({ lineNumber: 1, column: 1 });
});