TypeFox / monaco-components

Monaco Editor and Language Client Wrapper, plus Monaco Editor React Component
MIT License
43 stars 13 forks source link

Multiple Langium Grammars #52

Closed ballcoach12 closed 1 year ago

ballcoach12 commented 1 year ago

We have a case where we use multiple grammars in a language project. We have two.langium grammar files and use imports to link them together and reference rules. In the wrapperConfig.editorAppConfig section of UserConfig, there is only support for a single language:

editorAppConfig: {
                $type: 'classic',
                languageId: 'helloworld',
                theme: 'langium-theme',
                code: code,
                useDiffEditor: false,
                editorOptions: {
                    'semanticHighlighting.enabled': true
                },
               languageExtensionConfig: { id: 'langium' },
               languageDef: HelloWorldMonarchContent,
               themeData: LangiumTheme,                
            }

In order to support my case, where we generate multiple monarch definition files, my assumption is that I would need to manually merge the two languages back together into a single monarch definitions file in order to use them as intended in the wrapper. Or is there another way to do this where I can specify multiple monarch definition files?

ballcoach12 commented 1 year ago

After looking at this in more detail, this may not be an issue after all, and the question may have been more appropriate to have posted in the Langium repo.