79271036

Date: 2024-12-11 08:50:27
Score: 0.5
Natty:
Report link

I had the same problem. How do you get ‘monaco’ to define theme? Seems you need to register the theme not from monaco-editor import, but this way

    declare let monaco: any;
   
    export const monacoCustomLanguageConfig: NgxMonacoEditorConfig = {
        onMonacoLoad: monacoCustomLanguagesLoad
    }

    export function monacoCustomLanguagesLoad() {
        monaco.languages.register({id: ‘csharp’});
        monaco.editor.defineTheme(‘csharpTheme’, yourCSharpTheme);
        monaco.languages.setMonarchTokensProvider(‘csharp’, yourCsharpSyntaxLanguage);
    }
Reasons:
  • Blacklisted phrase (1): How do you
  • Whitelisted phrase (-1): I had the same
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Лилия Безымянная