Skip to content

[IDE] Make Duo Chat aware of the current file

Problem to solve

Currently, users have to manually add the current file as context (using /include) or select lines of code when using Duo Chat in IDEs. This manual process is inefficient and doesn't align with user expectations, especially when frequently switching between different files.

Proposal

Automatically add the context of the current file when a user triggers Duo Chat. If a user selects specific lines within the file, these lines should be prioritized in the context, but the entire file should be included as well. This change aims to streamline the user experience and reduce the need for manual context selection.

  1. Automatic context addition: when a user opens Duo Chat, the context of the current file is automatically included without requiring manual selection
  2. Line selection prioritization: if a user selects specific lines within the file, these lines are prioritized in the context provided by Duo Chat
  3. Full file inclusion: even when specific lines are selected, the entire file is still included in the context
  4. Show the current file as an included reference so the user understands it's inclusion and can even remove it as a source if they choose

Nice to have

  • Also include open tabs as context

Example

Screenshot_2025-05-21_at_3.48.45_PM

Intended users

Feature Usage Metrics

Tracking the usage of the context dropdown list could be a solution.

Does this feature require an audit event?

Edited by 🤖 GitLab Bot 🤖