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

[FEATURE] Intelligent Completion API 设计变更 #4104

Open
Ricbet opened this issue Oct 17, 2024 · 1 comment
Open

[FEATURE] Intelligent Completion API 设计变更 #4104

Ricbet opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
🎨 feature feature required

Comments

@Ricbet
Copy link
Member

Ricbet commented Oct 17, 2024

为了更好的区分传统的代码补全和 Code Edits 相关的代码编辑补全(表现形式是 多行补全 或 智能重写)
两者在 API 的设计上需要做个区分,避免混淆


在之前的 API 当中,会将 “多行补全” 和 “传统代码补全” 都写在同一个 provider 里,仅仅只是用 enableMultiLine 作为标识符来做区分
例:

registerIntelligentCompletionFeature(registry: IIntelligentCompletionsRegistry): void {
  registry.registerIntelligentCompletionProvider(async (editor, position, bean, token) => {
    // ...
     return {
      items: [
        {
          insertText
          range,
        },
      ],
      enableMultiLine: true,
    };
  });
}

现在将弃用这种使用方式,具体变动如下

  1. registerIntelligentCompletionProvider 将进入 deprecated 阶段,并重命名为 registerInlineCompletionsProvider,删除 enableMultiLine 标识符,其余不变
  2. 新增 registerCodeEditsProvider,接管原先的多行补全逻辑,具体参数和返回值待补充
@Ricbet Ricbet added the 🎨 feature feature required label Oct 17, 2024
@Ricbet Ricbet self-assigned this Oct 17, 2024
@Ricbet
Copy link
Member Author

Ricbet commented Oct 18, 2024

关于 Code Edits API 的不同行为触发规则

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

No branches or pull requests

1 participant