'The folder in which the file is seen by the latex compiler.
This is usually the folder of the tex root, but can change if
the import package is used.
Use this instead of the tex root path to implement functions
like the \input command completion.'

def tex_base_path(self, file_path):

    file_path = os.path.normpath(file_path)
    try:
        base_path = self._import_base_paths[file_path]
    except KeyError:
        (base_path, _) = os.path.split(self._tex_root)
    return base_path
