# Extend theme converter to allow multimatching against vscode colors \(\#3294\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/2347576fb59e9b14ca80cd1a121f2e391bece5a6)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 2347576fb59e9b14ca80cd1a121f2e391bece5a6

Requested commit: 2347576fb59e9b14ca80cd1a121f2e391bece5a6

Commit: 2347576fb59e9b14ca80cd1a121f2e391bece5a6

Tree: b5d6d906a07a1529fcb9b1fa2c866988d1895e90

Author: Nate Butler

Committer: GitHub

## Message

````
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
````

## Parents

- [7586ef1787f96bc2a44b3d8928b66e61e03da574](https://git.cafe/gitcafe/zed/commit/7586ef1787f96bc2a44b3d8928b66e61e03da574?format=markdown)

- [6b65acaa991df16971f77c72c7f809ce31a40721](https://git.cafe/gitcafe/zed/commit/6b65acaa991df16971f77c72c7f809ce31a40721?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/2347576fb59e9b14ca80cd1a121f2e391bece5a6?format=markdown)
