vscode-importmagic icon indicating copy to clipboard operation
vscode-importmagic copied to clipboard

Unable to find symbols in the current workspace

Open Hiestaa opened this issue 5 years ago • 1 comments

First of all thank you for putting this extension together, makes the python dev workflow even more enjoyable than programming in python can be. That being said, I have a minor issue.

Problem Description

I installed importmagic which works great for any standard library import or other modules installed via pip in the current virtual environment installed in a .env directory, but isn't able to find any of the modules of my current project.

Solution Attempts (that didn't work)

  • I have tried to open the project folder straight in vscode, and to add the folder to a new workspace but it did not help.

  • I have tried to set the python.autoComplete.extraPaths settings value to the absolute path of my module but this did not help either.

  • I have tried to add the path to every package I have in my current project's folder to this python.autoComplete.extraPaths settings. This allowed importmagic to find the symbols I was looking for, but the import path is now wrong.

For instance if I have a localpackage ./foo/bar.py that contains a symbol class Bar, and I specify the path ./foo in python.autoComplete.extraPaths, importmagic will add the statement from bar import Bar instead of the expected from foo.bar import Bar.

How to reproduce

I am unfortunately not able to reduce my setup to a minimal configuration without wasting several hours of setup time. The problem is likely in my setup, not a bug of importmagic but I'm hoping to get some indication to help me troubleshoot my setup by answering a few questions

Questions

  1. Where is the index file stored? Looking at the index might help me figure out why the symbols from my local project aren't discovered by importmagic.
  2. Is there any limitation that could likely prevent importmagic from discovering the symbols in my project? Some particular folder structure I should follow?
  3. Should it be possible for me make my local project appear as extra module by somehow specifying it to python.autoComplete.extraPaths? It only seems to work, with the caveats I mentioned above, when the path of some packages (folders) of my local project are specified in there.

Thanks for the help! It would be really lovely to be able to use this extension to its fullest capabilities!

Hiestaa avatar May 22 '19 19:05 Hiestaa

I have the same problem

milescui avatar Oct 11 '19 07:10 milescui