MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / codeEditorFactory

Method codeEditorFactory

static/hub.ts:452–463  ·  view source on GitHub ↗
(container: GoldenLayout.Container, state: InferComponentState<Editor>)

Source from the content-addressed store, hash-verified

450 // Component Factories
451
452 private codeEditorFactory(container: GoldenLayout.Container, state: InferComponentState<Editor>): Editor {
453 // Ensure editors are closable: some older versions had 'isClosable' false.
454 // NB there doesn't seem to be a better way to do this than reach into the config and rely on the fact nothing
455 // has used it yet.
456 container.parent.config.isClosable = true;
457 _.defer(() => {
458 this.updateCloseButtons(container);
459 });
460 const editor = new Editor(this, state, container);
461 this.editors.push(editor);
462 return editor;
463 }
464
465 private treeFactory(container: GoldenLayout.Container, state: TreeState): Tree {
466 const tree = new Tree(this, container, state);

Callers 1

constructorMethod · 0.95

Calls 2

updateCloseButtonsMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected