[VS Code] Enhanced Code Suggestions with Retrieving the Content of Opened Files
Problem to solve
GitLab VS Code extension currently experience limited code suggestions that are only based on the content of the active file within GitLab's Web IDE or VS Code. This narrow context often results in suggestions that are less accurate and may not align with the broader scope of the user's project. Coders frequently reference multiple files and external sources, switching contexts which is not captured by the current suggestion mechanism.
A key challenge is to enhance the relevancy and precision of code suggestions to improve developer efficiency and workflow. Enhancing code suggestions can significantly reduce cognitive load and time spent searching for related code snippets across different files or tabs.
Proposal
GitLab workflow can implement an advanced prompt system similar to the one utilized by Cody/Sourcegraph. This system should incorporate a Jaccard similarity retriever algorithm as well as bfg or graph retriever to analyze the code in all opened tabs in the user's IDE. By doing so, it will:
- Extend the contextual understanding from one file to an entire session of work.
- Provide suggestions based on the relevance of code in other parts of the project.
- Increase the likelihood of offering useful code snippets improving overall coding efficiency.
The main goal is to create a more intelligent and context-aware code suggestion system that aids developers by considering the broader context of their ongoing work.
Further details
Besides Jaccard similarity, we can also consider incorporating AI models that predict code relevance based on variable names, function calls, and import statements across different tabs. Performance Optimization: Since performance is crucial, implement caching mechanisms and ensure low-latency retrieval of relevant code snippets.
Links / references
sourcegraph/cody Implementing the Jaccard Similarity Retriever for Autocompletion
sourcegraph/cody Implementing the bfg Retriever for Autocompletion