Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main(): void {
const manager = new SessionManager();
const session = new ClientSession({ manager, name: 'Example' });
const mimeService = new CodeMirrorMimeTypeService();
// Initialize the command registry with the bindings.
const commands = new CommandRegistry();
const useCapture = true;
// Setup the keydown listener for the document.
document.addEventListener(
'keydown',
event => {
commands.processKeydownEvent(event);
},
useCapture
);
// Create the cell widget with a default rendermime instance.
const rendermime = new RenderMimeRegistry({ initialFactories });
function main(): void {
const manager = new SessionManager();
const session = new ClientSession({ manager, name: 'Example' });
const mimeService = new CodeMirrorMimeTypeService();
// Initialize the command registry with the bindings.
const commands = new CommandRegistry();
const useCapture = true;
// Setup the keydown listener for the document.
document.addEventListener(
'keydown',
event => {
commands.processKeydownEvent(event);
},
useCapture
);
// Create the cell widget with a default rendermime instance.
const rendermime = new RenderMimeRegistry({ initialFactories });
describe('fileeditorcodewrapper', () => {
const factoryService = new CodeMirrorEditorFactory();
const modelFactory = new TextModelFactory();
const mimeTypeService = new CodeMirrorMimeTypeService();
let context: Context;
let manager: ServiceManager.IManager;
beforeAll(() => {
manager = new ServiceManager({ standby: 'never' });
return manager.ready;
});
describe('FileEditorCodeWrapper', () => {
let widget: FileEditorCodeWrapper;
beforeEach(() => {
const path = UUID.uuid4() + '.py';
context = new Context({ manager, factory: modelFactory, path });
widget = new FileEditorCodeWrapper({
factory: options => factoryService.newDocumentEditor(options),
describe('Debugger', () => {
const service = new DebuggerService();
const registry = new CommandRegistry();
const factoryService = new CodeMirrorEditorFactory();
const mimeTypeService = new CodeMirrorMimeTypeService();
let sidebar: TestSidebar;
beforeEach(() => {
sidebar = new TestSidebar({
service,
callstackCommands: {
registry,
continue: '',
terminate: '',
next: '',
stepIn: '',
stepOut: ''
},
editorServices: {
factoryService,
describe('fileeditorcodewrapper', () => {
const factoryService = new CodeMirrorEditorFactory();
const modelFactory = new TextModelFactory();
const mimeTypeService = new CodeMirrorMimeTypeService();
let context: Context;
let manager: ServiceManager.IManager;
beforeAll(() => {
manager = new ServiceManager({ standby: 'never' });
return manager.ready;
});
describe('FileEditorCodeWrapper', () => {
let widget: FileEditorCodeWrapper;
beforeEach(() => {
const path = UUID.uuid4() + '.py';
context = new Context({ manager, factory: modelFactory, path });
widget = new FileEditorCodeWrapper({
factory: options => factoryService.newDocumentEditor(options),
widget.disposed.connect((w: Widget) => {
let index = widgets.indexOf(w);
widgets.splice(index, 1);
});
}
};
let docRegistry = new DocumentRegistry();
let docManager = new DocumentManager({
registry: docRegistry,
manager,
opener
});
let editorServices = {
factoryService: new CodeMirrorEditorFactory(),
mimeTypeService: new CodeMirrorMimeTypeService()
};
let wFactory = new FileEditorFactory({
editorServices,
factoryOptions: {
name: 'Editor',
modelName: 'text',
fileTypes: ['*'],
defaultFor: ['*'],
preferKernel: false,
canStartKernel: true
}
});
docRegistry.addWidgetFactory(wFactory);
let commands = new CommandRegistry();
widget.disposed.connect((w: Widget) => {
let index = widgets.indexOf(w);
widgets.splice(index, 1);
});
}
};
let docRegistry = new DocumentRegistry();
let docManager = new DocumentManager({
registry: docRegistry,
manager,
opener
});
let editorServices = {
factoryService: new CodeMirrorEditorFactory(),
mimeTypeService: new CodeMirrorMimeTypeService()
};
let wFactory = new FileEditorFactory({
editorServices,
factoryOptions: {
name: 'Editor',
modelName: 'text',
fileTypes: ['*'],
defaultFor: ['*'],
preferKernel: false,
canStartKernel: true
}
});
docRegistry.addWidgetFactory(wFactory);
let commands = new CommandRegistry();