rodolphebarbanneau / python-docstring-highlighter

Syntax highlighting for Python Docstring in VSCode.
https://marketplace.visualstudio.com/items?itemName=rodolphebarbanneau.python-docstring-highlighter
MIT License
52 stars 2 forks source link

Not working "out of the box" #5

Closed caballerofelipe closed 4 months ago

caballerofelipe commented 5 months ago

I just installed it but it's not working. Do I need to press some key combo or something? I didn't see any mentions to this. I might be doing something wrong...

I do have the Microsoft Python Extension (v2024.6.0).

rodolphebarbanneau commented 5 months ago

Hello, it should work out of the box! However, some custom theming might conflict with the colors.

Please check #1, where I explain how to analyze if the extension is working as intended and how to customize the settings:


Screenshot 2024-03-17 at 20 36 34

As you can see, the extension adds a bunch of scopes and VSCode will look up for the first scope that implements a style. In my example, it's the punctuation.definition.tag style that is used (standard scope as I don't have custom theming). You can override this behavior by adding this in you settings.json file for instance:

"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope": "docstring.variable",
      "settings": {
        "fontStyle": "bold underline",
        "foreground": "#569cd6",
      }
    },
  ]
}

Then you can play around to make it as you like!

Originally posted by @rodolphebarbanneau in https://github.com/rodolphebarbanneau/python-docstring-highlighter/issues/1#issuecomment-2002595456

caballerofelipe commented 5 months ago

Thanks!

I was using the theme "Light (Visual Studio) Visual Studio Light" and it wasn't showing the formatting. I changed it and now I see everything.

However, if I add the settings you posted they work and I am able to see the change in color, underlined and in bold. So I guess there's some incompatibility with that theme directly as you said.

rodolphebarbanneau commented 4 months ago

Thanks for the feedback, glad it works for you! If there are no further issues, I'll close this ticket.