Commit 2347576
authored
Extend theme converter to allow multimatching against vscode colors (#3294)
[[PR Description]]
Adds the ability to specify a vec of VScode syntax scopes to match
against for a given syntax style.
Example:
```rust
pub fn to_vscode(&self) -> Vec<&'static str> {
use ZedSyntaxToken::*;
match self {
SyntaxAttribute => vec!["entity.other.attribute-name"],
SyntaxBoolean => vec!["constant.language"],
SyntaxComment => vec!["comment"],
SyntaxCommentDoc => vec!["comment.block.documentation"],
SyntaxConstant => vec!["constant.character"],
SyntaxConstructor => vec!["entity.name.function.definition.special.constructor"],
SyntaxEmbedded => vec!["meta.embedded"],
SyntaxEmphasis => vec!["markup.italic"],
SyntaxEmphasisStrong => vec![
"markup.bold",
"markup.italic markup.bold",
"markup.bold markup.italic",
],
SyntaxEnum => vec!["support.type.enum"],
SyntaxFunction => vec![
"entity.name.function",
"variable.function",
"support.function",
],
SyntaxKeyword => vec!["keyword"],
SyntaxLabel => vec![
"label",
"entity.name",
"entity.name.import",
"entity.name.package",
],
// .. more styles
}}
```
Useful `settings.json` for testing themes:
```json5
{
// --- Dark Themes ---
"theme": "Ayu Dark"
// "theme": "Ayu Mirage"
// "theme": "Dracula"
// "theme": "Gruvbox Dark Hard"
// "theme": "Gruvbox Dark Medium"
// "theme": "Gruvbox Dark Soft"
// "theme": "Night Owl"
// "theme": "Noctis Obscuro"
// "theme": "Noctis"
// "theme": "Nord"
// "theme": "Palenight (Mild Contrast)"
// "theme": "Palenight Operator"
// "theme": "Palenight"
// "theme": "Rose Pine Moon"
// "theme": "Rose Pine"
// "theme": "Solarized Dark"
// "theme": "Synthwave 84"
// --- Light Themes ---
// "theme": "Ayu Light"
// "theme": "Gruvbox Light Hard"
// "theme": "Gruvbox Light Medium"
// "theme": "Gruvbox Light Soft"
// "theme": "Noctis Lux"
// "theme": "Rose Pine Dawn"
// "theme": "Solarized Light"
}
```
Release Notes:
- N/AFile tree
21 files changed
+4131
-952
lines changed- assets/themes/src/vscode
- gruvbox
- rose-pine
- synthwave-84
- crates
- theme2/src/themes
- theme_importer/src/vscode
21 files changed
+4131
-952
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
| |||
489 | 492 | | |
490 | 493 | | |
491 | 494 | | |
492 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
493 | 499 | | |
494 | 500 | | |
495 | 501 | | |
496 | 502 | | |
497 | 503 | | |
498 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
499 | 508 | | |
500 | 509 | | |
501 | 510 | | |
| |||
628 | 637 | | |
629 | 638 | | |
630 | 639 | | |
631 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
632 | 643 | | |
633 | 644 | | |
634 | 645 | | |
| |||
761 | 772 | | |
762 | 773 | | |
763 | 774 | | |
764 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
765 | 779 | | |
766 | 780 | | |
767 | 781 | | |
| |||
788 | 802 | | |
789 | 803 | | |
790 | 804 | | |
791 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
792 | 809 | | |
793 | 810 | | |
794 | 811 | | |
| |||
809 | 826 | | |
810 | 827 | | |
811 | 828 | | |
812 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
813 | 833 | | |
814 | 834 | | |
815 | 835 | | |
| |||
831 | 851 | | |
832 | 852 | | |
833 | 853 | | |
834 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
835 | 857 | | |
836 | 858 | | |
837 | 859 | | |
| |||
Lines changed: 30 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
| |||
489 | 492 | | |
490 | 493 | | |
491 | 494 | | |
492 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
493 | 499 | | |
494 | 500 | | |
495 | 501 | | |
496 | 502 | | |
497 | 503 | | |
498 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
499 | 508 | | |
500 | 509 | | |
501 | 510 | | |
| |||
628 | 637 | | |
629 | 638 | | |
630 | 639 | | |
631 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
632 | 643 | | |
633 | 644 | | |
634 | 645 | | |
| |||
761 | 772 | | |
762 | 773 | | |
763 | 774 | | |
764 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
765 | 779 | | |
766 | 780 | | |
767 | 781 | | |
| |||
788 | 802 | | |
789 | 803 | | |
790 | 804 | | |
791 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
792 | 809 | | |
793 | 810 | | |
794 | 811 | | |
| |||
809 | 826 | | |
810 | 827 | | |
811 | 828 | | |
812 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
813 | 833 | | |
814 | 834 | | |
815 | 835 | | |
| |||
831 | 851 | | |
832 | 852 | | |
833 | 853 | | |
834 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
835 | 857 | | |
836 | 858 | | |
837 | 859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
| |||
489 | 492 | | |
490 | 493 | | |
491 | 494 | | |
492 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
493 | 499 | | |
494 | 500 | | |
495 | 501 | | |
496 | 502 | | |
497 | 503 | | |
498 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
499 | 508 | | |
500 | 509 | | |
501 | 510 | | |
| |||
628 | 637 | | |
629 | 638 | | |
630 | 639 | | |
631 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
632 | 643 | | |
633 | 644 | | |
634 | 645 | | |
| |||
761 | 772 | | |
762 | 773 | | |
763 | 774 | | |
764 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
765 | 779 | | |
766 | 780 | | |
767 | 781 | | |
| |||
788 | 802 | | |
789 | 803 | | |
790 | 804 | | |
791 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
792 | 809 | | |
793 | 810 | | |
794 | 811 | | |
| |||
809 | 826 | | |
810 | 827 | | |
811 | 828 | | |
812 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
813 | 833 | | |
814 | 834 | | |
815 | 835 | | |
| |||
831 | 851 | | |
832 | 852 | | |
833 | 853 | | |
834 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
835 | 857 | | |
836 | 858 | | |
837 | 859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
426 | 429 | | |
427 | 430 | | |
428 | 431 | | |
| |||
488 | 491 | | |
489 | 492 | | |
490 | 493 | | |
491 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
492 | 498 | | |
493 | 499 | | |
494 | 500 | | |
495 | 501 | | |
496 | 502 | | |
497 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
498 | 507 | | |
499 | 508 | | |
500 | 509 | | |
| |||
627 | 636 | | |
628 | 637 | | |
629 | 638 | | |
630 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
631 | 642 | | |
632 | 643 | | |
633 | 644 | | |
| |||
760 | 771 | | |
761 | 772 | | |
762 | 773 | | |
763 | | - | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
764 | 778 | | |
765 | 779 | | |
766 | 780 | | |
| |||
787 | 801 | | |
788 | 802 | | |
789 | 803 | | |
790 | | - | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
791 | 808 | | |
792 | 809 | | |
793 | 810 | | |
| |||
808 | 825 | | |
809 | 826 | | |
810 | 827 | | |
811 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
812 | 832 | | |
813 | 833 | | |
814 | 834 | | |
| |||
830 | 850 | | |
831 | 851 | | |
832 | 852 | | |
833 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
834 | 856 | | |
835 | 857 | | |
836 | 858 | | |
| |||
0 commit comments