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/A