You are viewing a single thread.
View all comments
9 points
*

Can someone please explain? What would cause VS Code to show an image like this? Is this related to a plugin? (I don’t know what a docstring is)

permalink
report
reply
21 points
*

A docstring is a comment that is used to annotate types/methods/classes/whatever and can be parsed by the IDE and used to provide various hints/assistance when writing code. Tooltips, parameter type suggestions, intellisense, etc. for things that aren’t native parts of the language all usually come from or can be supplemented by docstrings.

The specific format of a docstring varies by language, but many of them prefix meaningful tokens with an @, like @type or @param.

However, if your project is using GitHub it’s also quite common to mention users in comments by prefixing their username with an @, so several vscode GitHub extensions will make any “@{real username}” in a comment into a link to that user, which will show a small user tooltip when hovered.

Edit: I appear to have conflated docstrings and docblocks, but then so has the initial post. I guess at some point “docstring” has just taken over to colloquially refer to all of it.

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7K

    Monthly active users

  • 730

    Posts

  • 11K

    Comments