Skip to content

Jupyter notebook's syntax highlighting doesn't use TextMate rules defined in settings.json #729

@unavaliabl3

Description

@unavaliabl3

Bug: Notebook Editor, Interactive Window, Editor cells

Jupiter notebook's syntax highlighting doesn't use TextMate rules defined in settings.json.

Click here to show TextMate rules

"textMateRules": [
        {
          "scope": "storage.type",
          "settings": {
            "foreground": "#3276eb"
          }
        },
        {
          "scope": "support.type.python",
          "settings": {
            "foreground": "#3276eb"
          }
        },
        {
          "scope": "support.function",
          "settings": {
            "foreground": "#61AFEF"
          }
        },
        {
          "scope": "support.function.builtin",
          "settings": {
            "foreground": "#7ba5ff"
          }
        },
        {
          "scope": "storage.modifier",
          "settings": {
            "foreground": "#6f6fff"
          }
        },
        {
          "scope": "keyword.type",
          "settings": {
            "foreground": "#2271fa"
          }
        },
        {
          "scope": "keyword.other.new",
          "settings": {
            "foreground": "#4d7ffd"
          }
        },
        {
          "scope": "keyword.other.class",
          "settings": {
            "foreground": "#2271fa"
          }
        },
        {
          "scope": "keyword.other.namespace",
          "settings": {
            "foreground": "#4384d5"
          }
        },
        {
          "scope": "keyword.other.using",
          "settings": {
            "foreground": "#4384d5"
          }
        },
        {
          "scope": "keyword.control.import",
          "settings": {
            "foreground": "#4384d5"
          }
        },
        {
          "scope": "keyword.operator",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        {
          "scope": "constant.numeric",
          "settings": {
            "foreground": "#ffdcb6"
          }
        },
        {
          "scope": "constant.numeric.hex",
          "settings": {
            "foreground": "#ffdcdc"
          }
        },
        {
          "scope": "entity.name.type.namespace",
          "settings": {
            "foreground": "#64c295"
          }
        },
        {
          "scope": "entity.name.variable.parameter",
          "settings": {
            "foreground": "#E06C75"
          }
        },
        {
          "scope": "entity.name.variable.field",
          "settings": {
            "foreground": "#ffa4b8"
          }
        },
        {
          "scope": "meta.attribute",
          "settings": {
            "foreground": "#ffa4b8"
          }
        },
        {
          "scope": "variable",
          "settings": {
            "foreground": "#E06C75"
          }
        },
        {
          "scope": "variable.parameter.function.language.python",
          "settings": {
            "foreground": "#E06C75"
          }
        },
        {
          "scope": "variable.other.object.property",
          "settings": {
            "foreground": "#ffa4b8"
          }
        },
        {
          "scope": "constant.other.caps.python",
          "settings": {
            "foreground": "#E06C75"
          }
        },
        {
          "scope": "support.constant.variable",
          "settings": {
            "foreground": "#E06C75"
          }
        },
        //operator begin //////////////////////////////
        {
          "scope": "keyword.operator.assignment",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        {
          "scope": "keyword.operator.comparison",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        {
          "scope": "keyword.operator.assignment.c",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        {
          "scope": "keyword.operator.comparison.c",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        {
          "scope": "keyword.operator.assignment.cpp",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        {
          "scope": "keyword.operator.comparison.cpp",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        {
          "scope": "keyword.operator.logical",
          "settings": {
            "foreground": "#c678dd"
          }
        },
        //operator end====================================
  ]

Actual behavior

image
I redefined some TextMate rules in settings.json and they are applied to code editor but note notebooks

Expected behavior

image

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.8.105045
  • VS Code version: 1.48.2 a0479759d6e9ea56afa657e454193f72aef85bd0 x64
  • Setting python.jediEnabled: false
  • Setting python.languageServer: Microsoft
  • Python and/or Anaconda version: 3.8.5
  • OS: Windows
  • Virtual environment: N/A

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions