-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(tabby-agent): add recent opened files frontend to code completion requests #3238
Merged
icycodes
merged 16 commits into
TabbyML:main
from
Sma1lboy:feat-recent-opened-files-frontend
Oct 14, 2024
Merged
feat(tabby-agent): add recent opened files frontend to code completion requests #3238
icycodes
merged 16 commits into
TabbyML:main
from
Sma1lboy:feat-recent-opened-files-frontend
Oct 14, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chore: add relevant snippets to client-open-api
refactor: Add LRUList class to track recently opened files This commit adds a new class called LRUList to track recently opened files in the FileTracker feature. The LRUList class provides methods for inserting, removing, updating, and retrieving files based on their URI. It also maintains a maximum size to limit the number of files stored. The LRUList class is used by the FileTracker feature to keep track of the most recently opened files. When a file is opened or its visibility changes, it is inserted or updated in the LRUList. The list is then pruned to remove the least recently used files if it exceeds the maximum size. This refactor improves the efficiency and organization of the FileTracker feature by separating the logic for tracking files into a dedicated class.
…e editors This commit adds a new class called FileTrackerProvider in the vscode/src directory. The FileTrackerProvider class is responsible for collecting visible editors and their visible ranges. It filters out editors that do not have a file name starting with a forward slash ("/"). The collected editors are then sorted based on their URI, with the active editor being prioritized. The FileTrackerProvider class also provides a method to collect the active editor, which returns the URI and visible range of the currently active text editor. These changes are part of the ongoing development of the FileTracker feature, which aims to track and manage recently opened files in the vscode extension. Ref: feat(fileTracker): adding file tracking provider in lsp server
…ed-files-frontend
…of snippets from recent opened files This commit enables the collection of snippets from recent opened files in the CompletionProvider class. It adds a new configuration option `collectSnippetsFromRecentOpenedFiles` to the default configuration, which is set to `true` by default. The maximum number of opened files to collect snippets from is set to 5. These changes are necessary to improve the code completion feature by including snippets from recently opened files. Ref: feat(recent-opened-files): enable collection of snippets from recent opened files
94e3671
to
86518aa
Compare
wsxiaoys
approved these changes
Oct 8, 2024
icycodes
requested changes
Oct 9, 2024
…vider. adding max chars size per opened files
chore: remove logger import
3fadc47
to
382f941
Compare
icycodes
approved these changes
Oct 14, 2024
icycodes
pushed a commit
that referenced
this pull request
Oct 17, 2024
…n requests (#3238) * feat(backend): adding open recent file segments chore: add relevant snippets to client-open-api * feat(protocol): add OpenedFileRequest namespace and types * feat: add FileTracker to code completion and server initialization * feat(fileTracker): adding file tracking provider in lsp server refactor: Add LRUList class to track recently opened files This commit adds a new class called LRUList to track recently opened files in the FileTracker feature. The LRUList class provides methods for inserting, removing, updating, and retrieving files based on their URI. It also maintains a maximum size to limit the number of files stored. The LRUList class is used by the FileTracker feature to keep track of the most recently opened files. When a file is opened or its visibility changes, it is inserted or updated in the LRUList. The list is then pruned to remove the least recently used files if it exceeds the maximum size. This refactor improves the efficiency and organization of the FileTracker feature by separating the logic for tracking files into a dedicated class. * feat(vscode): implement FileTrackerProvider class for tracking visible editors This commit adds a new class called FileTrackerProvider in the vscode/src directory. The FileTrackerProvider class is responsible for collecting visible editors and their visible ranges. It filters out editors that do not have a file name starting with a forward slash ("/"). The collected editors are then sorted based on their URI, with the active editor being prioritized. The FileTrackerProvider class also provides a method to collect the active editor, which returns the URI and visible range of the currently active text editor. These changes are part of the ongoing development of the FileTracker feature, which aims to track and manage recently opened files in the vscode extension. Ref: feat(fileTracker): adding file tracking provider in lsp server * feat(vscode): implement FileTrackerProvider class for tracking visible editors * feat: update snippet count check in extract_snippets_from_segments * feat: adding configuration to recently opened file enable collection of snippets from recent opened files This commit enables the collection of snippets from recent opened files in the CompletionProvider class. It adds a new configuration option `collectSnippetsFromRecentOpenedFiles` to the default configuration, which is set to `true` by default. The maximum number of opened files to collect snippets from is set to 5. These changes are necessary to improve the code completion feature by including snippets from recently opened files. Ref: feat(recent-opened-files): enable collection of snippets from recent opened files * [autofix.ci] apply automated fixes * refactor: using lru-cache package and passing config * fix: fixing typo, remove unuse type * refactor: remove action and rename the notification * feat(config): add maxCharsPerOpenedFiles to default config data. * refactor: optimize code snippet collection algorithm in CompletionProvider. adding max chars size per opened files * chore: remove unused log chore: remove logger import --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
icycodes
pushed a commit
that referenced
this pull request
Oct 17, 2024
…n requests (#3238) * feat(backend): adding open recent file segments chore: add relevant snippets to client-open-api * feat(protocol): add OpenedFileRequest namespace and types * feat: add FileTracker to code completion and server initialization * feat(fileTracker): adding file tracking provider in lsp server refactor: Add LRUList class to track recently opened files This commit adds a new class called LRUList to track recently opened files in the FileTracker feature. The LRUList class provides methods for inserting, removing, updating, and retrieving files based on their URI. It also maintains a maximum size to limit the number of files stored. The LRUList class is used by the FileTracker feature to keep track of the most recently opened files. When a file is opened or its visibility changes, it is inserted or updated in the LRUList. The list is then pruned to remove the least recently used files if it exceeds the maximum size. This refactor improves the efficiency and organization of the FileTracker feature by separating the logic for tracking files into a dedicated class. * feat(vscode): implement FileTrackerProvider class for tracking visible editors This commit adds a new class called FileTrackerProvider in the vscode/src directory. The FileTrackerProvider class is responsible for collecting visible editors and their visible ranges. It filters out editors that do not have a file name starting with a forward slash ("/"). The collected editors are then sorted based on their URI, with the active editor being prioritized. The FileTrackerProvider class also provides a method to collect the active editor, which returns the URI and visible range of the currently active text editor. These changes are part of the ongoing development of the FileTracker feature, which aims to track and manage recently opened files in the vscode extension. Ref: feat(fileTracker): adding file tracking provider in lsp server * feat(vscode): implement FileTrackerProvider class for tracking visible editors * feat: update snippet count check in extract_snippets_from_segments * feat: adding configuration to recently opened file enable collection of snippets from recent opened files This commit enables the collection of snippets from recent opened files in the CompletionProvider class. It adds a new configuration option `collectSnippetsFromRecentOpenedFiles` to the default configuration, which is set to `true` by default. The maximum number of opened files to collect snippets from is set to 5. These changes are necessary to improve the code completion feature by including snippets from recently opened files. Ref: feat(recent-opened-files): enable collection of snippets from recent opened files * [autofix.ci] apply automated fixes * refactor: using lru-cache package and passing config * fix: fixing typo, remove unuse type * refactor: remove action and rename the notification * feat(config): add maxCharsPerOpenedFiles to default config data. * refactor: optimize code snippet collection algorithm in CompletionProvider. adding max chars size per opened files * chore: remove unused log chore: remove logger import --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CC @wsxiaoys
This is the frontend part to #2664
Demo
Screen.Recording.2024-10-04.at.14.47.07.mov
Description
This PR introduces functionality to include recently opened files in the code suggestion buffer, enhancing context-aware code completion.
Feature Overview
Implementation Details
This implementation aims to provide more contextually relevant code suggestions by considering the user's recent file interactions.
Next Steps