I was wondering if it is possible to create a permanent link to a line in the same file in visual studio code. I saw that in GitHub you can do this (How to link to specific line number on github). Is it possible to do the same in visual studio code?
Asked
Active
Viewed 1,445 times
0
-
You might use the extension [Bookmarks](https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks) – rioV8 Oct 10 '20 at 00:12
1 Answers
0
With the extension HTML Related Links (better name would be Related Links) you can create a file that contains the filename and line:character_pos that you want to jump to.
If you open this file and lock the HTML Related Links
View in the explorer to this file you have these links always available and they will update when you edit the file with links.
If you have a .txt
file with content like:
src/module1/fileA.js@123
src/module3/fileB.js@54
You can use the following setting:
"html-related-links.include": {
"plaintext": [
{
"find": "([\\w.]+)@(\\d+)",
"filePath": "/$1",
"lineNr": "$2"
}
]
}
At the moment the bookmarking is done manually by editing the .txt
file.
I can have a look if can add a context menu entry to the editor.

rioV8
- 24,506
- 3
- 32
- 49