Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlinks are not taken into account with "find references" #6888

Open
AlexeyDmitriev opened this issue Jan 24, 2025 · 0 comments
Open

Symlinks are not taken into account with "find references" #6888

AlexeyDmitriev opened this issue Jan 24, 2025 · 0 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@AlexeyDmitriev
Copy link

Describe the bug

My org uses symlinks to reference shared code that can be imported by multiple python executables. When finding references to a symbol in the shared code I get different results depending on what file I request the reference lookup from.

Code or Screenshots

mkdir -p pyright_issue/shared_lib
cd pyright_issue
mkdir executables
mkdir executables/exe1
mkdir executables/exe2
ln -s $PWD/shared_lib $PWD/executables/exe1
ln -s $PWD/shared_lib $PWD/executables/exe2
echo 'foo = 123' > shared_lib/bar.py
echo 'from shared_lib.bar import foo' > executables/exe1/main.py
echo 'from shared_lib.bar import foo' > executables/exe2/main.py
$ cd pyright_issue
$ tree
.
├── executables
│   ├── exe1
│   │   ├── main.py
│   │   └── shared_lib -> /abs/path/pyright_issue/shared_lib
│   └── exe2
│       ├── main.py
│       └── shared_lib -> /abs/path/pyright_issue/shared_lib
└── shared_lib
    └── bar.py


7 directories, 3 files

When finding references for foo in shared_lib/bar.py I get:

shared_lib/bar.py|1 col 1-4| foo = 123

In executables/exe1/main.py I get:

executables/exe1/main.py|1 col 28-31| from shared_lib.bar import foo
shared_lib/bar.py|1 col 1-4| foo = 123

And in executables/exe2/main.py I get:

executables/exe2/main.py|1 col 28-31| from shared_lib.bar import foo
shared_lib/bar.py|1 col 1-4| foo = 123

VS Code extension or command-line
I'm using neovim and version 1.1.389 on Python 3.13.0

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 24, 2025
@microsoft microsoft deleted a comment from Shahid439-max Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants