Home > Back-end >  MacOS VSCode: add folder to workspace by path
MacOS VSCode: add folder to workspace by path

Time:10-15

I'm trying to inspect the code in a module found in a subfolder of /usr/local/lib/python3.9/site-packages/*.

The trouble is that VSCode only gives me the system finder view, to navigate to the folder, and I'm not quite sure how to get to the root to even find /usr.

  • typing the path in the search bar doesn't help
  • navigating to Macintosh HD and or Volumes still doesn't show me /usr or other common linux folders located on the root filesystem.

CodePudding user response:

This method should work in any app that uses the standard file dialogs:

  1. In the Finder open a new window
  2. Type Command-Shift-G or select Go to Folder… from the Finder’s Go menu
  3. Enter your path, e.g. /usr/local/lib/python3.9/site-packages
  4. You now have a Finder window showing the (parent) folder of where you want to explore
  5. In VSCode type Command O or select Open… from the File menu
  6. A standard file dialog will open
  7. Click on a folder icon in your Finder window, this can be an icon in the window itself or the one in the window’s title bar, and drag and drop it onto the standard file dialog.
  8. The dialog will switch to show the dropped folder
  9. Continue navigating as usual
  • Related