-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Environment data
- VS Code version: 1.27.2
- Extension version (available under the Extensions sidebar): 2018.8.0
- OS and version: Mac OS 10.13.6
- Python version (& distribution if applicable, e.g. Anaconda): XXX
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
- Relevant/affected Python packages and their versions: Python 3.6
Actual behavior
"Go to definition" looks in the wrong path in the root of the repository, when its name matches the file in the currently opened folder.
This only happens, when the project is a subfolder of a repository. If the .git
folder is removed, it works as expected.
Maybe this is related to issue 2555? Using the language server with "python.jediEnabled": false
also avoids this problem.
Expected behavior
Ignore files in the root of the repository, if outside of project (or reduce priority).
Steps to reproduce:
Given the following folders:
.git
project/
.vscode/
settings.json
main.py
utils.py
utils.py
- Open the folder
project/
in vscode - Open the file
main.py
- Use "Go to definition" on
import utils
vscode jumps to /utils.py
instead of project/utils.py
, even though it is outside the project.
If the /.git
folder is removed, it works as expected. Running python main.py
works as expected in any case.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
##########Linting Output - pylint##########
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
(no output)