Closed Nishkalkashyap closed 5 years ago
Thanks, @Nishkalkashyap!
The patch will be pushed in next minor release.
Please yarn add monaco-editor-textmate
again to upgrade to 2.2.0
cc @CompuIves this patch implements "proper" token scope inheritance. Token will take color of its parent scope if itself doesn't have any color mapped directly.
This is really cool, thanks for the update @Nishkalkashyap! Also very cool that you made a CodeSandbox demo!
Fixes issue: https://github.com/NeekSandhu/monaco-textmate/issues/5
API maintains backward compatibility. Optionally pass editor instance to
wireTmGrammars(...args, editor)
to filter for appropriate token scope.Implementation borrowed from: https://github.com/NeekSandhu/monaco-textmate/issues/5#issuecomment-496412139
Before:
After: