Открыть боковую панель
code
vscode
Коммиты
58914601
Коммит
58914601
создал
5 мес. назад
по автору
Joyce Er
Просмотр файлов
Настройки
Скачать
Email-патчи
Простое отличие
feat: enable context menu for references list
владелец
e90a17d4
Branches недоступно
Не найдено связанных запросов на слияние
Изменения
1
Скрыть пробелы
Построчно
Рядом
Отображение
1 измененного файла
src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.ts
+34
-5
...hat/browser/chatContentParts/chatReferencesContentPart.ts
с
34 дополнений
и
5 удаления
+34
-5
src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.ts
+
34
-
5
Просмотр файла @
58914601
...
...
@@ -15,6 +15,8 @@ import { basenameOrAuthority, isEqualAuthority } from '../../../../../base/commo
import
{
ThemeIcon
}
from
'
../../../../../base/common/themables.js
'
;
import
{
URI
}
from
'
../../../../../base/common/uri.js
'
;
import
{
localize
}
from
'
../../../../../nls.js
'
;
import
{
IClipboardService
}
from
'
../../../../../platform/clipboard/common/clipboardService.js
'
;
import
{
IContextMenuService
}
from
'
../../../../../platform/contextview/browser/contextView.js
'
;
import
{
FileKind
}
from
'
../../../../../platform/files/common/files.js
'
;
import
{
IInstantiationService
}
from
'
../../../../../platform/instantiation/common/instantiation.js
'
;
import
{
WorkbenchList
}
from
'
../../../../../platform/list/browser/listService.js
'
;
...
...
@@ -23,14 +25,14 @@ import { IProductService } from '../../../../../platform/product/common/productS
import
{
IThemeService
}
from
'
../../../../../platform/theme/common/themeService.js
'
;
import
{
IResourceLabel
,
ResourceLabels
}
from
'
../../../../browser/labels.js
'
;
import
{
ColorScheme
}
from
'
../../../../browser/web.api.js
'
;
import
{
ChatTreeItem
}
from
'
../chat.js
'
;
import
{
IDisposableReference
,
ResourcePool
}
from
'
./chatCollections.js
'
;
import
{
IChatContentPart
}
from
'
./chatContentParts.js
'
;
import
{
SETTINGS_AUTHORITY
}
from
'
../../../../services/preferences/common/preferences.js
'
;
import
{
createFileIconThemableTreeContainerScope
}
from
'
../../../files/browser/views/explorerView.js
'
;
import
{
ChatResponseReferencePartStatusKind
,
IChatContentReference
,
IChatWarningMessage
}
from
'
../../common/chatService.js
'
;
import
{
IChatVariablesService
}
from
'
../../common/chatVariables.js
'
;
import
{
IChatRendererContent
,
IChatResponseViewModel
}
from
'
../../common/chatViewModel.js
'
;
import
{
createFileIconThemableTreeContainerScope
}
from
'
../../../files/browser/views/explorerView.js
'
;
import
{
SETTINGS_AUTHORITY
}
from
'
../../../../services/preferences/common/preferences.js
'
;
import
{
ChatTreeItem
}
from
'
../chat.js
'
;
import
{
IDisposableReference
,
ResourcePool
}
from
'
./chatCollections.js
'
;
import
{
IChatContentPart
}
from
'
./chatContentParts.js
'
;
const
$
=
dom
.
$
;
...
...
@@ -52,6 +54,8 @@ export class ChatCollapsibleListContentPart extends Disposable implements IChatC
element
:
IChatResponseViewModel
,
contentReferencesListPool
:
CollapsibleListPool
,
@
IOpenerService
openerService
:
IOpenerService
,
@
IContextMenuService
private
readonly
contextMenuService
:
IContextMenuService
,
@
IClipboardService
private
readonly
clipboardService
:
IClipboardService
,
)
{
super
();
...
...
@@ -114,6 +118,31 @@ export class ChatCollapsibleListContentPart extends Disposable implements IChatC
this
.
_register
(
list
.
onContextMenu
((
e
)
=>
{
e
.
browserEvent
.
preventDefault
();
e
.
browserEvent
.
stopPropagation
();
if
(
e
.
element
&&
'
reference
'
in
e
.
element
&&
typeof
e
.
element
.
reference
===
'
object
'
)
{
const
uriOrLocation
=
'
variableName
'
in
e
.
element
.
reference
?
e
.
element
.
reference
.
value
:
e
.
element
.
reference
;
const
uri
=
URI
.
isUri
(
uriOrLocation
)
?
uriOrLocation
:
uriOrLocation
?.
uri
;
if
(
uri
)
{
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
e
.
anchor
,
getActions
:
()
=>
{
return
[{
id
:
'
workbench.action.chat.copyReference
'
,
title
:
localize
(
'
copyReference
'
,
"
Copy
"
),
label
:
localize
(
'
copyReference
'
,
"
Copy
"
),
tooltip
:
localize
(
'
copyReference
'
,
"
Copy
"
),
enabled
:
e
.
element
?.
kind
===
'
reference
'
,
class
:
undefined
,
run
:
()
=>
{
void
this
.
clipboardService
.
writeResources
([
uri
]);
}
}];
}
});
}
}
}));
const
maxItemsShown
=
6
;
...
...
This diff is collapsed.
Click to expand it.
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать
Меню
Проекты
Группы
Сниппеты