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

Find in Outline View not working #233185

Closed
chrispy-snps opened this issue Nov 6, 2024 · 9 comments · Fixed by #232964
Closed

Find in Outline View not working #233185

chrispy-snps opened this issue Nov 6, 2024 · 9 comments · Fixed by #232964
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders
Milestone

Comments

@chrispy-snps
Copy link

chrispy-snps commented Nov 6, 2024

The "Show Call Hierarchy" is an amazingly useful feature for understanding code structure! But sometimes it can display too much information.

Let's say I want to understand how Python's pprint.pprint() function works. If I perform the following steps:

  1. Enter the following Python code in VSCode:

    import pprint
    
    pprint.pprint("hello world")
  2. Right-click the pprint("hello world") function call and choose "Show Call Hierarchy".

  3. Click the "Show Outgoing Calls" button at the top-right of the call history view:

    Image

I can explore the call hierarchy to get results as follows (apologies for length, but it's sort of the the point):

Image

The functions and methods defined by the pprint module are in there, but they are obscured among a sea of Python built-in dataclass/typing/etc. entries.

It would be extremely useful to have some way to filter the results by scope and/or file.

@gjsjohnmurray
Copy link
Contributor

Perhaps some upcoming improvements to the tree find feature (Ctrl+Alt+F) so it can filter on folder names, not just leaf names, may help here. Pinging @benibenj

@jrieken
Copy link
Member

jrieken commented Nov 6, 2024

We do have find/filter in there but it looks like it's broken...

Image

@jrieken jrieken assigned alexr00 and benibenj and unassigned jrieken Nov 6, 2024
@chrispy-snps
Copy link
Author

@jrieken - interesting, how did you get that dialog? It's not shown for me (at least not obviously).

@jrieken
Copy link
Member

jrieken commented Nov 6, 2024

Ctrl+Alt+F (macOS: Cmd+Alt+F)

@chrispy-snps
Copy link
Author

Thanks @jrieken! I did not know about that shortcut.

Unfortunately it appears to operate only on the item text, whereas the requested enhancement would need to consider information not shown in that text (class scope, file name, etc.).

@gjsjohnmurray
Copy link
Contributor

it looks like it's broken...

The original tree find's filter mode displays unresolved folders regardless of whether or not their names match, so you can expand (i.e. resolve) them. When a non-matching folder has been resolved and contains no unresolved child folders it will get filtered out unless any of its leaf children match.

Recent work by @benibenj in the Explorer tree reworked this behaviour, but AFAIK (a) the new filtering only looks at leaf nodes (i.e. in the Explorer case, filenames), and (b) is (or maybe will be) an opt-in for other instances of the tree.

@benibenj
Copy link
Contributor

benibenj commented Nov 7, 2024

The Outline view is not an async tree, meaning this should just work out of the box. There seems to be a bug which I have a fix for.

@benibenj benibenj changed the title Enhance "Show Call Hierarchy" to provide filtering by scope/file Find in Outline View not working Nov 7, 2024
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Nov 7, 2024
@vs-code-engineering vs-code-engineering bot added this to the November 2024 milestone Nov 7, 2024
@chrispy-snps
Copy link
Author

@benibenj - appreciate the fix, but how does this apply to filtering by scope (e.g., functions in the current file/class versus those in other files/classes or built-in functions?

@vs-code-engineering vs-code-engineering bot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Nov 8, 2024
@benibenj
Copy link
Contributor

benibenj commented Nov 8, 2024

I created this feature request to handle your use case: #233394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
insiders-released Patch has been released in VS Code Insiders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants