Will providing a recursive AST/JSON dependency tree improve Cursor flow generation?

i! I’m working on documenting a large Angular project, and I often use Cursor to generate logical flow explanations of specific functions. This is super helpful — but sometimes, the generated flow misses certain internal or deeper dependencies that are essential to fully understanding how the function works.

To help with this, I’m considering generating a structured AST or JSON object ahead of time — representing a specific function and all of its dependencies recursively (including services, utility functions, context, and so on) — and then manually providing that to Cursor, either in the editor or as part of the prompt.

For example, imagine a function handleLogin that depends on several other functions and services, which in turn have their own dependencies:

{
  "function": "handleLogin",
  "content": "this.userService.login()",
  "deps": [
    {
      "function": "userService.login",
      "content": "this.authService.authenticate()",
      "deps": [
        {
          "function": "authService.authenticate",
          "content": "this.apiService.post()",
          "deps": [
            {
              "function": "apiService.post",
              "content": "fetch('/login')",
              "deps": []
            }
          ]
        }
      ]
    }
  ]
}

My question: would doing this help Cursor produce a more complete and accurate function flow for documentation purposes?