From 50409851c07538a24bbc3d8e3b35cd28327b6bab Mon Sep 17 00:00:00 2001 From: NicoLaval Date: Tue, 10 Oct 2023 23:21:34 +0200 Subject: [PATCH] Fix minor issues --- src/Editor.tsx | 4 +--- src/utils/providers.ts | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Editor.tsx b/src/Editor.tsx index b6a54a9..12c90a4 100644 --- a/src/Editor.tsx +++ b/src/Editor.tsx @@ -12,7 +12,6 @@ type EditorProps = { customFetcher?: (url: string) => Promise; variables?: Variables; variablesInputURLs?: string[]; - SDMXInputURLs?: string[]; tools: Tools; onListErrors?: (errors: Error[]) => void; height?: string; @@ -28,7 +27,6 @@ const Editor = ({ customFetcher, variables, variablesInputURLs, - SDMXInputURLs, tools, height = "50vh", width = "100%", @@ -109,7 +107,7 @@ const Editor = ({ setReady(true); }); } - }, [variablesInputURLs, SDMXInputURLs]); + }, [variablesInputURLs]); if (!ready) return null; diff --git a/src/utils/providers.ts b/src/utils/providers.ts index 46002a3..371c719 100644 --- a/src/utils/providers.ts +++ b/src/utils/providers.ts @@ -52,8 +52,10 @@ export const getEditorWillMount = const { id } = tools; return (monaco: typeof EditorApi) => { monaco.languages.register({ id }); - const tokensProvider: TokensProvider = new TokensProvider(tools); - monaco.languages.setMonarchTokensProvider(id, tokensProvider.monarchLanguage()); + if (tools.monarchDefinition) { + const tokensProvider: TokensProvider = new TokensProvider(tools); + monaco.languages.setMonarchTokensProvider(id, tokensProvider.monarchLanguage()); + } monaco.editor.defineTheme(id, getTheme()); monaco.editor.defineTheme("vtl-default", getVtlTheme("vtl-default")); monaco.editor.defineTheme("vtl-light", getVtlTheme("vtl-light"));