-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: add filepath to apply prompt template vars #7681
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
Conversation
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 issue found across 1 file
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
|
|
||
| let overridePrompt: ChatMessage[] | undefined; | ||
| if (llm.promptTemplates?.apply) { | ||
| const filepath = getLastNPathParts(fileUri, 1); |
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.
Using getLastNPathParts on a URI can yield incorrect results for non-file schemes and ignores URI encoding; use the URI-aware basename helper instead.
Prompt for AI agents
Address the following comment on extensions/vscode/src/diff/vertical/manager.ts at line 436:
<comment>Using getLastNPathParts on a URI can yield incorrect results for non-file schemes and ignores URI encoding; use the URI-aware basename helper instead.</comment>
<file context>
@@ -432,9 +433,11 @@ export class VerticalDiffManager {
let overridePrompt: ChatMessage[] | undefined;
if (llm.promptTemplates?.apply) {
+ const filepath = getLastNPathParts(fileUri, 1);
const rendered = llm.renderPromptTemplate(llm.promptTemplates.apply, [], {
original_code: rangeContent,
</file context>
|
🎉 This PR is included in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
can now use {{{ filepath }}} in promptTemplates for apply
Summary by cubic
Enable {{{ filepath }}} in apply prompt templates so prompts can adapt to the current file. We pass the last path segment from fileUri as "filepath" to renderPromptTemplate alongside original_code and new_code.