pylance-release
pylance-release copied to clipboard
Don't append "py" on show call hierarchy view when source is a notebook file
Environment data
- Language Server version: 2024.4.104
- OS and version: linux x64 (Codespaces)
- Python version (and distribution if applicable, e.g. Anaconda): Python 3.10.13, venv
- python.analysis.indexing: true
- python.analysis.typeCheckingMode: basic
Code Snippet
Open a notebook file and add the following:
class Class:
# Single-line ranges (such as single-line functions) are not foldable.
def singleLineFunction(self): pass
def function1(self, name: str, address: str, title: str):
# Multiline strings can be folded, leaving only the first line visible.
"""Doc string
Doc string
"""
pass
Class().function1("", "", "")
Then right click on function1 at the last line and trigger "Show Call Hierarchy". Notice how the notebook file shows on the callers view with .py
appended to it
Type hierarchy also has this issue:
This is a slight improvement over these issues tracking the old behavior. I'll close them:
- https://github.com/microsoft/pylance-release/issues/3611
- https://github.com/microsoft/pylance-release/issues/5192
This issue has been fixed in prerelease version 2024.5.100, which we've just released. You can find the changelog here: CHANGELOG.md