VSCode / Text Mate / Ключевые слова и операторы внутри строк имеют неправильный цвет - PullRequest
0 голосов
/ 20 сентября 2019

Я пытаюсь настроить тему для разработки на основе LAMP, следуя инструкции на https://macromates.com/manual/en/language_grammars.

Это становится довольно хорошо, за исключением того, что я застрял в некоторых вещах, таких как ключевые слова (например, AND)внутри строки в кавычках не следуют цвету строки, когда строка начинается с них, но в остальном это хорошо!

enter image description here

Так каково решение этого?Я все еще хотел бы, чтобы ключевые слова и операторы были разного цвета, когда они находятся вне строки, но внутри строки они являются частью строки, а не операторами.

Вот код:

"workbench.colorTheme": "Visual Studio Dark",
"editor.tokenColorCustomizations": {

        "comments": "#727272",
        "keywords": "#8ab7f1",
        "types": "#d4e6d8",
        "strings": "#e97676",

        "textMateRules": [
            {
                "scope": ["constant.language", "constant.other", "constant.numeric"],
                "settings": {
                    "foreground": "#d4e6d8"
                }
            },
            {
                "scope": "entity.name",
                "settings": {
                    "foreground": "#45c461"
                }
            },
            {
                "scope": "entity.name.tag",
                "settings": {
                    "foreground": "#8ab7f1"
                }
            },
            {
                "scope": "variable",
                "settings": {
                    "foreground": "#d4e6d8"
                }
            },
            {
                "scope": "variable.language",
                "settings": {
                    "foreground": "#d4e6d8"
                }
            },
            {
                "scope": "storage.modifier",
                "settings": {
                    "foreground": "#8ab7f1"
                }
            },
            {
                "scope": ["support", "support.type", "keyword.control"],
                "settings": {
                    "foreground": "#45c461"
                }
            },
            {
                "scope": "invalid",
                "settings": {
                    "foreground": "#ffffff",
                    "fontStyle": "underline"
                }
            },
            {
                "scope": "comment.block.documentation",
                "settings":{
                "foreground": "#b48c4f"
                }
            },
            {
                "scope": [
                    "punctuation.section.embedded.begin.php",
                    "punctuation.section.embedded.end.php"
                ],
                "settings": {
                    "foreground": "#45c461"
                }
            },
            {
                "scope": "keyword",
                "settings": {
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "storage",
                "settings": {
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "constant.language",
                "settings": {
                    "fontStyle": "bold"
                }
            },
            {
                "scope": "support.class.builtin",
                "settings": {
                    "fontStyle": "bold"
                }
            },
        ]
    },

...