-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add support for Fenced type in def function and fix snippet content extraction in blog generator #681
Conversation
…xtraction in blog generator
The pull request primarily introduces the ability to handle These changes look good overall, I don't see any issues with the introduced logic. However, it's important to ensure the LGTM 🚀
|
{ filename: "", content: (body as Fenced).content }, | ||
{ language: fenced.language, ...(doptions || {}) } | ||
) | ||
) |
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 is no error handling for the case when body
is an object but does not have a content
property. This could lead to unexpected behavior or crashes. Consider adding error handling or a default case. 😊
generated by pr-review-commit
missing_error_handling
@@ -1451,7 +1451,7 @@ interface ChatTurnGenerationContext { | |||
fence(body: StringLike, options?: FenceOptions): void | |||
def( | |||
name: string, | |||
body: string | WorkspaceFile | WorkspaceFile[] | ShellOutput, | |||
body: string | WorkspaceFile | WorkspaceFile[] | ShellOutput | Fenced, |
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.
The type Fenced
is used but not defined in this file or imported from another file. This could lead to confusion or errors. Please ensure that all types are properly defined or imported. 😊
generated by pr-review-commit
missing_type_definition
@@ -51,7 +51,7 @@ declare function fence(body: StringLike, options?: FenceOptions): void | |||
*/ | |||
declare function def( | |||
name: string, | |||
body: string | WorkspaceFile | WorkspaceFile[] | ShellOutput, | |||
body: string | WorkspaceFile | WorkspaceFile[] | ShellOutput | Fenced, |
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.
The type Fenced
is used but not defined in this file or imported from another file. This could lead to confusion or errors. Please ensure that all types are properly defined or imported. 😊
generated by pr-review-commit
missing_type_definition
This pull request adds support for the Fenced type in the
def
function and fixes the snippet content extraction in the blog generator. The changes include modifying thedef
function to accept the Fenced type as a parameter and updating the blog generator to correctly extract the content from fenced snippets. These changes improve the functionality and accuracy of the code.In the
runpromptcontext.ts
file, a new conditional block has been added that caters tobody
objects of typeFenced
🚧. Ifbody
is an object and has acontent
property, a newDefNode
is created and appended to the node. The language and other options are passed while creating theDefNode
🎨.For the
def
method in bothprompt_template.d.ts
andprompt_type.d.ts
(your user-facing API files 👥), thebody
argument's type lineup has a new entrant -Fenced
🎟. While the function could earlier receive a string or a file or an array of files from the workspace, or aShellOutput
, it can now also accept an object of typeFenced
🔧.Get ready to interact with
Fenced
objects in a whole new way! 🚀