pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Don't append "py" on show call hierarchy view when source is a notebook file

Open luabud opened this issue 10 months ago • 1 comments

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

image

luabud avatar Apr 27 '24 01:04 luabud

Type hierarchy also has this issue: image

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

debonte avatar Apr 27 '24 15:04 debonte

This issue has been fixed in prerelease version 2024.5.100, which we've just released. You can find the changelog here: CHANGELOG.md

KacieKK avatar May 09 '24 23:05 KacieKK