diff --git a/src/vs/workbench/contrib/void/browser/chatThreadService.ts b/src/vs/workbench/contrib/void/browser/chatThreadService.ts index 3b6104c8..9092f38e 100644 --- a/src/vs/workbench/contrib/void/browser/chatThreadService.ts +++ b/src/vs/workbench/contrib/void/browser/chatThreadService.ts @@ -910,28 +910,40 @@ class ChatThreadService extends Disposable implements IChatThreadService { const doesUriMatchTarget = (uri: URI) => uri.path.includes(target) - // check if any prevFiles are the `codespanSearch` + // check if any prevFiles are the `target` for (const [idx, uri] of prevUris.entries()) { if (doesUriMatchTarget(uri)) { // shorten it + + // TODO make this logic more general const prevUriStrs = prevUris.map(uri => uri.toString()) const shortenedUriStrs = shorten(prevUriStrs) - const displayText = shortenedUriStrs[idx] + let displayText = shortenedUriStrs[idx] + const ellipsisIdx = displayText.lastIndexOf('…/'); + if (ellipsisIdx >= 0) { + displayText = displayText.slice(ellipsisIdx + 2) + } return { uri, displayText } } } - // else search codebase for file + // else search codebase for `target` const { uris } = await this._toolsService.callTool['pathname_search']({ queryStr: target, pageNumber: 0 }) for (const [idx, uri] of uris.entries()) { if (doesUriMatchTarget(uri)) { + // TODO make this logic more general const prevUriStrs = prevUris.map(uri => uri.toString()) const shortenedUriStrs = shorten(prevUriStrs) - const displayText = shortenedUriStrs[idx] + let displayText = shortenedUriStrs[idx] + const ellipsisIdx = displayText.lastIndexOf('…/'); + if (ellipsisIdx >= 0) { + displayText = displayText.slice(ellipsisIdx + 2) + } + return { uri, displayText } } diff --git a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx index 09078700..caa26bf8 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx @@ -99,6 +99,7 @@ const CodespanWithLink = ({ text, rawText, chatMessageLocation }: { text: string } return