-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
47 deletions.
There are no files selected for viewing
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
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
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
22 changes: 6 additions & 16 deletions
22
packages/ai-native/src/browser/contrib/intelligent-completions/intelligent-completions.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
import { isUndefined } from '@opensumi/ide-core-common'; | ||
import { InlineCompletion } from '@opensumi/ide-monaco'; | ||
|
||
export interface IIntelligentCompletionItem extends InlineCompletion { | ||
export interface IIntelligentCompletionsResult<T = any> { | ||
readonly items: InlineCompletion[]; | ||
/** | ||
* 表示当前行之前需要再补全几行 | ||
* 最大值为 3 | ||
* 是否开启多行补全 | ||
* 开启后,items 中的 range 必填 | ||
* 否则显示默认的 inline completion | ||
*/ | ||
aboveRadius?: number; | ||
/** | ||
* 表示当前行之后需要再补全几行 | ||
* 最大值为 3 | ||
*/ | ||
belowRadius?: number; | ||
} | ||
|
||
export interface IIntelligentCompletionsResult<T = any> { | ||
readonly items: IIntelligentCompletionItem[]; | ||
readonly enableMultiLine?: boolean | undefined; | ||
/** | ||
* 定义的额外信息 | ||
*/ | ||
extra?: T; | ||
} | ||
|
||
export const isMultiLineCompletion = (item: IIntelligentCompletionItem) => !isUndefined(item.aboveRadius) || !isUndefined(item.belowRadius); |
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