Support For Custom Import Statements
Answered
We use Python for our configuration system, but we also have many custom details (like file extensions) that make using PyCharm harder.
Whereas custom file type can be handled by adding it as a new Python file type, custom importing is a big pain point as it prevents PyCharm from proper reference resolving:
import_python("filename.conf", "*")
Will it be possible to contribute to the reference resolving process from a custom plugin, so our import statements are treated the same way as built-in ones?
Please sign in to leave a comment.
Hi there,
Do you mean making so that "import_python("filename.conf", "*")" call was treated as "from filename.conf import *"?
Honestly, I'm not sure that there is an existing extension pointat the moment that allows to declare that some custom call can serve as a replacement of standard import statement and is a source of multiple top-level names.
Yep, this is exactly what I meant.
Would it make sense to create a new EP specifically for our case? I could send a pull request if so.