Skip to content

Commit 8d6cd4a

Browse files
committed
feat @-mention window path style & file with space
1 parent a414c7d commit 8d6cd4a

File tree

20 files changed

+795
-224
lines changed

20 files changed

+795
-224
lines changed

src/core/Cline.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3707,14 +3707,16 @@ export class Cline extends EventEmitter<ClineEvents> {
37073707
// 2. ToolResultBlockParam's content/context text arrays if it contains "<feedback>" (see formatToolDeniedFeedback, attemptCompletion, executeCommand, and consecutiveMistakeCount >= 3) or "<answer>" (see askFollowupQuestion), we place all user generated content in these tags so they can effectively be used as markers for when we should parse mentions)
37083708
Promise.all(
37093709
userContent.map(async (block) => {
3710+
const { osInfo } = (await this.providerRef.deref()?.getState()) || { osInfo: "unix" }
3711+
37103712
const shouldProcessMentions = (text: string) =>
37113713
text.includes("<task>") || text.includes("<feedback>")
37123714

37133715
if (block.type === "text") {
37143716
if (shouldProcessMentions(block.text)) {
37153717
return {
37163718
...block,
3717-
text: await parseMentions(block.text, this.cwd, this.urlContentFetcher),
3719+
text: await parseMentions(block.text, this.cwd, this.urlContentFetcher, osInfo),
37183720
}
37193721
}
37203722
return block
@@ -3723,7 +3725,12 @@ export class Cline extends EventEmitter<ClineEvents> {
37233725
if (shouldProcessMentions(block.content)) {
37243726
return {
37253727
...block,
3726-
content: await parseMentions(block.content, this.cwd, this.urlContentFetcher),
3728+
content: await parseMentions(
3729+
block.content,
3730+
this.cwd,
3731+
this.urlContentFetcher,
3732+
osInfo,
3733+
),
37273734
}
37283735
}
37293736
return block
@@ -3737,6 +3744,7 @@ export class Cline extends EventEmitter<ClineEvents> {
37373744
contentBlock.text,
37383745
this.cwd,
37393746
this.urlContentFetcher,
3747+
osInfo,
37403748
),
37413749
}
37423750
}

src/core/__tests__/Cline.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@ describe("Cline", () => {
10231023
"<task>Text with @/some/path in task tags</task>",
10241024
expect.any(String),
10251025
expect.any(Object),
1026+
expect.any(String),
10261027
)
10271028

10281029
// Feedback tag content should be processed
@@ -1033,6 +1034,7 @@ describe("Cline", () => {
10331034
"<feedback>Check @/some/path</feedback>",
10341035
expect.any(String),
10351036
expect.any(Object),
1037+
expect.any(String),
10361038
)
10371039

10381040
// Regular tool result should not be processed

0 commit comments

Comments
 (0)