Skip to content

Add Explain Directory feature for analyzing specific directories in l…#3

Merged
charleyRV merged 2 commits intomainfrom
nikhil-dev
Apr 9, 2026
Merged

Add Explain Directory feature for analyzing specific directories in l…#3
charleyRV merged 2 commits intomainfrom
nikhil-dev

Conversation

@charleyRV
Copy link
Copy Markdown
Collaborator

…arge repos

  • Add new "Explain Directory" command that focuses on a specific directory while maintaining repo context
  • Useful for monorepos with multiple projects/models in separate directories
  • Creates DirectoryAnalysisService to scan and analyze individual directories
  • Add scanDirectory method to RepoScanner for targeted directory scanning
  • Add buildDirectoryPrompt that instructs LLM to focus on directory while being aware of broader context
  • Add separate "Explain Directory" history category in sidebar
  • Fix refresh functionality to correctly re-analyze the same directory
  • Filter out empty, malformed, and code fence artifact cards from markdown parsing
  • Add directory cache source type with directoryPath tracking

nikhilmn7 and others added 2 commits April 9, 2026 14:42
…arge repos

- Add new "Explain Directory" command that focuses on a specific directory while maintaining repo context
- Useful for monorepos with multiple projects/models in separate directories
- Creates DirectoryAnalysisService to scan and analyze individual directories
- Add scanDirectory method to RepoScanner for targeted directory scanning
- Add buildDirectoryPrompt that instructs LLM to focus on directory while being aware of broader context
- Add separate "Explain Directory" history category in sidebar
- Fix refresh functionality to correctly re-analyze the same directory
- Filter out empty, malformed, and code fence artifact cards from markdown parsing
- Add directory cache source type with directoryPath tracking

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@charleyRV charleyRV merged commit b4f8752 into main Apr 9, 2026
2 of 3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e72b43eaf7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const relativePath = path.relative(folder.uri.fsPath, directoryPath);

// Scan only files within the specific directory
const pattern = `${relativePath}/**/*`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Normalize glob path before scanning directory

scanDirectory derives relativePath with path.relative and interpolates it directly into the glob passed to vscode.workspace.findFiles. On Windows this produces backslashes (for example src\api/**/*), but VS Code glob patterns are slash-based, so directory scans can return no files and the new Explain Directory flow yields empty context for Windows users.

Useful? React with 👍 / 👎.

Comment thread src/extension.ts
vscode.window.registerTreeDataProvider("codeExplainer.sidebar", sidebarProvider),
vscode.commands.registerCommand("codeExplainer.refreshSidebar", () => sidebarProvider.refresh()),
vscode.commands.registerCommand("codeExplainer.explainRepo", wrapCommand(explainRepo)),
vscode.commands.registerCommand("codeExplainer.explainDirectory", wrapCommand(explainDirectory)),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Contribute the new command to the extension manifest

The new command is only registered programmatically here, but there is no codeExplainer.explainDirectory contribution/activation in package.json, so it is not discoverable in the Command Palette and cannot be invoked from Explorer context with a folder URI. That makes the uri-based path in createExplainDirectoryCommand effectively unreachable for normal users and limits the feature to sidebar-triggered active-editor behavior.

Useful? React with 👍 / 👎.

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.

2 participants