mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 09:57:31 -06:00
Address some tsc issues
This commit is contained in:
+4
-2
@@ -26,6 +26,8 @@ import {Language} from '../types/languages.interfaces';
|
||||
import {CompilerFilters} from '../types/features/filters.interfaces';
|
||||
import {SiteSettings} from './settings';
|
||||
import {Theme} from './themes';
|
||||
import {PPOptions} from './panes/pp-view.interfaces';
|
||||
import {GccSelectedPass} from './panes/gccdump-view.interfaces';
|
||||
|
||||
// This list comes from executing
|
||||
// grep -rPo "eventHub\.(on|emit)\('.*'," static/ | cut -d "'" -f2 | sort | uniq
|
||||
@@ -76,7 +78,7 @@ export type Events = {
|
||||
flagsViewOpened: (compilerId: number) => void;
|
||||
gccDumpFiltersChanged: (compilerId: number, filters: CompilerFilters, recompile: boolean) => void;
|
||||
// TODO: pass type
|
||||
gccDumpPassSelected: (compilerId: number, pass: string, recompile: boolean) => void;
|
||||
gccDumpPassSelected: (compilerId: number, pass: GccSelectedPass, recompile: boolean) => void;
|
||||
gccDumpUIInit: (compilerId: number) => void;
|
||||
gccDumpViewClosed: (compilerId: number) => void;
|
||||
gccDumpViewOpened: (compilerId: number) => void;
|
||||
@@ -112,7 +114,7 @@ export type Events = {
|
||||
) => void;
|
||||
ppViewClosed: (compilerId: number) => void;
|
||||
ppViewOpened: (compilerId: number) => void;
|
||||
ppViewOptionsUpdated: (compilerId: number, options: string, recompile: boolean) => void;
|
||||
ppViewOptionsUpdated: (compilerId: number, options: PPOptions, recompile: boolean) => void;
|
||||
requestCompilation: (editorId: number, treeId: boolean | number) => void;
|
||||
requestMotd: () => void;
|
||||
requestSettings: () => void;
|
||||
|
||||
@@ -145,7 +145,14 @@ export class Ast extends MonacoPane<monaco.editor.IStandaloneCodeEditor, AstStat
|
||||
colEnd = hoverCode.source.to.col;
|
||||
}
|
||||
}
|
||||
this.eventHub.emit('editorLinkLine', this.compilerInfo.editorId, sourceLine, colBegin, colEnd, false);
|
||||
this.eventHub.emit(
|
||||
'editorLinkLine',
|
||||
this.compilerInfo.editorId as number,
|
||||
sourceLine,
|
||||
colBegin,
|
||||
colEnd,
|
||||
false
|
||||
);
|
||||
this.eventHub.emit(
|
||||
'panesLinkLine',
|
||||
this.compilerInfo.compilerId,
|
||||
|
||||
@@ -81,7 +81,7 @@ export class Flags extends MonacoPane<monaco.editor.IStandaloneCodeEditor, Flags
|
||||
// Once initialized, let everyone know what text we have.
|
||||
this.maybeEmitChange(false);
|
||||
});
|
||||
this.eventHub.on('initialised', this.maybeEmitChange.bind(this));
|
||||
this.eventHub.on('initialised', () => this.maybeEmitChange(false), this);
|
||||
|
||||
this.editor.getModel()?.onDidChangeContent(() => {
|
||||
this.debouncedEmitChange(false);
|
||||
|
||||
@@ -46,3 +46,9 @@ export interface GccDumpState extends GccDumpFilters {
|
||||
_editorid?: number;
|
||||
_treeid?: number;
|
||||
}
|
||||
|
||||
export type GccSelectedPass = {
|
||||
filename_suffix: string;
|
||||
name: string;
|
||||
command_prefix: string;
|
||||
};
|
||||
|
||||
@@ -91,7 +91,14 @@ export class Ir extends MonacoPane<monaco.editor.IStandaloneCodeEditor, IrState>
|
||||
const desiredLine = position.lineNumber - 1;
|
||||
const source = this.irCode[desiredLine].source;
|
||||
if (source !== null && source.file !== null) {
|
||||
this.eventHub.emit('editorLinkLine', this.compilerInfo.editorId, source.line, -1, -1, true);
|
||||
this.eventHub.emit(
|
||||
'editorLinkLine',
|
||||
this.compilerInfo.editorId as number,
|
||||
source.line,
|
||||
-1,
|
||||
-1,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -188,7 +195,7 @@ export class Ir extends MonacoPane<monaco.editor.IStandaloneCodeEditor, IrState>
|
||||
|
||||
this.eventHub.emit(
|
||||
'editorLinkLine',
|
||||
this.compilerInfo.editorId,
|
||||
this.compilerInfo.editorId as number,
|
||||
sourceLine,
|
||||
sourceColumnBegin,
|
||||
sourceColumnEnd,
|
||||
|
||||
@@ -25,3 +25,8 @@
|
||||
export interface PPViewState {
|
||||
ppOutput: any;
|
||||
}
|
||||
|
||||
export type PPOptions = {
|
||||
'filter-headers': boolean;
|
||||
'clang-format': boolean;
|
||||
};
|
||||
|
||||
@@ -89,7 +89,7 @@ export class ToolInputView extends MonacoPane<monaco.editor.IStandaloneCodeEdito
|
||||
// Once initialized, let everyone know what text we have.
|
||||
this.maybeEmitChange(false);
|
||||
});
|
||||
this.eventHub.on('initialised', this.maybeEmitChange, this);
|
||||
this.eventHub.on('initialised', () => this.maybeEmitChange(false), this);
|
||||
|
||||
this.editor.getModel()?.onDidChangeContent(() => {
|
||||
this.debouncedEmitChange();
|
||||
|
||||
Reference in New Issue
Block a user