Visual Code Studio

We looked into Visual Studio Code and found Hook works outside the box with it.

If you use Visual Studio Code, please let us know of your experience with it and Hook here or on Twitter

Hi, I just stated using Hook and as you said it works out of the box. But there is a way to link whole workspaces (aka folders) to Hook? Because right now if I’m working on some project I need to open this one file so hooks connected to that file are visible.

Welcome to the forum, Noaal. And thanks for asking.

I’ve asked our developer who looked into this originally to check that out. If anyone else on the forum is using Visual Studio Code, hopefully they will chime in. If it’s not working for you then odds are we’d need to add some custom integration script, assuming VSC has an API for that.

I know this is an old thread, but I was just wondering the same thing. I’m relatively new to Hookmark so I haven’t written any custom scripts before. Has there already been a script published for this use case in vscode?

@erock4 I’m not aware of any scripts just yet, but here’s their URI schema:

  • vscode://file/{PATH TO FILE}:{LINE_NO}:{COL_NO} will open the file in a new tab in an existing window at that cursor location. You can omit the :line:col bit.
    • Example: vscode://file/Users/oliver/Documents/script.py:10:5
  • vscode://file/{PATH TO FOLDER} will open a folder (and if there’s a .code-workspace inside it’ll use the workspace config)
    • Unfortunately if there’s an existing window, it opens the folder/workspace in that, replacing the existing workspace.
    • If you don’t want to clobber existing windows, you can run the terminal command code -n {PATH TO FOLDER}. I’m not sure how to make a URL that runs a command though.

I don’t have the AppleScript skills to make a script, but that should be a start!

(URI schema is only documented here: Support opening files through URL handling · Issue #4883 · microsoft/vscode · GitHub)