Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Completion Quality - Ideas #2674

Open
2 of 6 tasks
wsxiaoys opened this issue Jul 17, 2024 · 3 comments
Open
2 of 6 tasks

Code Completion Quality - Ideas #2674

wsxiaoys opened this issue Jul 17, 2024 · 3 comments
Labels

Comments

@wsxiaoys
Copy link
Member

wsxiaoys commented Jul 17, 2024

Under construction

Since the release of version 0.13, the core functionality of code completion has become largely stable. This marks an opportune moment to consolidate current implementation and begin exploring for more enhancements

Prompt construction

Tabby generates code completion requests using the following information:

  • prefix: the code that precedes the cursor.
  • suffix: the code that follows the cursor.
  • lsp definitions: for the K identifiers located before the cursor, their definitions are retrieved using the IDE's internal LSP.
  • recently changed content: lines that have been recently modified (potentially from different files) within the current workspace.
  • repository-level relevant code snippets: relevant snippets are identified using the prefix and then scored with a combination of BM25 and embedding search algorithms.

It is important to note that prefix and suffix are guaranteed to be included in the LLM inference request, provided they exist. However, lsp definitions, recently changed content, and repository-level relevant code snippets are subject to the limitations of the context window, which is currently set to 1536 tokens. The priority in which these elements are filled corresponds to the order listed above.

To ensure low latency, we are currently using a relatively conservative max decoding tokens, 64.

Ideas

Server

Agent

IDE / Extensions

  • IntelliJ Platform: support LSP definitions
  • VIM / NeoVIM: support LSP definitions
@wsxiaoys wsxiaoys added enhancement New feature or request hotlist and removed enhancement New feature or request labels Jul 17, 2024
@wsxiaoys wsxiaoys changed the title Code Completion Quality - Current Status + Ideas Code Completion Quality - Ideas Jul 17, 2024
@wsxiaoys wsxiaoys pinned this issue Jul 17, 2024
@5bug
Copy link

5bug commented Jul 18, 2024

Agent:
Can the number of lines of context code support a dynamic mechanism that can take the lines of a complete definition or function? Would this enhance the model's understanding ability?

@5bug
Copy link

5bug commented Jul 21, 2024

IDE / Extensions:
Clipboard content is supported as a recommended reference

@lampewebdev
Copy link

Completion preview:
configure a min length for code shown to complete.
Sometimes when i press enter and want to press "TAB". Tabby in the same moment suggest }), which then i have to remove. So it would be nice to not suggest completions that are less then 3 chars or something I can configure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@wsxiaoys @5bug @lampewebdev and others