Remove hardcoded language ID
This commit is contained in:
parent
ee569ada7f
commit
3f2e13af74
@ -136,7 +136,7 @@ export const Mainframe = <RS extends {}>({ langName, provider }: Props<RS>) => {
|
|||||||
renderEditor={() => (
|
renderEditor={() => (
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
ref={codeEditorRef}
|
ref={codeEditorRef}
|
||||||
languageId="brainfuck"
|
languageId={langName}
|
||||||
readOnly={execController.state === "processing"}
|
readOnly={execController.state === "processing"}
|
||||||
defaultValue={providerRef.current.sampleProgram}
|
defaultValue={providerRef.current.sampleProgram}
|
||||||
tokensProvider={providerRef.current.editorTokensProvider}
|
tokensProvider={providerRef.current.editorTokensProvider}
|
||||||
|
@ -98,7 +98,7 @@ const CodeEditorComponent = (props: Props, ref: React.Ref<CodeEditorRef>) => {
|
|||||||
return (
|
return (
|
||||||
<Editor
|
<Editor
|
||||||
theme={isDark ? "ep-dark" : "ep-light"}
|
theme={isDark ? "ep-dark" : "ep-light"}
|
||||||
defaultLanguage="brainfuck"
|
defaultLanguage={props.languageId}
|
||||||
defaultValue={props.defaultValue}
|
defaultValue={props.defaultValue}
|
||||||
beforeMount={(monaco) => {
|
beforeMount={(monaco) => {
|
||||||
monaco.editor.defineTheme("ep-dark", darkTheme as any);
|
monaco.editor.defineTheme("ep-dark", darkTheme as any);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user