Skip to content

Commit

Permalink
Fix type of tool id (#4470)
Browse files Browse the repository at this point in the history
Observed through the debugger it seems the tool id is a `string`, which leads to all sorts of downstream complaints comparing strings to ints when converting tools.js to ts (see #4166)
  • Loading branch information
mattgodbolt committed Dec 20, 2022
1 parent d0577c6 commit 8159c55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions static/event-map.ts
Expand Up @@ -151,13 +151,13 @@ export type EventMap = {
// TODO: There are no emitters for this event
selectLine: (editorId: number, lineNumber: number) => void;
settingsChange: (newSettings: SiteSettings) => void;
setToolInput: (compilerId: number, toolId: number, string: string) => void;
setToolInput: (compilerId: number, toolId: string, string: string) => void;
shown: () => void;
themeChange: (newTheme: Theme | null) => void;
toolClosed: (compilerId: number, toolState: unknown) => void;
toolInputChange: (compilerId: number, toolId: number, input: string) => void;
toolInputViewClosed: (compilerId: number, toolId: number, input: string) => void;
toolInputViewCloseRequest: (compilerId: number, toolId: number) => void;
toolInputChange: (compilerId: number, toolId: string, input: string) => void;
toolInputViewClosed: (compilerId: number, toolId: string, input: string) => void;
toolInputViewCloseRequest: (compilerId: number, toolId: string) => void;
toolOpened: (compilerId: number, toolState: unknown) => void;
toolSettingsChange: (compilerId: number) => void;
treeClose: (treeId: number) => void;
Expand Down
2 changes: 1 addition & 1 deletion static/panes/tool-input-view.interfaces.ts
Expand Up @@ -23,6 +23,6 @@
// POSSIBILITY OF SUCH DAMAGE.

export interface ToolInputViewState {
toolId: number;
toolId: string;
toolName: string;
}
3 changes: 1 addition & 2 deletions static/panes/tool-input-view.ts
Expand Up @@ -32,10 +32,9 @@ import {Container} from 'golden-layout';
import {MonacoPaneState} from './pane.interfaces';
import {Hub} from '../hub';
import {ToolInputViewState} from './tool-input-view.interfaces';
import {Settings} from '../settings';

export class ToolInputView extends MonacoPane<monaco.editor.IStandaloneCodeEditor, ToolInputViewState> {
_toolId: number;
_toolId: string;
_toolName: string;
shouldSetSelectionInitially: boolean;
debouncedEmitChange: (() => void) & _.Cancelable;
Expand Down

0 comments on commit 8159c55

Please sign in to comment.