Giter Site home page Giter Site logo

Comments (4)

cheginit avatar cheginit commented on May 28, 2024 1

Ah, that's right. I am using One Dark. That's neat! I ended up using this:

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

to get:
image

Thanks for the help!

from python-docstring-highlighter.

rodolphebarbanneau avatar rodolphebarbanneau commented on May 28, 2024

Hello, thank you for your feedback!

I understand you're looking to change the "style type" similar to numpy or google within the extension. While the extension doesn't offer a direct option to switch between these specific styles, it does provide a feature for theming through the use of scopes. You can explore this in the customization section (customization). Here, you'll find that some scopes are designed to target specific style types, including ones like "numpy".

This extension is particularly beneficial when dealing with third-party libraries, whose documentation styles may vary. When you introspect the code from these libraries, the extension's highlighting feature will highlight documentation no matter what style is used.

Keep in mind this extension is for highlighting only, it doesn't enforce any style rules.

from python-docstring-highlighter.

cheginit avatar cheginit commented on May 28, 2024

I see. So, out of the box, it should support numpy-style docstring highlighting. I always used this style for my docstrings, but when I installed this extension, it didn't correctly highlight the args, like the demo. Here's what I see when I open a function from numpy:

image

So, it's not detecting arg names or types, and seems to be working partially.

from python-docstring-highlighter.

rodolphebarbanneau avatar rodolphebarbanneau commented on May 28, 2024

I think the issue is with your theme that may blends the scopes color. Bellow you'll see what I get with the modern dark theme in VSCode:

Screenshot 2024-03-17 at 20 14 04

You can analyze this on your side:

  • Run the VSCode command Developer - Inspect Editor Tokens and Scopes (using Cmd+Shift+P)
  • Left click on a character in your source to inspect the available scopes (you can enable/disable the extension to see which scopes it adds to the source code, see Available Scopes :

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!

from python-docstring-highlighter.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.