question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python docstrings

See original GitHub issue

Until recently I could differentiate between python docstrings and normal strings within the code. I’m not sure if a change in VSCode on in your extension changed this behaviour.

I want to have docstrings in the same colour as comments, like so:

Screenshot 2021-12-15 at 23 36 37

but now the opening and closing quotes of normal strings also get the same tokenisation:

Screenshot 2021-12-15 at 23 45 33

(please see the quotes with a mismatch colour: I would like them to be green (same as the string is) while the ones on the docstring remain grey).

This used to be my textMate rule for that scope:

{
  "name": "Python - Docstrings",
  "scope": [
    "string.quoted.docstring.multi.python",
    "string.quoted.docstring.multi.python punctuation.definition.string.begin.python",
    "string.quoted.docstring.multi.python punctuation.definition.string.end.python",
  ],
  "settings": {
    "fontStyle": "italic",
    "foreground": "#7c7a7a"
  }
},

But it’s not working anymore.

Am I missing anything or is this a change on VSCode’s site or your extension?

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
GBrachettacommented, Dec 17, 2021

Yes, this is it! Absolutely brilliant, thanks so much for fixing this and so quickly! 💯

1reaction
Binaryifycommented, Dec 17, 2021

please check v3.13.7, and give me some feedback if you can~

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 257 – Docstring Conventions
A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition. · All modules...
Read more >
Python Docstrings (With Examples) - Programiz
Python docstrings are the string literals that appear right after the definition of a function, method, class, or module. Let's take an example....
Read more >
How to Use Python Docstrings for Effective Code Documentation
At the top of the file, a docstring should describe the main purpose of the script, brief guidelines, and functions or classes it...
Read more >
Python Docstrings Tutorial : Examples & Format for Pydoc ...
Python documentation string or commonly known as docstring, is a string literal, and it is used in the class, module, function, or method...
Read more >
pandas docstring guide — pandas 1.5.2 documentation
A Python docstring is a string used to document a Python module, class, function or method, so programmers can understand what it does...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found