Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open file at specific line in VSCode

Tags:

In this section: https://code.visualstudio.com/docs/editor/codebasics#_additional-command-line-arguments

It states you can use --goto to open a file at a specific line. I grep code with AstroGrep and every time I try to use the --goto argument VsCode fails to open.

An example argument i'm using which fails:

Code.exe --goto C:\filepath\filename.txt:450:11

or

Code.exe --goto "C:\file path\filename.txt":450:11

What is wrong with this file:line:column syntax? or is this a bug in vscode?

Thanks

like image 991
S Grey Avatar asked Sep 12 '16 15:09

S Grey


2 Answers

Seems to be a known issue which was fixed a couple of days ago - see here

Workaround until next version:

  • Use relative paths
  • Use insider version of VSCode
like image 114
DAXaholic Avatar answered Sep 21 '22 13:09

DAXaholic


Code.exe --goto "C:\file path\filename.txt:450:11" 

worked for me, take a closer look on the quotation marks.

like image 21
Kevin Avatar answered Sep 20 '22 13:09

Kevin