Skip to content

"Add to Chat" in Solution Explorer (@-mention files, multi-select) #30

Description

@firish

What

Add to Chat on the Solution Explorer right-click menu: select one or more files, right-click, and each gets @-mentioned into the CLI composer (whole-file, no line range). Multi-select supported.

Why

Pointing Claude at files it hasn't touched yet currently means dragging them to the panel's attach tray or typing @-paths in the terminal. The editor flyout from #27 covers the open file; this covers everything else — "look at these three files" becomes select + right-click.

Implementation notes

  • VSCT: a group under IDM_VS_CTXT_ITEMNODE (and consider IDM_VS_CTXT_XPROJ_MULTIITEM for cross-project multi-select). Remember the Add a "Claude Actions" editor context menu (Explain / Add to Chat) #27 lesson recorded in CLAUDE.md: a <Menu> needs an intermediate <Group>, and the Exp hive caches the compiled command table (devenv /rootsuffix Exp /updateconfiguration after .vsct edits).
  • Read the selected items via DTE.SelectedItems or IVsMonitorSelection; skip non-file nodes (projects, folders) in v1.
  • Per file: AttachmentService.ToWorkspaceRelative (made internal in Add a "Claude Actions" editor context menu (Explain / Add to Chat) #27) + the at_mentioned broadcast — SelectionService.MentionCurrentAsync shows the exact shape; a shared MentionFileAsync(path) helper would serve both.
  • Known CLI quirk applies (CLAUDE.md): mentions sent mid-turn can be silently dropped — consider routing through the attachment tray (chips) instead of bare mentions so users get the click-to-re-mention affordance for free.

Came out of the #27 review. @DaveTseng2019 — this one is well-scoped and self-contained, and you already know the mention path from #27; it's yours if you want it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions