Skip to content

Commit db17106

Browse files
authored
Change attachment label from Current file to Current cell for notebooks (microsoft#248109)
1 parent f4fb3e7 commit db17106

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Button } from '../../../../../base/browser/ui/button/button.js';
99
import { getDefaultHoverDelegate } from '../../../../../base/browser/ui/hover/hoverDelegateFactory.js';
1010
import { Codicon } from '../../../../../base/common/codicons.js';
1111
import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
12+
import { Schemas } from '../../../../../base/common/network.js';
1213
import { basename, dirname } from '../../../../../base/common/resources.js';
1314
import { ThemeIcon } from '../../../../../base/common/themables.js';
1415
import { URI } from '../../../../../base/common/uri.js';
@@ -53,15 +54,15 @@ export class ImplicitContextAttachmentWidget extends Disposable {
5354
dom.clearNode(this.domNode);
5455
this.renderDisposables.clear();
5556

56-
const attachmentTypeName = (this.attachment.isPromptFile === false)
57-
? localize('file.lowercase', "file")
58-
: localize('prompt.lowercase', "prompt");
59-
6057
this.domNode.classList.toggle('disabled', !this.attachment.enabled);
6158
const label = this.resourceLabels.create(this.domNode, { supportIcons: true });
6259
const file = URI.isUri(this.attachment.value) ? this.attachment.value : this.attachment.value!.uri;
6360
const range = URI.isUri(this.attachment.value) || !this.attachment.isSelection ? undefined : this.attachment.value!.range;
6461

62+
const attachmentTypeName = (this.attachment.isPromptFile === false)
63+
? file.scheme === Schemas.vscodeNotebookCell ? localize('cell.lowercase', "cell") : localize('file.lowercase', "file")
64+
: localize('prompt.lowercase', "prompt");
65+
6566
const fileBasename = basename(file);
6667
const fileDirname = dirname(file);
6768
const friendlyName = `${fileBasename} ${fileDirname}`;

0 commit comments

Comments
 (0)