Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Privatize highlighting | Aleksey Kladov | 2019-12-30 | 8 | -48/+54 |
| | |||||
* | Don't request inline hints repeatedly | Aleksey Kladov | 2019-12-30 | 2 | -10/+26 |
| | |||||
* | Retry inlay hints on content modified error | Aleksey Kladov | 2019-12-30 | 3 | -7/+17 |
| | |||||
* | Thoughtlessly copy-paste a fix to a problem I don't understand | Aleksey Kladov | 2019-12-30 | 1 | -1/+2 |
| | |||||
* | Refactor inlay hints | Aleksey Kladov | 2019-12-30 | 1 | -103/+67 |
| | |||||
* | Add config to Ctx | Aleksey Kladov | 2019-12-30 | 4 | -9/+10 |
| | |||||
* | Encapsulate highlighting activation | Aleksey Kladov | 2019-12-30 | 4 | -35/+24 |
| | |||||
* | Encapsulate inlay hints activation | Aleksey Kladov | 2019-12-30 | 2 | -38/+39 |
| | |||||
* | Dead code | Aleksey Kladov | 2019-12-30 | 2 | -18/+2 |
| | |||||
* | status is not a command | Aleksey Kladov | 2019-12-30 | 2 | -13/+13 |
| | |||||
* | Hints are not commands | Aleksey Kladov | 2019-12-30 | 3 | -4/+2 |
| | |||||
* | Move all commands to ctx | Aleksey Kladov | 2019-12-30 | 3 | -22/+26 |
| | |||||
* | Minor refactor | Aleksey Kladov | 2019-12-30 | 1 | -9/+7 |
| | |||||
* | Refactor runables | Aleksey Kladov | 2019-12-30 | 3 | -67/+66 |
| | |||||
* | Move expand macro to the new context | Aleksey Kladov | 2019-12-30 | 5 | -75/+53 |
| | |||||
* | Cleanup | Aleksey Kladov | 2019-12-30 | 2 | -11/+11 |
| | |||||
* | Cleanup imports | Aleksey Kladov | 2019-12-30 | 5 | -8/+12 |
| | |||||
* | Refactor show syntax tree action | Aleksey Kladov | 2019-12-30 | 8 | -134/+116 |
| | |||||
* | Run prettier on all files | Aleksey Kladov | 2019-12-30 | 7 | -23/+18 |
| | |||||
* | Move parentModule to the new Ctx | Aleksey Kladov | 2019-12-30 | 3 | -37/+37 |
| | |||||
* | Refactor applySourceChange | Aleksey Kladov | 2019-12-30 | 7 | -89/+68 |
| | |||||
* | Move joinLines to the new Ctx | Aleksey Kladov | 2019-12-30 | 3 | -21/+21 |
| | |||||
* | Fix server config mispell in vscode extension | Emil Lauridsen | 2019-12-30 | 1 | -1/+1 |
| | |||||
* | Move matching brace to new Ctx | Aleksey Kladov | 2019-12-30 | 4 | -32/+35 |
| | |||||
* | Run prettier | Aleksey Kladov | 2019-12-30 | 2 | -20/+16 |
| | |||||
* | Add prettier | Aleksey Kladov | 2019-12-30 | 2 | -6/+19 |
| | |||||
* | More second command to Ctx | Aleksey Kladov | 2019-12-30 | 4 | -11/+14 |
| | |||||
* | Start new ctx module | Aleksey Kladov | 2019-12-30 | 4 | -20/+63 |
| | |||||
* | Simplify | Aleksey Kladov | 2019-12-30 | 1 | -32/+29 |
| | |||||
* | Rename extension.ts -> main.ts | Aleksey Kladov | 2019-12-30 | 4 | -4/+4 |
| | |||||
* | Minimize typescript CI | Aleksey Kladov | 2019-12-30 | 1 | -1/+1 |
| | |||||
* | Add rollup | Aleksey Kladov | 2019-12-30 | 5 | -35/+751 |
| | |||||
* | Minimize TypeScript build | Aleksey Kladov | 2019-12-30 | 9 | -1839/+14 |
| | |||||
* | Trim down launch configurations | Aleksey Kladov | 2019-12-29 | 3 | -62/+0 |
| | |||||
* | Merge #2061 | bors[bot] | 2019-12-29 | 6 | -12/+358 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Heidari | 2019-12-23 | 4 | -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/themes | Seivan Heidari | 2019-12-23 | 36 | -699/+1186 |
| |\ | |||||
| * \ | Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵ | Seivan Heidari | 2019-11-28 | 1 | -0/+0 |
| |\ \ | | | | | | | | | | | | | feature/themes | ||||
| * \ \ | Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵ | Seivan Heidari | 2019-11-21 | 2 | -13/+2 |
| |\ \ \ | | | | | | | | | | | | | | | | feature/themes | ||||
| * \ \ \ | Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵ | Seivan Heidari | 2019-11-20 | 4 | -0/+102 |
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | feature/themes | ||||
| * | | | | | Readding jsonc parser because of ↵ | Seivan Heidari | 2019-11-18 | 3 | -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 Heidari | 2019-11-18 | 1 | -1/+8 |
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | feature/themes | ||||
| * | | | | | | Probably a better approach to check for values before assigning lest we ↵ | Seivan Heidari | 2019-11-10 | 1 | -3/+27 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | replace something. | ||||
| * | | | | | | Vscode wasn't running the linter automatically so ran `npm run fix` - wonder ↵ | Seivan Heidari | 2019-11-09 | 6 | -106/+110 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | if it's related to `tslint` being deprecated. | ||||
| * | | | | | | See if this satisfies the CI. | Seivan Heidari | 2019-11-05 | 1 | -5/+5 |
| | | | | | | | |||||
| * | | | | | | Fix typo. | Seivan Heidari | 2019-11-04 | 1 | -1/+1 |
| | | | | | | | |||||
| * | | | | | | Remove new line. | Seivan Heidari | 2019-11-04 | 1 | -1/+0 |
| | | | | | | | |||||
| * | | | | | | Logging fallback tag in case scopes are missing. | Seivan Heidari | 2019-11-04 | 1 | -3/+5 |
| | | | | | | | |||||
| * | | | | | | * Adding scope mapping configuration manifest in `package.json` | Seivan Heidari | 2019-11-04 | 5 | -66/+140 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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" } ``` | ||||
| * | | | | | | Making loadColors more readable by monading all the things. | Seivan Heidari | 2019-10-31 | 1 | -23/+16 |
| | | | | | | |