Closed jgiles closed 10 years ago
It's a little more complicated than this. Something annotated with @type
can be a field visible to other files, and an @param
annotation in an interface or superclass is relevant to implementors and subclasses.
Without considering the relationships between files, it seems we can eliminate types in @private
annotations but not much else.
Currently, we try to load files for all the referenced types in all the files we process, including those that we are loading automatically from other files. This means that for anything other than smallish projects, we just keep loading files until Tern's dependency budget system cuts us off.
This is a problem because many of the loaded files are not actually necessary for understanding the current file. By loading unnecessary files, we are bloating memory consumption and slowing things down. We could even end up consuming the dependency budget on unneeded files and preventing the processing of something that actually matters.
It seems like we should only need to load:
goog.require
classes in the current file.