Question
· Oct 4, 2022

Is there a way to directly open % classes in VS Code?

When using VS Code for Objectscript, is there a way to directly open % classes, like %Library.String, without needing to search for a property of that type and right clicking->"Go to Definition"?

I know it is possible to use "system=1" in the workspace uri definition to see all the % classes, but that tends to clog up the left side viewer with many extra directories. There is also the option in the settings to selectively hide some by defining files.exclude, but it seems fairly complicated to set up a filter for exactly the relevant directories.

So does anyone know the best workaround?

Discussion (4)2
Log in or sign up to continue

Here's what I recommend (assumes you are using Server Manager extension as well; can be done without it but you'll have to edit JSON in a file):

  1. In Server Manager's tree, expand the namespaces of your server.
  2. Clock the "eye" icon on the %SYS row. This will add another root folder to your VS Code workspace. The folder uses the `isfs-readonly` scheme to access the namespace directly.
  3. In VS Code's Explorer (not ObjectScript Explorer), expand that folder and drill down to find the class you want.

Assuming you want to use this multi-root workspace again, use "Save Workspace As..." from the File menu. If you don't, you'll be prompted when you exit VS Code and given a choice of saving or discarding.