mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
parent
1acc838297
commit
3c490dadc8
|
@ -158,7 +158,8 @@ class ChatHistoryAction extends Action2 {
|
|||
picker.items = getPicks();
|
||||
store.add(picker.onDidTriggerItemButton(context => {
|
||||
if (context.button === openInEditorButton) {
|
||||
editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: <IChatEditorOptions>{ target: { sessionId: context.item.chat.sessionId }, pinned: true } }, ACTIVE_GROUP);
|
||||
const options: IChatEditorOptions = { target: { sessionId: context.item.chat.sessionId }, pinned: true };
|
||||
editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options }, ACTIVE_GROUP);
|
||||
picker.hide();
|
||||
} else if (context.button === deleteButton) {
|
||||
chatService.removeHistoryEntry(context.item.chat.sessionId);
|
||||
|
|
|
@ -96,7 +96,8 @@ export function registerChatExportActions() {
|
|||
throw new Error('Invalid chat session data');
|
||||
}
|
||||
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { data }, pinned: true } as IChatEditorOptions });
|
||||
const options: IChatEditorOptions = { target: { data }, pinned: true };
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options });
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ async function executeMoveToAction(accessor: ServicesAccessor, moveTo: MoveToNew
|
|||
|
||||
const widget = chatView?.widget ?? widgetService.lastFocusedWidget;
|
||||
if (!widget || !('viewId' in widget.viewContext)) {
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: <IChatEditorOptions>{ pinned: true } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { pinned: true } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,8 @@ async function executeMoveToAction(accessor: ServicesAccessor, moveTo: MoveToNew
|
|||
const viewState = widget.getViewState();
|
||||
widget.clear();
|
||||
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: <IChatEditorOptions>{ target: { sessionId }, pinned: true, viewState: viewState } }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
||||
const options: IChatEditorOptions = { target: { sessionId }, pinned: true, viewState: viewState };
|
||||
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options }, moveTo === MoveToNewLocation.Window ? AUX_WINDOW_GROUP : ACTIVE_GROUP);
|
||||
}
|
||||
|
||||
async function moveToSidebar(accessor: ServicesAccessor): Promise<void> {
|
||||
|
|
|
@ -99,18 +99,18 @@ export class ChatDynamicVariableModel extends Disposable implements IChatWidgetC
|
|||
}
|
||||
|
||||
private updateDecorations(): void {
|
||||
this.widget.inputEditor.setDecorationsByType('chat', dynamicVariableDecorationType, this._variables.map(r => (<IDecorationOptions>{
|
||||
this.widget.inputEditor.setDecorationsByType('chat', dynamicVariableDecorationType, this._variables.map((r): IDecorationOptions => ({
|
||||
range: r.range,
|
||||
hoverMessage: this.getHoverForReference(r)
|
||||
})));
|
||||
}
|
||||
|
||||
private getHoverForReference(ref: IDynamicVariable): string | IMarkdownString {
|
||||
private getHoverForReference(ref: IDynamicVariable): IMarkdownString | undefined {
|
||||
const value = ref.data;
|
||||
if (URI.isUri(value)) {
|
||||
return new MarkdownString(this.labelService.getUriLabel(value, { relative: true }));
|
||||
} else {
|
||||
return (value as any).toString();
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -162,11 +162,10 @@ export class SelectAndInsertFileAction extends Action2 {
|
|||
// This of course assumes that the `files` variable has the behavior that it searches
|
||||
// through files in the workspace.
|
||||
if (chatVariablesService.hasVariable(SelectAndInsertFileAction.Name)) {
|
||||
options = {
|
||||
providerOptions: <AnythingQuickAccessProviderRunOptions>{
|
||||
additionPicks: [SelectAndInsertFileAction.Item, { type: 'separator' }]
|
||||
},
|
||||
const providerOptions: AnythingQuickAccessProviderRunOptions = {
|
||||
additionPicks: [SelectAndInsertFileAction.Item, { type: 'separator' }]
|
||||
};
|
||||
options = { providerOptions };
|
||||
}
|
||||
// TODO: have dedicated UX for this instead of using the quick access picker
|
||||
const picks = await quickInputService.quickAccess.pick('', options);
|
||||
|
|
|
@ -771,6 +771,7 @@ export class ChatModel extends Disposable implements IChatModel {
|
|||
|
||||
// Port entries from old format
|
||||
const result = 'responseErrorDetails' in raw ?
|
||||
// eslint-disable-next-line local/code-no-dangerous-type-assertions
|
||||
{ errorDetails: raw.responseErrorDetails } as IChatAgentResult : raw.result;
|
||||
request.response = new ChatResponseModel(raw.response ?? [new MarkdownString(raw.response)], this, agent, raw.slashCommand, request.id, true, raw.isCanceled, raw.vote, result, raw.followups);
|
||||
if (raw.usedContext) { // @ulugbekna: if this's a new vscode sessions, doc versions are incorrect anyway?
|
||||
|
|
Loading…
Reference in a new issue