Skip to content

feat: Provide file context to duo chat

Nicolas Dular requested to merge nd/provide-chat-file-context into main

Description

This adds context for duo chat message based on the current file's content. We add the selected text, file name, as well as the content before and after the selection.

This is required for code tasks where users can with quick actions perform tasks on the code, e.g. /test, /refactor or /explain.

Related MR for the graphql changes: gitlab!135717 (merged)

Related Issues

Resolves #1084 (closed)

How has this been tested?

Screenshots (if appropriate):

This is with code_tasks enabled on the backend, so the context gets injected to the prompt we send to the LLM.

Screen_Recording_2023-11-14_at_09.56.20

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Nicolas Dular

Merge request reports