Add hyperlinking for references
justint opened this issue · 0 comments
Asset/path references in USD files are currently colored blue and underlined, giving the impression that they are hyperlinks. Right now no linking behavior is implemented, but it would be great if one could Ctrl+Click on one and have the editor jump to the referenced path.
To implement this I'll need to define a Reference Contributor, which will provide the ability for the plug-in to jump from the usage of an element to its declaration. Implementing this in turn will open the door for getting the "Find usages"/"Refactor"/"Rename" functions available.
To define the reference element's "origin", I'll need to parse the reference path and identify which prim in the PSI tree it's referring to; if the reference also includes a path to an external usd file, I'll likely have to use usdresolve
to find the path to the file (similar to how AnimalLogic's VSCode extension does it), parse its PSI tree, and then return the path to the prim in that file.
For defining references for over
s or other structures that imply definition outside of the current file, that'll be a little more complicated. I'll likely need to teach the plug-in to check for reference definitions in the parent prim metadata and parse those referenced files' PSI trees for the def
of the requested element.