aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
Commit message (Collapse)AuthorAgeFilesLines
* Rename fileAleksey Kladov2019-12-313-2/+2
|
* Fix #2700Aleksey Kladov2019-12-311-1/+1
|
* Switch impure functional style to pure imperativeAleksey Kladov2019-12-313-94/+66
|
* Reduce scopeAleksey Kladov2019-12-311-8/+10
|
* Use optional value shortcutAleksey Kladov2019-12-311-3/+3
|
* Remove trivial helpersAleksey Kladov2019-12-311-15/+3
|
* Rearrange codeAleksey Kladov2019-12-312-107/+106
|
* Restore internal applySourceChange commandAleksey Kladov2019-12-302-0/+9
|
* Use Ctx in highlighterAleksey Kladov2019-12-301-5/+10
|
* Reformat with tsfmtAleksey Kladov2019-12-304-32/+32
|
* Privatize highlightingAleksey Kladov2019-12-308-48/+54
|
* Don't request inline hints repeatedlyAleksey Kladov2019-12-302-10/+26
|
* Retry inlay hints on content modified errorAleksey Kladov2019-12-302-6/+16
|
* Thoughtlessly copy-paste a fix to a problem I don't understandAleksey Kladov2019-12-301-1/+2
|
* Refactor inlay hintsAleksey Kladov2019-12-301-103/+67
|
* Add config to CtxAleksey Kladov2019-12-304-9/+10
|
* Encapsulate highlighting activationAleksey Kladov2019-12-304-35/+24
|
* Encapsulate inlay hints activationAleksey Kladov2019-12-302-38/+39
|
* Dead codeAleksey Kladov2019-12-302-18/+2
|
* status is not a commandAleksey Kladov2019-12-302-13/+13
|
* Hints are not commandsAleksey Kladov2019-12-303-4/+2
|
* Move all commands to ctxAleksey Kladov2019-12-303-22/+26
|
* Minor refactorAleksey Kladov2019-12-301-9/+7
|
* Refactor runablesAleksey Kladov2019-12-303-67/+66
|
* Move expand macro to the new contextAleksey Kladov2019-12-305-75/+53
|
* CleanupAleksey Kladov2019-12-302-11/+11
|
* Cleanup importsAleksey Kladov2019-12-305-8/+12
|
* Refactor show syntax tree actionAleksey Kladov2019-12-308-134/+116
|
* Run prettier on all filesAleksey Kladov2019-12-306-22/+17
|
* Move parentModule to the new CtxAleksey Kladov2019-12-303-37/+37
|
* Refactor applySourceChangeAleksey Kladov2019-12-307-89/+68
|
* Move joinLines to the new CtxAleksey Kladov2019-12-303-21/+21
|
* Fix server config mispell in vscode extensionEmil Lauridsen2019-12-301-1/+1
|
* Move matching brace to new CtxAleksey Kladov2019-12-304-32/+35
|
* Run prettierAleksey Kladov2019-12-302-20/+16
|
* More second command to CtxAleksey Kladov2019-12-304-11/+14
|
* Start new ctx moduleAleksey Kladov2019-12-304-20/+63
|
* SimplifyAleksey Kladov2019-12-301-32/+29
|
* Rename extension.ts -> main.tsAleksey Kladov2019-12-301-0/+0
|
* Add rollupAleksey Kladov2019-12-301-11/+1
|
* Minimize TypeScript buildAleksey Kladov2019-12-302-71/+0
|
* Merge #2061bors[bot]2019-12-294-11/+289
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-233-16/+15
| | | | | | | | | | | | 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-2331-274/+715
| |\
| * \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-281-0/+0
| |\ \ | | | | | | | | | | | | feature/themes
| * \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-212-13/+2
| |\ \ \ | | | | | | | | | | | | | | | feature/themes
| * \ \ \ Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into ↵Seivan Heidari2019-11-203-0/+97
| |\ \ \ \ | | | | | | | | | | | | | | | | | | feature/themes
| * | | | | Readding jsonc parser because of ↵Seivan Heidari2019-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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-181-1/+8
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | feature/themes
| * | | | | | Probably a better approach to check for values before assigning lest we ↵Seivan Heidari2019-11-101-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | replace something.