It does this for AHDL, VHDL, Verilog, .bdf(schematics), etc. Here's an example in VHDL that only adds the top-level and gets the sub-hierarchy through a library:
set_global_assignment -name VHDL_FILE test.vhd
set_global_assignment -name SEARCH_PATH .
\\rtl\\user_lib Note that there is also a message when it does this rather than read something explicit:
Warning (12125): Using design file rtl/user_lib/basic_shift_register.vhd, which is not specified as a design file for the current project, but contains definitions for 2 design units and 1 entities in project
Info (12022): Found design unit 1: basic_shift_register-rtl
Info (12023): Found entity 1: basic_shift_register
(Also note that the project directory is a library by default even if not specified. So if your top-level in your .qsf is called "topmod" it will look in explicitly added files first. If it's not there, it will look in the project directory for any source files that are topmod, i.e. topmod.vhd or
topmod.sv. This repeats for all entities. (It doesn't re-read explicitly added files. It actually reads all explicitly added files and creates a list of found modules/entities/etc. and only when something can't be found there does it look in libraries)