tokyo-night / tokyo-night-vscode-theme

A clean, dark Visual Studio Code theme that celebrates the lights of Downtown Tokyo at night.
MIT License
1.74k stars 119 forks source link

Python triple quoted comments not recognized #89

Closed FrancescoGd closed 2 months ago

FrancescoGd commented 3 months ago

Hi, first of all let me tell that i really love this beautiful theme, so thank you! Sadly I had to switch back to using Dracula though because it mismatches Python's multiline comments inside triple quotes for strings (see attached images) and it's a bit confusing. Any hints? VSCode version: 1.89.1 Theme version: 1.0.6

python comment with Tokyo Night

python comment with Dracula

FrancescoGd commented 3 months ago

Replying to myself, I see that other themes have these lines, don't know if it's relevant:

- name: Docstrings
  scope:
  - string.quoted.docstring.multi
  - string.quoted.docstring.multi.python punctuation.definition.string.begin
  - string.quoted.docstring.multi.python punctuation.definition.string.end
  - string.quoted.docstring.multi.python constant.character.escape
  settings:
    foreground: *COMMENT
enkia commented 2 months ago

This has been fixed. Let me know if it works for you, @FrancescoGd?

FrancescoGd commented 2 months ago

@enkia updated and reactivated, it now works like a charm, thank you so much!馃檪

zydou commented 2 months ago

@enkia Hello, I still have the problem with theme version v1.0.8. I have to switch back to v1.0.6 to make the multiline comments inside triple quotes to be highlighted.

This is my vscode environment:

Version: 1.85.2
Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681
Date: 2024-01-18T06:40:19.222Z
Electron: 25.9.7
ElectronBuildId: 26354273
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 5.15.0-97-generic

Note: I have to pin the vscode version to 1.85.2 because this is the last version which supports Ubuntu 18.04.

enkia commented 2 months ago

@zydou

Could you put your cursor in one of those comments, open command palette, search Inspect Editor Tokens and Scopes and copy and paste what you see there?

zydou commented 2 months ago

Theme version v1.0.6:

路路路路路路路路Args:13 chars
language    python
standard token type String
foreground  #9ECE6A
background  #1A1B26
contrast ratio  9.36
textmate scopes string.quoted.docstring.multi.python
source.python
foreground  string
{ "foreground": "#9ECE6A", "fontStyle": "" }

Theme version v1.0.8:

路路路路路路路路Args:13 chars
language    python
standard token type String
foreground  #51597D
background  #1A1B26
contrast ratio  2.50
font style  italic
textmate scopes string.quoted.docstring.multi.python
source.python
foreground  string.quoted.docstring.multi
{ "foreground": "#51597D" }
enkia commented 2 months ago

Hey @zydou, looks like you preferred the version that didn't scope these python comments. I prefer to keep it as is.

Add this to your settings.json to go back to the way they were:

"editor.tokenColorCustomizations": {
    "[Tokyo Night Storm]": {
        "textMateRules": [
        {
            "scope": [
                "punctuation.definition.string.begin.python",
                "punctuation.definition.string.end.python",
            ],
            "settings": {
                "foreground": "#89DDFF"
            }
        },
        {
            "scope": "string.quoted.docstring.multi.python",
            "settings": {
                "foreground": "#9ECE6A"
            }
        },
        ]
    }
} 
zydou commented 2 months ago

Hey @zydou, looks like you preferred the version that didn't scope these python comments. I prefer to keep it as is.

Add this to your settings.json to go back to the way they were:

"editor.tokenColorCustomizations": {
    "[Tokyo Night Storm]": {
        "textMateRules": [
        {
            "scope": [
                "punctuation.definition.string.begin.python",
                "punctuation.definition.string.end.python",
            ],
            "settings": {
                "foreground": "#89DDFF"
            }
        },
        {
            "scope": "string.quoted.docstring.multi.python",
            "settings": {
                "foreground": "#9ECE6A"
            }
        },
        ]
    }
} 

Thanks, this works for me!

Goldensteev commented 1 month ago

Hey @enkia it seems there is still an issue :

Screenshot 2024-07-16 at 14 58 15

i have tried the above fix but no luck. Reverting back to 1.0.6 fixes it.

in case you ask the same as above : 1.0.6

Controller路for路handl鈥β穟ser路notifications.41 chars
language    python
standard token type String
foreground  #9ECE6A
background  #1A1B26
contrast ratio  9.36
textmate scopes string.quoted.docstring.multi.python
source.python
foreground  string
{ "foreground": "#9ECE6A", "fontStyle": "" }

1.0.9 Screenshot 2024-07-16 at 15 03 24

zydou commented 1 month ago

@Goldensteev hi, have you restarted the vscode? I don't have the problem after adjusting the settings.json

image

Goldensteev commented 1 month ago

@zydou you made me doubt but yeah just checked and it does not work.

zydou commented 1 month ago

@Goldensteev Hi, do you select the correct theme name corresponding with the settings.json? For example:

"editor.tokenColorCustomizations": {
    "[Tokyo Night Storm]": {  // You should select theme name: "Tokyo Night Storm"
        ...
    }
}

BTW, the following is my current Inspect Editor Tokens and Scopes results: image

Goldensteev commented 1 month ago

@zydou ahh yes indeed i forgot i was using Tokyo Night and not storm! working now thanks