-
Notifications
You must be signed in to change notification settings - Fork 454
feat: refactor AI code completion with monacopilot and FIM support #1745
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
Open
SonyLeo
wants to merge
11
commits into
opentiny:develop
Choose a base branch
from
SonyLeo:feat/monacopilot
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dbee79b
feat(script): Add AI code completion with monacopilot integration
SonyLeo aadcfe7
feat(script): Refactor AI completion system with multi-model adapter …
SonyLeo 674fc63
feat(ai-completion): Enhance completion system with debounce manageme…
SonyLeo 0a229a6
feat(ai-completion): Remove debug console logs from adapters and util…
SonyLeo 32f9f33
feat(ai-completion): Simplify completion system and remove debounce m…
SonyLeo 9cbb592
feat(completion): Remove AI inline completion and context template
SonyLeo fcfeca9
feat(robot): Enhance model selection with code completion capabilities
SonyLeo fc69d6c
fix: review suggestion
SonyLeo cae9974
merge branch 'tiny/develop'
SonyLeo a0f2de8
feat(script): Add keyboard shortcut for code completion trigger
SonyLeo 7e25b0a
feat(ai-completion): Migrate DeepSeek adapter to FIM-based completion
SonyLeo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. 模型表现不一致的原因:
2. 当前方案的核心技术限制,具体原因如下:
根本原因:
FIM 模型的工作原理:
<fim_prefix>光标前的代码<fim_suffix>光标后的代码<fim_middle>FIM(Fill-In-the-Middle)模型的训练目标是在光标位置插入代码,而不是修改已有代码。模型的训练数据主要来自:
不包含:
技术对比:
3. 已实现快捷键功能,当前支持:
Shift + Ctrl + Space4. 当前函数之间可以补全调用和跳转
可以补全调用:AI 可以根据上下文补全其他函数的调用
支持跳转:monaco 默认支持函数定义跳转功能
5. 补全被过滤:
部分场景下补全未显示,这是由于 shouldTriggerCompletion 函数的过滤机制导致的。
过滤机制的设计目的
为了优化用户体验和降低 API 调用成本,系统会在以下场景主动过滤补全触发:
不触发补全的场景
设计考量