-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
This appears to be regression of https://github.com/DonJayamanne/pythonVSCode/issues/742
Environment data
- VS Code version: 1.22.2 and 1.23.0
- Extension version: 2018.4.0 (edit: confirmed not an issue under 2018.3.1)
- OS and version: Ubuntu 16.04.4 LTS (Xenial)
- Python version: 2.7 and 3.5 tested
- Type of virtual environment used: None (for Python 2.7), virtualenvwrapper (for Python 3.5)
- Relevant/affected Python packages and their versions: —
Actual behavior
Navigating to definition of a decorated function shows the definition of the decorator.
Note: this only reproduces in a package and not in a single file.
In one sense I can see why this is happening -- the decorator is actually what the symbol in question really is. However, that is not a useful thing for an editor to do and I would much prefer to be shown the definition of the decorated function instead.
I believe this is also a regression as I've only noticed this behaviour recently (I think it started failing some time after the new year, but I'm not sure).
Expected behavior
(copied from https://github.com/DonJayamanne/pythonVSCode/issues/742)
Navigating to definition of a decorated function should show the function in question.
Steps to reproduce:
(copied from https://github.com/DonJayamanne/pythonVSCode/issues/742)
- Create a package with a decorated function in one file and a usage of that function in another. I've put an example at https://gist.github.com/PeterJCLaw/38b39e6ee7bfa0cd69e00ce984aebde3.
- Open VSCode to the directory containing the above files
- Open the usages file
- Navigate to the definition of the
my_context_managerfunction from either the import or the usage (I use Ctrl+Click, though F12 and the context menu also reproduce the issue) - Will navigate to the wrong place
This issue shows up for both class- and function-based decorators and for both local and standard-library decorators.
Logs
None from either the Output pane or the developer tools