zikaari / monaco-editor-textmate

MIT License
122 stars 16 forks source link

Usage of the grammars map? #1

Closed epatpol closed 6 years ago

epatpol commented 6 years ago

I just quickly looked at the code, but what is the use case for the grammars map? Is it to have different extension names that could use the same grammar? Could it be optional?

    const grammars = new Map()
    grammars.set('css', 'CSS')

    await wireTmGrammars(monaco, registry, grammars)
zikaari commented 6 years ago

My bad; https://github.com/NeekSandhu/monaco-editor-textmate/commit/74267f02740bc492d848f967432e89575fb97722 should explain why you need that map.

The human readable keys or language names are used by monaco-editor to set language ID's, and not so human readable values are used by TextMate engine.

epatpol commented 6 years ago

Thanks!