The code of a layer tree (a frame, a component, an instance of a component
that isn't connected) leads with the import lines of every connected
instance written into it: one line per import path, in path order, each
name once, per language. Collected as the snippets are written, so only
instances the code reaches bring one; a connected layer's own code is its
import and snippet as before.