Skip to content

Personalized Remote Code Context

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

Code Suggestions doesn't know about repositories that may be of interest but are outside the developer's current IDE workspace. To make Code Suggestions as accurate and helpful as possible, we need to make it remote context-aware, so it can use the code in a user's project and outside it to make better-informed suggestions.

We can decompose the problem into at least the following sub-problems:

  • Incorporating existing knowledge: How can relevant context a developer already knows about–such as files, function signatures, libraries, style guides, etc.–be incorporated?
  • Discovering and incorporating new information: How can relevant context a developer may not know about be incorporated?

Proposal

It should enable the following capabilities, which could be leveraged in both Code Suggestions and Duo:

  • Autocomplete: using exact lookup of symbols from local and remote repositories
  • Importing/adding context: including specific symbols, entire repositories, such as libraries, but also open files, imported files, with the ability to extend that list.
  • Auto-updating context: leverage editor state to update context when changes occur
  • Ranking context: make sure that the most relevant context is being used at any given time

To support the above we need a multi-repository context awareness system that:

  • Intelligently parses code
  • Embeds and indexes relevant blocks, with support for remote indexing so non-local repositories can be leveraged for context
  • Pulls context from multiple sources, such as open tabs, files in the same directory, files referenced in import statements, and other repositories, such as libraries
  • Reranks the query matches from those elements to select only the most relevant context
  • Takes the user's current context into account, such as which files are open, what are the imports to those files, what else is in the directory of the active file, etc.
Edited by 🤖 GitLab Bot 🤖