Skip to content

add explainTree command returning ExplainTreeNode for visual explain data#493

Draft
shhhhreya wants to merge 1 commit intocodefori:mainfrom
shhhhreya:registerVisualExplainCommand
Draft

add explainTree command returning ExplainTreeNode for visual explain data#493
shhhhreya wants to merge 1 commit intocodefori:mainfrom
shhhhreya:registerVisualExplainCommand

Conversation

@shhhhreya
Copy link
Copy Markdown

@shhhhreya shhhhreya commented Jan 23, 2026

Summary

Adds a new VS Code command vscode-db2i.explain.explainTree which constructs an ExplainTree from the provided vedata and returns the generated top-level ExplainTreeNode to get structured visual explain data.

Changes

  • Registered new command: vscode-db2i.explain.explainTree
  • Reuses existing ExplainTree logic to generate the tree structure
  • Returns the top-level node via explainTree.get()
  • No new logic or functionality was implemented.
  • This change only exposes the existing logic through a newly registered command.

Why

This command is required for the BOB MCP tool to retrieve visual explain data in a proper structured format from vedata, so it can be rendered correctly in MCP tool.

@shhhhreya shhhhreya changed the title add explainTree command returning ExplainTreeNode add explainTree command returning ExplainTreeNode for visual explain data Jan 23, 2026
@worksofliam
Copy link
Copy Markdown
Member

I have explained this in other PRs, but we should be using a proper extension API for this functionality.

#480 (comment)

@SanjulaGanepola

Copy link
Copy Markdown
Member

@worksofliam worksofliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

@SanjulaGanepola SanjulaGanepola self-requested a review January 23, 2026 15:07
@SanjulaGanepola
Copy link
Copy Markdown
Member

@shhhhreya As Liam mentioned, lets avoid adding arbitrary commands just for our extension to use. We should always look to add to the exported API as this is the standard way of exposing logic to other extensions. You can sorta see an example here: #480

In this case, we should look into what APIs we want to expose related to Visual Explain.
FYI, we may want to look into getting in #422 before doing this. I will help with this

@SanjulaGanepola
Copy link
Copy Markdown
Member

You can find more info about exported APIs here: https://code.visualstudio.com/api/references/vscode-api#extensions. You can also refer to several of the other extensions to see how we structure this (check out Code for IBM i)

@SanjulaGanepola SanjulaGanepola marked this pull request as draft January 29, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants