I want to integrate Visual Studio Code with some of my other tools, and part of that is being able to launch Visual Studio Code passing a file name, line number, and column number, to position the cursor at a specific place in the file.
Is there a way to do this?
The Go To Line dialog box lets you move to a specific line in the active document. To access this dialog box, open a document for editing, and then select Edit > Go To > Go To Line or press Ctrl+G.
VS Code provides two powerful commands to navigate in and across files with easy-to-use key bindings. Hold Ctrl and press Tab to view a list of all files open in an editor group. To open one of these files, use Tab again to pick the file you want to navigate to, then release Ctrl to open it.
Launch VS Code. Open the Command Palette (Cmd+Shift+P) and type 'shell command' and press Enter.
With the new 0.5.0 release you can open one ore multiple files on a line and column using the following syntax:
code -g file1:<line>:<column?> file2:<line>:<column?> file3:<line>:<column?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With