Hello,
I'm using the Actipro PythonSyntaxLanguage for WPF with a single shared PythonSyntaxLanguage and IProject instance across multiple open Python documents.
I'd like IntelliPrompt to automatically resolve sibling modules relative to the currently edited document.
For example, if I have:
D:\Project1\main.py D:\Project1\helper.py
And separately:
D:\Project2\main.py D:\Project2\helper.py
I'd like import helper in each main.py to resolve to the corresponding helper.py.
Currently, the only way I've found to achieve this is to add each opened file's directory to IProject.SearchPaths. However, adding broad directories can cause Actipro to recursively scan large portions of the filesystem, resulting in significant performance problems.
What is the suggested approach to get this to work?
Note: At start-up, I initialize an IProject instance on a background thread with all of the search paths from PYTHONPATH and sys.path and then swap in that IProject instance to be the active project of my PythonSyntaxLanguage when it is complete. However, such an approach seems messy for opening new documents.
Thank you!