Python Forum
Variable comments on Visual Studio Code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable comments on Visual Studio Code
#1
Hi,
I'm starting with python and I'm using vscode.

def a():
    """comment a"""
    pass

one = "one" #try comment var one
"""try comment var one"""
If I try to use "a" function, vscode shows me the tooltip with right text "Comment a".
If I try to use "one" variable, vscode shows me the tooltip with the following content "one: str".

Is it possible to get that comment shown on visual studio code?

Thanks
Reply
#2
what you have on line 2 is docstring for function a
what you have on line 5 is just inline comment
what you have on line 6 is just a string that is not assign o variable and is just garbage collected when the time comes
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Oct-19-2019, 01:46 PM)buran Wrote: what you have on line 2 is docstring for function a
what you have on line 5 is just inline comment
what you have on line 6 is just a string that is not assign o variable and is just garbage collected when the time comes

Yes sure, but the question is.. on vscode (using intellisense), is it possible to see a comment related only to a single variable?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Algorithm for extracting comments from Python source code Pavel1982 6 529 Feb-28-2024, 09:52 PM
Last Post: Pavel1982
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 1,018 Nov-15-2023, 06:56 PM
Last Post: jst
  How to set PYTHONPATH in Visual Studio Code? aupres 5 4,214 Aug-15-2023, 03:51 PM
Last Post: snippsat
  how do I open two instances of visual studio code with the same folder? SuchUmami 3 887 Jun-26-2023, 09:40 AM
Last Post: snippsat
  Visual Studio Code NewPi 3 1,057 May-16-2023, 11:13 PM
Last Post: snippsat
  How do I add comments from a text-file to an array of folders? clausneergaard 2 1,793 Feb-08-2023, 07:45 PM
Last Post: Larz60+
  Visual Studio Code venv ibm_db error mesi1000 7 2,812 Nov-13-2022, 12:36 AM
Last Post: snippsat
  debugging help on Visual Studio Code mg24 12 2,011 Oct-02-2022, 12:18 AM
Last Post: mg24
  Inserting line feeds and comments into a beautifulsoup string arbiel 1 1,191 Jul-20-2022, 09:05 AM
Last Post: arbiel
  Problem with importing Python file in Visual Studio Code DXav 7 5,090 Jun-15-2022, 12:54 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020