I'd like to be able to store user data in a PsiElement which will go away if the key is garbage collected, like WeakHashMap does.
Otherwise I don't think there's a way to store userdata in a PSI tree for temporary use without having to go through recursively removing each userdata for the key, when finished using it.
A getWeakUserData method would be unnecessary; weak user data could be retrieved using getUserData, transparently to the API user.
A corresponding putWeakCopyableUserData should be added as well.