Skip to content

Add call hierarchy feature #612

Closed
Closed

Description

@xster

Don't know if it's possible. It's possible to check a function's call hierarchy in IntelliJ. Is it possible to bring it to VSCode?

Activity

  1. DanTup commented on Feb 23, 2018

    @DanTup
    Member

    @bwilkerson I guess this would need support from the analyzer? I can't see anything in the docs that looks like it would provide this.

    @xster If we had the data, I'm not sure how we could best display this. We have implemented Type Heirarchy (F4?) but render it in a pick list and I think it looks a bit weird (being a tree in a flat list), see #190 (comment)

  2. added this to the Backlog milestone on Feb 23, 2018
  3. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    in editorRelates to code editing or language features
    on Feb 23, 2018
  4. bwilkerson commented on Feb 23, 2018

    @bwilkerson

    By call hierarchy, do you mean a tree where the top-level nodes are all of the methods containing invocations of a selected method, and the children of each node are the methods containing invocations of the parent node?

    If so, then it's all done lazily. Each level in the tree is fetched (by searching for references to an element) when the parent node is expanded. It is done this way both for performance and in order to deal with recursive chains of functions. The result isn't strictly a call hierarchy, it's a reference hierarchy, but the distinction is subtle and not interesting to most users.

  5. DanTup commented on Feb 23, 2018

    @DanTup
    Member

    Aha, makes sense! I guess we can't wedge it into a picker like we did for types then; it'd have to go in the explorer (tree).

  6. xster commented on Feb 23, 2018

    @xster
    Author

    I wonder if it's possible to augment the Find all References peek window and make each descendent node also expandable.

  7. DanTup commented on Feb 23, 2018

    @DanTup
    Member

    We can't really control this, since Code does all rendering here. However, I think you can do another Find References inside the peek window?

  8. DanTup commented on Nov 15, 2018

    @DanTup
    Member

    This makes most sense implemented in VS Code - there's an issue at microsoft/vscode#16110.

  9. 34 remaining items

  10. bsutton commented on Jul 18, 2022

    @bsutton

    So how do I trigger the call hierarchy?

    I'm running dart 2.180.271.0.dev
    I'm running dartr code 3.44.0
    restarted vscode.
    image

    I've tried 'find all references'

    Screencast.from.18-07-22.12.33.46.webm
  11. DanTup commented on Jul 18, 2022

    @DanTup
    Member

    @bsutton v2.180.271.0.dev looks like a branch made for a beta build (see flutter/flutter#107564) and forked before the change above. When using a newer version that does include the change, Call Hierarchy will appear on the context menu:

    Screenshot 2022-07-18 at 11 01 30

  12. bsutton commented on Jul 18, 2022

    @bsutton

    @DanTup
    Do you have a version no. that you know should work:
    I've tried:
    2.18.0-263.0.dev
    2.18.0-250.0.dev
    2.18.0-271.0.dev

    none of which show the menu.

  13. DanTup commented on Jul 18, 2022

    @DanTup
    Member

    According to the tags shown on the commit, the following versions include it:

    • 2.19.0-5.0.dev
    • 2.19.0-4.0.dev
    • 2.19.0-3.0.dev
    • 2.19.0-2.0.dev
    • 2.19.0-1.0.dev
    • 2.19.0-0.0.dev
    • 2.18.0-286.0.dev
    • 2.18.0-285.0.dev
    • 2.18.0-284.0.dev

    I don't know whether those 2.18 dev versions are just automatic tags though. Based on the issue linked above about branching for a beta release (which was before any of those branches), I suspect this change would not show up if that beta branch became a stable 2.18 release, instead being included in a future version.

    Note: Right now it seems dart.dev also stops at 2.18.0-271.0.dev which may be because of branching. If you want to test with a bleeding-edge build (not recommended for general production work) there's info here:

    https://dart.dev/get-dart/archive#main-channel-url-scheme

    For example for macOS:

    https://storage.googleapis.com/dart-archive/channels/be/raw/latest/sdk/dartsdk-macos-x64-release.zip for Intel or https://storage.googleapis.com/dart-archive/channels/be/raw/latest/sdk/dartsdk-macos-arm64-release.zip for M1.

  14. modified the milestones: v3.46.0, v3.48.0 on Aug 1, 2022
  15. modified the milestones: v3.48.0, v3.50.0 on Aug 23, 2022
  16. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Sep 6, 2022
  17. bsutton commented on Oct 11, 2022

    @bsutton
  18. DanTup commented on Oct 11, 2022

    @DanTup
    Member

    I'm not sure what "archive channels" means in this context, but FWIW the latest Dart beta on https://dart.dev/get-dart/archive is 2.19.0-255.2.beta which should definitely include it. So if you're able to use beta releases (and not only stable releases) then it should be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions