Closed nashid closed 10 months ago
Pylsp is only a wrapper over several Python code completion and linting libraries. In this case Jedi is used to get definitions.
So, please ask in its repo if Jedi supports star imports (I guess not and that's why you don't get the definition you want).
I've been using the
python-lsp-server
to analyze a Python project and extract symbol definitions and references. The server works well for explicit imports, but I've encountered an issue when dealing with wildcard imports (import *
).Example:
Consider the following code structure:
When I try to resolve the
check_files_in_directory
function inmain.py
using the LSP server, it fails to determine its origin due to the wildcard import.What I've tried:
from utils import check_files_in_directory
.Question:
Is there a way to make
python-lsp-server
resolve symbols imported with wildcard imports effectively? I understand wildcard imports can be challenging for static analysis tools since they obfuscate the origin of symbols. *Do I have to set some configuration? For my case, even if it the analysis takes time and it is slow to resolve it, that is not a problem.*