sourcegraph / scip-python

SCIP indexer for Python
Other
46 stars 21 forks source link

Inconsistent module paths in symbol names when using `from a.b import C` syntax #133

Open varungandhi-src opened 7 months ago

varungandhi-src commented 7 months ago

https://github.com/sourcegraph/scip-python/blob/scip/packages/pyright-scip/snapshots/output/nested_items/src/importer.py#L4-L6

from foo.bar import InitClass
#    ^^^^^^^ reference  snapshot-util 0.1 `foo.bar`/__init__:
#                   ^^^^^^^^^ reference  snapshot-util 0.1 `src.foo.bar`/InitClass#

The package name used should be consistent, so it should either be src.foo.bar or foo.bar based on the correct language semantics (e.g. if someone wrote src.foo.bar instead and that would work, then it should be src.foo.bar).

Originally flagged by @Titou325 here: https://github.com/sourcegraph/scip-python/issues/91#issuecomment-1801937885