Comments (4)
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",
},
}
]
}
Thanks for the help!
from python-docstring-highlighter.
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.
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
:
So, it's not detecting arg names or types, and seems to be working partially.
from python-docstring-highlighter.
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:
You can analyze this on your side:
- Run the VSCode command
Developer - Inspect Editor Tokens and Scopes
(usingCmd
+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 :
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-docstring-highlighter.