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

Method constructor

static/panes/tool.ts:86–115  ·  view source on GitHub ↗
(hub: Hub, container: Container, state: ToolState & MonacoPaneState)

Source from the content-addressed store, hash-verified

84 options: Toggles;
85
86 constructor(hub: Hub, container: Container, state: ToolState & MonacoPaneState) {
87 // canonicalize state
88 if ((state as any).compiler) state.id = (state as any).compiler;
89 if ((state as any).editor) state.editorid = (state as any).editor;
90 if ((state as any).tree) state.treeid = (state as any).tree;
91 super(hub, container, state);
92
93 this.toolId = state.toolId;
94 this.compilerService = hub.compilerService;
95
96 this.monacoStdin = state.monacoStdin || false;
97 this.monacoEditorOpen = state.monacoEditorOpen || false;
98 this.monacoEditorHasBeenAutoOpened = state.monacoEditorHasBeenAutoOpened || false;
99 this.normalAnsiToHtml = makeAnsiToHtml();
100
101 this.createToolInputView = () =>
102 Components.getToolInputViewWith(this.compilerInfo.compilerId, this.toolId, this.toolName);
103
104 this.options = new Toggles(this.domRoot.find('.options'), state as any as Record<string, boolean>);
105 this.options.on('change', this.onOptionsChange.bind(this));
106
107 this.initArgs(state);
108
109 this.onOptionsChange();
110
111 this.updateTitle();
112
113 this.eventHub.emit('toolOpened', this.compilerInfo.compilerId, this.getCurrentState());
114 this.eventHub.emit('requestSettings');
115 }
116
117 override getInitialHTML() {
118 return $('#tool-output').html();

Callers

nothing calls this directly

Calls 8

initArgsMethod · 0.95
onOptionsChangeMethod · 0.95
getCurrentStateMethod · 0.95
findMethod · 0.80
makeAnsiToHtmlFunction · 0.70
onMethod · 0.45
updateTitleMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected