tango icon indicating copy to clipboard operation
tango copied to clipboard

Remove import search within current directory

Open apoorvkh opened this issue 1 year ago • 0 comments

Currently, when a class is not already in Tango's registry, Tango will import files in hopes to locate that class.

In particular, Tango will import all files and modules in the current directory. As discussed in #606, this seems like unexpected / dangerous behavior (and has already caused problems for @jmerullo and I). As a solution, we have removed that code in this PR.

Instead, we feel that users should be responsible for importing packages or registering classes beforehand (i.e. before the classes are resolved by Tango, unless a class is a Tango built-in).

The existing alternatives seem like more appropriate solutions: it seems that the user can specify include-package as a tango run argument, in a .jsonnet config file, or in TangoGlobalSettings. And, modules can also be named according to their full package specification: e.g. examples.euler.complex_arithmetic.AdditionStep, instead of "cadd". So I believe this automatic local search can just be removed.

Please consider, thanks!

Made with contributions from Yingwei Song (@wrencanfly)

apoorvkh avatar Nov 25 '23 04:11 apoorvkh