pylance-release
pylance-release copied to clipboard
Python docstrings show up as strings instead of comments
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version:
- OS Version:
Steps to Reproduce:
please creators of vscode. I found that my docstrings are supposed to look like comments because this is what I found on google. https://github.com/microsoft/vscode/pull/182162. But it doesn't work, please let me know how to fix it. Also I wanted to post this question into discussions but I can't find them, and stack overflow link doesn't load. I do apologize for that.
Can you please provide a code example and a log as described under "Filing an issue" in the troubleshooting guide?
Can you please provide a code example and a log as described under "Filing an issue" in the troubleshooting guide?
server
https://gist.github.com/stunlocked1/0a6d01d0c9ad651b8d9e7d1c095c3387
example
def add(b):
"""Docstring"""
p = "some string"
return p * b
This is what I had it look like (not my screenshot) but for some reason it stopped working and I googled everywhere and couldn't fix it
thanks for uploading the screenshot! Note that you mentioned "for some reason it stopped working", does it work before? wanted to clarify if this is a regression.
this behavior is by design, Docstrings and Comments are syntactically different things, Docstrings are string literals.
KacieKK
but it worked fine tho a year ago when I installed vscode I havent took screenshots but I'm 99% sure they looked like comments
this behavior is by design, Docstrings and Comments are syntactically different things, Docstrings are string literals.
I found a screenshot on google and I can tell its vscode by the colors (for some reason it has a string as a comment under docstring though)
Omg I found https://github.com/microsoft/vscode/pull/184938 they changed it back💀
ok.