Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
610 views
in Technique[技术] by (71.8m points)

visual studio code - VSCode - copy localhost path in right-click menu

Is there a way to add a custom item to the right-click menu in the VSCode explorer?

Specifically, I am looking to add a "Copy Localhost Path" type of option, where it just takes the "Copy Relative path" option (relative/path/to/file.html) and put my localhost before it (http://localhost:8000/relative/path/to/file.html)

I'm just tired of navigating to localhost:8000 and pasting the relative path after it.

right click menu

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have written an extension (Context Menu Extra) that adds this command to the context menus of the explorer and the editor.

You can also call the command from the command palette and add a key binding to use the current file.

You can also set the port number to use and a possible web root directory in case the webserver does not serve from the workspace root folder.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...