- [x] Load themes
- [x] Load existing
ralsp-prefixed overrides from
- [x] Load overrides from
- [x] Use RA tags to load
vscode.DecorationRenderOptions (colors) from theme & overrides.
- [x] Map RA tags to common TextMate scopes before loading colors.
- [x] Add default scope mappings in extension.
- [x] Cache mappings between settings updates.
- [x] Add scope mapping configuration manifest in
- [x] Load configurable scope mappings from settings.
- [x] Load JSON Scheme for text mate scope rules in settings.
- [x] Update Readme.
Borrowed the theme loading (
Tree Sitter with some modifications to reading
"editor.tokenColorCustomizations" for merging with loaded themes and had to remove the async portions to be able to load it from settings updates.
~Just a PoC and an idea I toyed around with a lot of room for improvement.~
For starters, certain keywords aren't part of the standard TextMate grammar, so it still reads colors from the
ralsp prefixed values in
But I think there's more value making the extension work with existing themes by maping some of the decoration tags to existing key or keys.
These will merge with the default ones coming with the extension, so you don't have to implement all of them and works well with overrides defined in settings.
Edit: The idea is to work with 90% of the themes out there by working within existing scopes available that are generally styled. It's not to say I want to erase the custom Rust scopes - those should still remain and eventually worked into a custom grammar bundle for Rust specific themes that target those, I just want to make it work with generic themes offered on the market place for now.
A custom grammar bundle and themes for Rust specific scopes is out of... scope for this PR.
We'll make another round to tackle those issues.
Current fallbacks implemented
['keyword.control', ['keyword.control', 'keyword', 'keyword.other']],
['storage.modifier', 'keyword.other', 'keyword.control', 'keyword']
['constant', ['constant', 'variable']],
['builtin', ['variable.language', 'support.type', 'support.type']],
['text', ['string', 'string.quoted', 'string.regexp']],
['literal', ['string', 'string.quoted', 'string.regexp']],
['variable.mut', ['variable', 'storage.modifier']],
['module', ['entity.name.section', 'entity.other']]