beicause / call-graph

Generate call graph for vscode in svg or graphviz dot.
Apache License 2.0
73 stars 17 forks source link

Add max depth configuration #23

Closed jotavemonte closed 1 month ago

jotavemonte commented 1 month ago

Summary

Add a Max Depth setting that controls the max depth for the graph. The default value "0" means it's limitless.

drawing

Changes

Testing

Reproducing

  1. Generate a build for the branch. I'll skip the details for this section.
  2. Add the testing code added at the end of this section.
  3. Try different max depth values and generate both outgoing and incoming call-graphs.

Evidences

drawing drawing drawing

Test code

function a() {
    b()
    b2()
}

function b() {
    c1()
    c3()
}

function b2() {
    c1()
    c2()
    c3()
}

function c1() {
    return "c1"
}

function c2() {
    return "c2"
}

function c3() {
    return "c3"
}
beicause commented 1 month ago

Thank you. I think seting max depth in settings is a bit inconvinent. What about inputing it in Quick Pick? https://code.visualstudio.com/api/ux-guidelines/quick-picks

jotavemonte commented 1 month ago

Thank you. I think seting max depth in settings is a bit inconvinent. What about inputing it in Quick Pick? https://code.visualstudio.com/api/ux-guidelines/quick-picks

Hey, since we don't have a max depth by default and it's not a core feature, wouldn't it degrade the UX to add one extra step to the graph generation? @beicause

beicause commented 1 month ago

Yeah, this feature is rarely used unless the project is large and takes long time to generate call graph. It's better to configure depth in settings.