|
4 | 4 | *--------------------------------------------------------------------------------------------*/ |
5 | 5 |
|
6 | 6 | import * as dom from '../../../../../base/browser/dom.js'; |
| 7 | +import { ActionBar, ActionsOrientation } from '../../../../../base/browser/ui/actionbar/actionbar.js'; |
7 | 8 | import { ButtonWithIcon } from '../../../../../base/browser/ui/button/button.js'; |
| 9 | +import { IListRenderer, IListVirtualDelegate } from '../../../../../base/browser/ui/list/list.js'; |
| 10 | +import { Codicon } from '../../../../../base/common/codicons.js'; |
| 11 | +import { Emitter, Event } from '../../../../../base/common/event.js'; |
8 | 12 | import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../../base/common/lifecycle.js'; |
| 13 | +import { MarshalledId } from '../../../../../base/common/marshallingIds.js'; |
| 14 | +import { ThemeIcon } from '../../../../../base/common/themables.js'; |
9 | 15 | import { URI } from '../../../../../base/common/uri.js'; |
10 | 16 | import { localize } from '../../../../../nls.js'; |
| 17 | +import { IMenuService, MenuId } from '../../../../../platform/actions/common/actions.js'; |
| 18 | +import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; |
| 19 | +import { FileKind } from '../../../../../platform/files/common/files.js'; |
11 | 20 | import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; |
12 | | -import { IChatContentPart } from './chatContentParts.js'; |
13 | | -import { IChatMultiDiffData } from '../../common/chatService.js'; |
14 | | -import { ChatTreeItem } from '../chat.js'; |
15 | | -import { IResourceLabel, ResourceLabels } from '../../../../browser/labels.js'; |
16 | 21 | import { WorkbenchList } from '../../../../../platform/list/browser/listService.js'; |
17 | | -import { IListRenderer, IListVirtualDelegate } from '../../../../../base/browser/ui/list/list.js'; |
18 | | -import { FileKind } from '../../../../../platform/files/common/files.js'; |
19 | | -import { createFileIconThemableTreeContainerScope } from '../../../files/browser/views/explorerView.js'; |
20 | 22 | import { IThemeService } from '../../../../../platform/theme/common/themeService.js'; |
21 | | -import { IEditSessionEntryDiff } from '../../common/chatEditingService.js'; |
| 23 | +import { IResourceLabel, ResourceLabels } from '../../../../browser/labels.js'; |
22 | 24 | import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from '../../../../services/editor/common/editorService.js'; |
| 25 | +import { createFileIconThemableTreeContainerScope } from '../../../files/browser/views/explorerView.js'; |
23 | 26 | import { MultiDiffEditorInput } from '../../../multiDiffEditor/browser/multiDiffEditorInput.js'; |
24 | 27 | import { MultiDiffEditorItem } from '../../../multiDiffEditor/browser/multiDiffSourceResolverService.js'; |
25 | | -import { Codicon } from '../../../../../base/common/codicons.js'; |
26 | | -import { ThemeIcon } from '../../../../../base/common/themables.js'; |
27 | | -import { IChatRendererContent } from '../../common/chatViewModel.js'; |
28 | | -import { Emitter, Event } from '../../../../../base/common/event.js'; |
29 | | -import { IMenuService, MenuId } from '../../../../../platform/actions/common/actions.js'; |
30 | | -import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; |
31 | | -import { ActionBar, ActionsOrientation } from '../../../../../base/browser/ui/actionbar/actionbar.js'; |
32 | | -import { MarshalledId } from '../../../../../base/common/marshallingIds.js'; |
33 | 28 | import { ChatContextKeys } from '../../common/chatContextKeys.js'; |
| 29 | +import { IEditSessionEntryDiff } from '../../common/chatEditingService.js'; |
| 30 | +import { IChatMultiDiffData } from '../../common/chatService.js'; |
| 31 | +import { IChatRendererContent } from '../../common/chatViewModel.js'; |
| 32 | +import { ChatTreeItem } from '../chat.js'; |
| 33 | +import { ChatEditorInput } from '../chatEditorInput.js'; |
| 34 | +import { getChatSessionType } from '../chatSessions/common.js'; |
| 35 | +import { IChatContentPart } from './chatContentParts.js'; |
34 | 36 |
|
35 | 37 | const $ = dom.$; |
36 | 38 |
|
@@ -135,18 +137,15 @@ export class ChatMultiDiffContentPart extends Disposable implements IChatContent |
135 | 137 | const setupActionBar = () => { |
136 | 138 | actionBar.clear(); |
137 | 139 |
|
138 | | - const activeEditorUri = this.editorService.activeEditor?.resource; |
139 | 140 | let marshalledUri: any | undefined = undefined; |
140 | 141 | let contextKeyService: IContextKeyService = this.contextKeyService; |
141 | | - if (activeEditorUri) { |
142 | | - const { authority } = activeEditorUri; |
143 | | - const overlay: [string, unknown][] = []; |
144 | | - if (authority) { |
145 | | - overlay.push([ChatContextKeys.sessionType.key, authority]); |
146 | | - } |
147 | | - contextKeyService = this.contextKeyService.createOverlay(overlay); |
| 142 | + if (this.editorService.activeEditor instanceof ChatEditorInput) { |
| 143 | + contextKeyService = this.contextKeyService.createOverlay([ |
| 144 | + [ChatContextKeys.sessionType.key, getChatSessionType(this.editorService.activeEditor)] |
| 145 | + ]); |
| 146 | + |
148 | 147 | marshalledUri = { |
149 | | - ...activeEditorUri, |
| 148 | + ...this.editorService.activeEditor.resource, |
150 | 149 | $mid: MarshalledId.Uri |
151 | 150 | }; |
152 | 151 | } |
|
0 commit comments