-
Notifications
You must be signed in to change notification settings - Fork 34
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
docs: update ai native module #149
Conversation
WalkthroughThe changes introduced enhancements to the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AiBackService
participant IProblemFixProviderRegistry
participant IIntelligentCompletionsRegistry
Client->>AiBackService: Register Problem Fix Feature
AiBackService->>IProblemFixProviderRegistry: registerProblemFixFeature()
Client->>AiBackService: Register Intelligent Completion Feature
AiBackService->>IIntelligentCompletionsRegistry: registerIntelligentCompletionFeature()
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
Outside diff range and nitpick comments (2)
docs/integrate/module-usage/ai-native-module.zh.md (2)
77-77
: Use a markdown heading instead of emphasis.Emphasis (##) is used instead of a proper markdown heading. Use a single # for a top-level heading.
-## 如何使用 +# 如何使用Tools
Markdownlint
77-77: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
462-543
: Consider adding more comments to the usage example.The usage example for
IIntelligentCompletionsRegistry
is quite long and complex. Consider adding more comments to explain the key steps and improve readability. For example:// Generate a random string of the specified length const getRandomString = (length) => { // ... }; // Randomly insert or delete characters in the original string const insertRandomStrings = (originalString) => { // ... }; // Simulate an asynchronous operation with a cancellable promise try { await new Promise((resolve, reject) => { // ... }); // Return the completion items and enable multi-line completion return { items: [ // ... ], enableMultiLine: true, }; } catch (error) { // Handle cancellation // ... }
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- docs/integrate/module-usage/ai-native-module.en.md (4 hunks)
- docs/integrate/module-usage/ai-native-module.zh.md (4 hunks)
Additional context used
Markdownlint
docs/integrate/module-usage/ai-native-module.zh.md
77-77: null
Emphasis used instead of a heading(MD036, no-emphasis-as-heading)
docs/integrate/module-usage/ai-native-module.en.md
153-153: Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe
Table pipe style(MD055, table-pipe-style)
152-152: Expected: 4; Actual: 1; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
153-153: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
LanguageTool
docs/integrate/module-usage/ai-native-module.zh.md
[uncategorized] ~211-~211: 您的意思是“"不"全”?
Context: ...ligentCompletionFeature | 注册智能代码补全相关功能 | IIntelligen...(BU)
[uncategorized] ~456-~456: 您的意思是“"不"全”?
Context: ...sterIntelligentCompletionProvider | 注册智能补全的提供者 | IIntelligentCompletionProvider |...(BU)
[uncategorized] ~458-~458: 您的意思是“"不"全”?
Context: ...ompletionProvider | void | 说明: 在返回的补全列表当中配置enableMultiLine
字段可开启多行补全的能力 ...(BU)
[uncategorized] ~458-~458: 您的意思是“"不"全”?
Context: ...: 在返回的补全列表当中配置enableMultiLine
字段可开启多行补全的能力 用例: ```typescript registerIntelli...(BU)
Additional comments not posted (7)
docs/integrate/module-usage/ai-native-module.zh.md (2)
423-450
: LGTM!The
IProblemFixProviderRegistry
interface and usage example are well-documented and easy to understand.
570-572
: LGTM!The description of the
supportsProblemFix
property is clear and concise.docs/integrate/module-usage/ai-native-module.en.md (5)
82-82
: LGTM!The change to implement the
IAIBackService
interface with specific generic types in theAiBackService
class is a good move towards more structured interactions with AI models.
354-381
: LGTM!The addition of the new section
IProblemFixProviderRegistry
and theregisterHoverFixProvider
method to the API documentation, along with the helpful example code snippet, looks great! This will provide clear guidance on how to register providers for problem diagnosis capabilities.
383-390
: LGTM!The addition of the new section
IIntelligentCompletionsRegistry
and theregisterIntelligentCompletionProvider
method to the API documentation looks great! The note about settingenableMultiLine
totrue
to enable multi-line completion is a helpful tip for users.
393-474
: LGTM!The example code snippet demonstrating the usage of the
registerIntelligentCompletionProvider
method looks good! The logic to generate random completions with delay and cancellation handling usingAbortController
is a helpful illustration, even though it's not meant for production use.
500-500
: LGTM!The addition of the new configuration item
supportsProblemFix
to theIAINativeCapabilities
interface to control whether to enable the AI problem diagnosis capability looks good!
| registerProblemFixFeature | | ||
Register smart repair related functions | IProblemFixProviderRegistry | void | |
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.
Fix the table formatting issues.
The addition of the new methods registerProblemFixFeature
and registerIntelligentCompletionFeature
to expand the functionality for problem diagnosis and smart code completion looks good!
However, there are some formatting issues with the table:
- Missing leading pipe in the table header row.
- Inconsistent number of cells in the table header and data rows.
Apply this diff to fix the formatting issues:
-| Method Name | Description | Parameter Type | Return Type |
-| registerProblemFixFeature |
-Register smart repair related functions | IProblemFixProviderRegistry | void |
+| Method Name | Description | Parameter Type | Return Type |
+| ------------------------------------- | ------------------------------------------------------------------- | --------------------------------- | ----------- |
+| registerProblemFixFeature | Register smart repair related functions | IProblemFixProviderRegistry | void |
| registerIntelligentCompletionFeature | Register for smart code completion related functions | IIntelligentCompletionsRegistry | void |
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| registerProblemFixFeature | | |
Register smart repair related functions | IProblemFixProviderRegistry | void | | |
| Method Name | Description | Parameter Type | Return Type | | |
| ------------------------------------- | ------------------------------------------------------------------- | --------------------------------- | ----------- | | |
| registerProblemFixFeature | Register smart repair related functions | IProblemFixProviderRegistry | void | | |
| registerIntelligentCompletionFeature | Register for smart code completion related functions | IIntelligentCompletionsRegistry | void | |
Tools
Markdownlint
153-153: Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe
Table pipe style(MD055, table-pipe-style)
152-152: Expected: 4; Actual: 1; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
153-153: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count(MD056, table-column-count)
Summary by CodeRabbit
New Features
Documentation