aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Remove unused hard-coded pathsEmil Lauridsen2019-12-291-4/+0
| | |
| * | Resolve traits in infer using lang item infrastructureEmil Lauridsen2019-12-293-10/+19
| | |
| * | Add helpers for unpacking lang itemsEmil Lauridsen2019-12-291-0/+44
| |/
* | Merge #2061bors[bot]2019-12-297-14/+369
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2061: Theme loading and "editor.tokenColorCustomizations" support. r=matklad a=seivan Fixes: [Issue#1294](https://github.com/rust-analyzer/rust-analyzer/issues/1294#issuecomment-497450325) TODO: - [x] Load themes - [x] Load existing `ralsp`-prefixed overrides from `"workbench.colorCustomizations"`. - [x] Load overrides from `"editor.tokenColorCustomizations.textMateRules"`. - [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 `package.json` - [x] Load configurable scope mappings from settings. - [x] Load JSON Scheme for text mate scope rules in settings. - [x] Update [Readme](https://github.com/seivan/rust-analyzer/blob/feature/themes/docs/user/README.md#settings). Borrowed the theme loading (`scopes.ts`) from `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 `"workbench.colorCustomizations"`. 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. <img width="453" alt="Screenshot 2019-11-09 at 17 43 18" src="https://user-images.githubusercontent.com/55424/68531968-71b4e380-0318-11ea-924e-cdbb8d5eae06.png"> <img width="780" alt="Screenshot 2019-11-09 at 17 41 45" src="https://user-images.githubusercontent.com/55424/68531950-4b8f4380-0318-11ea-8f85-24a84efaf23b.png"> <img width="468" alt="Screenshot 2019-11-09 at 17 40 29" src="https://user-images.githubusercontent.com/55424/68531952-51852480-0318-11ea-800a-6ae9215f5368.png"> 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. ```jsonc "editor.tokenColorCustomizations": { "textMateRules": [ { "scope": "keyword", "settings": { "fontStyle": "bold", } }, ] }, ``` 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 ```typescript [ 'comment', [ 'comment', 'comment.block', 'comment.line', 'comment.block.documentation' ] ], ['string', ['string']], ['keyword', ['keyword']], ['keyword.control', ['keyword.control', 'keyword', 'keyword.other']], [ 'keyword.unsafe', ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword'] ], ['function', ['entity.name.function']], ['parameter', ['variable.parameter']], ['constant', ['constant', 'variable']], ['type', ['entity.name.type']], ['builtin', ['variable.language', 'support.type', 'support.type']], ['text', ['string', 'string.quoted', 'string.regexp']], ['attribute', ['keyword']], ['literal', ['string', 'string.quoted', 'string.regexp']], ['macro', ['support.other']], ['variable', ['variable']], ['variable.mut', ['variable', 'storage.modifier']], [ 'field', [ 'variable.object.property', 'meta.field.declaration', 'meta.definition.property', 'variable.other' ] ], ['module', ['entity.name.section', 'entity.other']] ``` Co-authored-by: Seivan Heidari <[email protected]>
| * Fix ↵Seivan Heidari2019-12-234-16/+20
| | | | | | | | | | | | https://github.com/rust-analyzer/rust-analyzer/pull/2061#discussion_r348716036 Fix https://github.com/rust-analyzer/rust-analyzer/pull/2061/files/68a5ff050faf514e9d122212a66703ca8ce66ab7#r361019340
| * Merge branch 'master' into feature/themesSeivan Heidari2019-12-23233-10763/+14882
| |\
| * \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-28150-3077/+3558
| |\ \ | | | | | | | | | | | | feature/themes
| * \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-252-5/+55
| |\ \ \ | | | | | | | | | | | | | | | feature/themes
| * \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-2594-1904/+2468
| |\ \ \ \ | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-223-7/+54
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-2228-510/+763
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-2182-1067/+1451
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-2017-27/+358
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-182-49/+91
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-1825-429/+370
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-182-3/+89
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * | | | | | | | | | | | Readding jsonc parser because of ↵Seivan Heidari2019-11-183-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/rust-analyzer/rust-analyzer/pull/2061\#discussion_r344783715
| * | | | | | | | | | | | Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-1883-903/+1500
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-1540-2136/+2620
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-1437-774/+904
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-1224-679/+842
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-123-0/+7
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-129-22/+33
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-1134-439/+1072
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-105-6/+112
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * | | | | | | | | | | | | | | | | | | | Probably a better approach to check for values before assigning lest we ↵Seivan Heidari2019-11-101-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | replace something.
| * | | | | | | | | | | | | | | | | | | | Vscode wasn't running the linter automatically so ran `npm run fix` - wonder ↵Seivan Heidari2019-11-096-106/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if it's related to `tslint` being deprecated.
| * | | | | | | | | | | | | | | | | | | | Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-0920-190/+406
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-094-281/+304
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-073-61/+66
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-078-71/+177
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-051-12/+21
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/themes
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into feature/themesSeivan Heidari2019-11-052-11/+11
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | | | | | | | | | | | | See if this satisfies the CI.Seivan Heidari2019-11-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | | | | | | | | Fix typo.Seivan Heidari2019-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | | | | | | | | Clearer docs usage under `rust-analyzer.scopeMappings`.Seivan Heidari2019-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | | | | | | | | Remove new line.Seivan Heidari2019-11-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | | | | | | | | Logging fallback tag in case scopes are missing.Seivan Heidari2019-11-041-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | | | | | | | | Merge branch 'master' into feature/themesSeivan Heidari2019-11-0420-342/+323
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | | | | | | | | | | | | | * Adding scope mapping configuration manifest in `package.json`Seivan Heidari2019-11-046-68/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Loading configurable scope mappings from settings. * Updating Readme with `rust-analyzer.scopeMappings`. `rust-analyzer.scopeMappings` -- a scheme backed JSON object to tweak Rust Analyzer scopes to TextMate scopes. ```jsonc { //Will autocomplete keys to available RA scopes. "keyword.unsafe": ["keyword", "keyword.control"], //Values are string | TextMateScope | [string | TextMateScope] "comments": "comment.block" } ```
| * | | | | | | | | | | | | | | | | | | | | | | | | | | Merge branch 'master' into feature/themesSeivan Heidari2019-11-0461-1312/+1810
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into feature/themesSeivan Heidari2019-11-0212-103/+605
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into feature/themesSeivan Heidari2019-10-319-217/+240
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making loadColors more readable by monading all the things.Seivan Heidari2019-10-311-23/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding better debugging for testing themes missing tags and which scopes ↵Seivan Heidari2019-10-313-45/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | didn't map. Since this file is no longer being pushed upstream, double down on monads.
| * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge branch 'master' into feature/themesSeivan Heidari2019-10-31129-2755/+4949
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove `jsonc-parser` since vscode can load the package. Might need it later ↵Seivan Heidari2019-10-272-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for loading certain themes, but seems to work without for now.
| * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding debugging to figure out missing scopes from theme.Seivan Heidari2019-10-272-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding all the decorators from RA to map.Seivan Heidari2019-10-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Useful for more granular control.
| * | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introducing a Scopes Mapper to map from RA scopes to TextMate scopes with ↵Seivan Heidari2019-10-274-13/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fallbacks. Current scopes defined: ``` ['keyword.unsafe', ['storage.modifier', 'keyword.other', 'keyword.control']], ['function', ['entity.name.function']], ['parameter', ['variable.parameter']], ['type', ['entity.name.type']], ['builtin', ['variable.language', 'support.type', 'support.type']], ['text', ['string', 'string.quoted', 'string.regexp']], ['attribute', ['keyword']], ['literal', ['string', 'string.quoted', 'string.regexp']], ['macro', ['support.other']], ['variable.mut', ['variable']], ['field', ['variable.object.property']], ['module', ['entity.name.section']] ``` Need to complement with further fallbacks as some themes fail.