1

I wanted to refer to links while writing comments for the code. It could be anything like images or a URL that explains a concept.

For eg: /** *../../../Array/loops/2024-07-07-17-02-11.png */

I should be able to click this location and able to open the image directly. I have been finding ways to do this, but could not find anything on my own. How to add a clickable link to comments in vscode?

3
  • You can use left ctrl + left mouse click to open a link in vscode. Commented Jul 7, 2024 at 11:51
  • editor URL detection should do this automatically for URL patterns... Commented Jul 8, 2024 at 17:19
  • Can you expand @starball? Commented Nov 13, 2024 at 19:58

3 Answers 3

1

This works for me

// randomfile.c

// ctrl+click in vscode file://full/path/to/file.txt
void main(){
    return 0;
}
Sign up to request clarification or add additional context in comments.

Comments

-1

Try JSDoc comment or any inline comment starting with /** and ends with */. For instance:

/**
 * For clickable link {@link https://example.com/}
 */

Comments

-1
/* https://example.com crtl&click the link!*/.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.