@codingame/monaco-vscode-notebook-service-override 22.1.8 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -1
- package/package.json +25 -23
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +8 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +104 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +21 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +9 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +17 -387
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +16 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +26 -39
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +26 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +18 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +70 -70
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +33 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +49 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +11 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +4 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSource.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +28 -31
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +5 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +2 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +405 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +120 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.d.ts +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +15 -15
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +3 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +2 -2
|
@@ -1,258 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
-
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility';
|
|
3
|
+
import { KeyChord, KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
4
|
+
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
5
|
import { registerAction2, MenuId, MenuRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
8
6
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
9
7
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
8
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
9
|
import { InputFocusedContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkeys';
|
|
12
10
|
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { NotebookAction, NotebookCellAction, getEditorFromArgsOrActivePane, CELL_TITLE_CELL_GROUP_ID, getContextFromActiveEditor } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
11
|
+
import { MENU_INLINE_CHAT_WIDGET_STATUS, CTX_INLINE_CHAT_REQUEST_IN_PROGRESS, CTX_INLINE_CHAT_RESPONSE_TYPE, InlineChatResponseType, CTX_INLINE_CHAT_VISIBLE } from '@codingame/monaco-vscode-a793b3ee-7ba9-5176-a019-30ec806fdd95-common/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
12
|
+
import { CTX_NOTEBOOK_CHAT_HAS_AGENT } from './notebookChatContext.js';
|
|
13
|
+
import { NotebookAction, getEditorFromArgsOrActivePane, getContextFromActiveEditor } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
17
14
|
import { insertNewCell } from '../insertCellActions.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_GENERATED_BY_CHAT } from '@codingame/monaco-vscode-eda30bac-0984-5b42-9362-c68996b85232-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
15
|
+
import { NotebookSetting, CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
|
+
import { NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_EDITOR_FOCUSED } from '@codingame/monaco-vscode-eda30bac-0984-5b42-9362-c68996b85232-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
21
17
|
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
22
18
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
23
19
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
24
20
|
import { InlineChatController } from '@codingame/monaco-vscode-a793b3ee-7ba9-5176-a019-30ec806fdd95-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
25
21
|
import { EditorAction2 } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
26
22
|
|
|
27
|
-
registerAction2(class extends NotebookAction {
|
|
28
|
-
constructor() {
|
|
29
|
-
super({
|
|
30
|
-
id: 'notebook.cell.chat.accept',
|
|
31
|
-
title: ( localize2(8913, "Make Request")),
|
|
32
|
-
icon: Codicon.send,
|
|
33
|
-
keybinding: {
|
|
34
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
|
|
35
|
-
weight: KeybindingWeight.WorkbenchContrib,
|
|
36
|
-
primary: KeyCode.Enter
|
|
37
|
-
},
|
|
38
|
-
menu: {
|
|
39
|
-
id: MENU_CELL_CHAT_INPUT,
|
|
40
|
-
group: 'navigation',
|
|
41
|
-
order: 1,
|
|
42
|
-
when: ( CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST.negate())
|
|
43
|
-
},
|
|
44
|
-
f1: false
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
async runWithContext(accessor, context) {
|
|
48
|
-
NotebookChatController.get(context.notebookEditor)?.acceptInput();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
registerAction2(class extends NotebookCellAction {
|
|
52
|
-
constructor() {
|
|
53
|
-
super({
|
|
54
|
-
id: 'notebook.cell.chat.arrowOutUp',
|
|
55
|
-
title: ( localize(8914, 'Cursor Up')),
|
|
56
|
-
keybinding: {
|
|
57
|
-
when: ( ContextKeyExpr.and(
|
|
58
|
-
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
59
|
-
CTX_INLINE_CHAT_FOCUSED,
|
|
60
|
-
CTX_INLINE_CHAT_INNER_CURSOR_FIRST,
|
|
61
|
-
( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()),
|
|
62
|
-
( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
63
|
-
)),
|
|
64
|
-
weight: KeybindingWeight.EditorCore + 7,
|
|
65
|
-
primary: KeyMod.CtrlCmd | KeyCode.UpArrow
|
|
66
|
-
},
|
|
67
|
-
f1: false
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
async runWithContext(accessor, context) {
|
|
71
|
-
const editor = context.notebookEditor;
|
|
72
|
-
const activeCell = context.cell;
|
|
73
|
-
const idx = editor.getCellIndex(activeCell);
|
|
74
|
-
if (typeof idx !== 'number') {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (idx < 1 || editor.getLength() === 0) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const newCell = editor.cellAt(idx - 1);
|
|
81
|
-
const newFocusMode = newCell.cellKind === CellKind.Markup && newCell.getEditState() === CellEditState.Preview ? 'container' : 'editor';
|
|
82
|
-
const focusEditorLine = newCell.textBuffer.getLineCount();
|
|
83
|
-
await editor.focusNotebookCell(newCell, newFocusMode, { focusEditorLine: focusEditorLine });
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
registerAction2(class extends NotebookAction {
|
|
87
|
-
constructor() {
|
|
88
|
-
super({
|
|
89
|
-
id: 'notebook.cell.chat.arrowOutDown',
|
|
90
|
-
title: ( localize(8915, 'Cursor Down')),
|
|
91
|
-
keybinding: {
|
|
92
|
-
when: ( ContextKeyExpr.and(
|
|
93
|
-
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
94
|
-
CTX_INLINE_CHAT_FOCUSED,
|
|
95
|
-
CTX_INLINE_CHAT_INNER_CURSOR_LAST,
|
|
96
|
-
( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()),
|
|
97
|
-
( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
98
|
-
)),
|
|
99
|
-
weight: KeybindingWeight.EditorCore + 7,
|
|
100
|
-
primary: KeyMod.CtrlCmd | KeyCode.DownArrow
|
|
101
|
-
},
|
|
102
|
-
f1: false
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
async runWithContext(accessor, context) {
|
|
106
|
-
await NotebookChatController.get(context.notebookEditor)?.focusNext();
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
registerAction2(class extends NotebookCellAction {
|
|
110
|
-
constructor() {
|
|
111
|
-
super({
|
|
112
|
-
id: 'notebook.cell.focusChatWidget',
|
|
113
|
-
title: ( localize(8916, 'Focus Chat Widget')),
|
|
114
|
-
keybinding: {
|
|
115
|
-
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('bottom')), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none')))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
116
|
-
weight: KeybindingWeight.EditorCore + 7,
|
|
117
|
-
primary: KeyMod.CtrlCmd | KeyCode.UpArrow
|
|
118
|
-
},
|
|
119
|
-
f1: false
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
async runWithContext(accessor, context) {
|
|
123
|
-
const index = context.notebookEditor.getCellIndex(context.cell);
|
|
124
|
-
await NotebookChatController.get(context.notebookEditor)?.focusNearestWidget(index, 'above');
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
registerAction2(class extends NotebookCellAction {
|
|
128
|
-
constructor() {
|
|
129
|
-
super({
|
|
130
|
-
id: 'notebook.cell.focusNextChatWidget',
|
|
131
|
-
title: ( localize(8917, 'Focus Next Cell Chat Widget')),
|
|
132
|
-
keybinding: {
|
|
133
|
-
when: ( ContextKeyExpr.and(( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('top')), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none')))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
134
|
-
weight: KeybindingWeight.EditorCore + 7,
|
|
135
|
-
primary: KeyMod.CtrlCmd | KeyCode.DownArrow
|
|
136
|
-
},
|
|
137
|
-
f1: false,
|
|
138
|
-
precondition: ( ContextKeyExpr.or(( ContextKeyExpr.and(( IS_COMPOSITE_NOTEBOOK.negate()), NOTEBOOK_CELL_EDITOR_FOCUSED)), ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate())))))
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
async runWithContext(accessor, context) {
|
|
142
|
-
const index = context.notebookEditor.getCellIndex(context.cell);
|
|
143
|
-
await NotebookChatController.get(context.notebookEditor)?.focusNearestWidget(index, 'below');
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
registerAction2(class extends NotebookAction {
|
|
147
|
-
constructor() {
|
|
148
|
-
super({
|
|
149
|
-
id: 'notebook.cell.chat.stop',
|
|
150
|
-
title: ( localize2(8918, "Stop Request")),
|
|
151
|
-
icon: Codicon.debugStop,
|
|
152
|
-
menu: {
|
|
153
|
-
id: MENU_CELL_CHAT_INPUT,
|
|
154
|
-
group: 'navigation',
|
|
155
|
-
order: 1,
|
|
156
|
-
when: CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST
|
|
157
|
-
},
|
|
158
|
-
f1: false
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
async runWithContext(accessor, context) {
|
|
162
|
-
NotebookChatController.get(context.notebookEditor)?.cancelCurrentRequest(false);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
registerAction2(class extends NotebookAction {
|
|
166
|
-
constructor() {
|
|
167
|
-
super({
|
|
168
|
-
id: 'notebook.cell.chat.close',
|
|
169
|
-
title: ( localize2(8919, "Close Chat")),
|
|
170
|
-
icon: Codicon.close,
|
|
171
|
-
menu: {
|
|
172
|
-
id: MENU_CELL_CHAT_WIDGET,
|
|
173
|
-
group: 'navigation',
|
|
174
|
-
order: 2
|
|
175
|
-
},
|
|
176
|
-
f1: false
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
async runWithContext(accessor, context) {
|
|
180
|
-
NotebookChatController.get(context.notebookEditor)?.dismiss(false);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
registerAction2(class extends NotebookAction {
|
|
184
|
-
constructor() {
|
|
185
|
-
super({
|
|
186
|
-
id: 'notebook.cell.chat.acceptChanges',
|
|
187
|
-
title: ( localize2(8920, "Accept Changes")),
|
|
188
|
-
shortTitle: ( localize(8921, 'Accept')),
|
|
189
|
-
icon: Codicon.check,
|
|
190
|
-
tooltip: ( localize(8922, 'Accept Changes')),
|
|
191
|
-
keybinding: [
|
|
192
|
-
{
|
|
193
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
|
|
194
|
-
weight: KeybindingWeight.EditorContrib + 10,
|
|
195
|
-
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
when: ( ContextKeyExpr.and(
|
|
199
|
-
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
200
|
-
CTX_INLINE_CHAT_FOCUSED,
|
|
201
|
-
CTX_NOTEBOOK_CHAT_USER_DID_EDIT,
|
|
202
|
-
( NOTEBOOK_CELL_EDITOR_FOCUSED.negate())
|
|
203
|
-
)),
|
|
204
|
-
weight: KeybindingWeight.EditorCore + 10,
|
|
205
|
-
primary: KeyCode.Escape
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
when: ( ContextKeyExpr.and(
|
|
209
|
-
NOTEBOOK_EDITOR_FOCUSED,
|
|
210
|
-
ContextKeyExpr.not(InputFocusedContextKey),
|
|
211
|
-
( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()),
|
|
212
|
-
( CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo('below'))
|
|
213
|
-
)),
|
|
214
|
-
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
215
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
216
|
-
}
|
|
217
|
-
],
|
|
218
|
-
menu: [
|
|
219
|
-
{
|
|
220
|
-
id: MENU_CELL_CHAT_WIDGET_STATUS,
|
|
221
|
-
group: '0_main',
|
|
222
|
-
order: 0,
|
|
223
|
-
when: ( CTX_INLINE_CHAT_RESPONSE_TYPE.notEqualsTo(InlineChatResponseType.Messages)),
|
|
224
|
-
}
|
|
225
|
-
],
|
|
226
|
-
f1: false
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
async runWithContext(accessor, context) {
|
|
230
|
-
NotebookChatController.get(context.notebookEditor)?.acceptSession();
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
registerAction2(class extends NotebookAction {
|
|
234
|
-
constructor() {
|
|
235
|
-
super({
|
|
236
|
-
id: 'notebook.cell.chat.discard',
|
|
237
|
-
title: ( localize(8923, 'Discard')),
|
|
238
|
-
icon: Codicon.discard,
|
|
239
|
-
keybinding: {
|
|
240
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( CTX_NOTEBOOK_CHAT_USER_DID_EDIT.negate()), ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
|
|
241
|
-
weight: KeybindingWeight.EditorContrib,
|
|
242
|
-
primary: KeyCode.Escape
|
|
243
|
-
},
|
|
244
|
-
menu: {
|
|
245
|
-
id: MENU_CELL_CHAT_WIDGET_STATUS,
|
|
246
|
-
group: '0_main',
|
|
247
|
-
order: 1
|
|
248
|
-
},
|
|
249
|
-
f1: false
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
async runWithContext(accessor, context) {
|
|
253
|
-
NotebookChatController.get(context.notebookEditor)?.discard();
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
23
|
async function startChat(accessor, context, index, input, autoSend, source) {
|
|
257
24
|
const configurationService = accessor.get(IConfigurationService);
|
|
258
25
|
const commandService = accessor.get(ICommandService);
|
|
@@ -275,12 +42,12 @@ registerAction2(class extends NotebookAction {
|
|
|
275
42
|
super({
|
|
276
43
|
id: 'notebook.cell.chat.start',
|
|
277
44
|
title: {
|
|
278
|
-
value: '$(sparkle) ' + ( localize(
|
|
45
|
+
value: '$(sparkle) ' + ( localize(9174, "Generate")),
|
|
279
46
|
original: '$(sparkle) Generate',
|
|
280
47
|
},
|
|
281
|
-
tooltip: ( localize(
|
|
48
|
+
tooltip: ( localize(9175, "Start Chat to Generate Code")),
|
|
282
49
|
metadata: {
|
|
283
|
-
description: ( localize(
|
|
50
|
+
description: ( localize(9175, "Start Chat to Generate Code")),
|
|
284
51
|
args: [
|
|
285
52
|
{
|
|
286
53
|
name: 'args',
|
|
@@ -362,10 +129,10 @@ registerAction2(class extends NotebookAction {
|
|
|
362
129
|
super({
|
|
363
130
|
id: 'notebook.cell.chat.startAtTop',
|
|
364
131
|
title: {
|
|
365
|
-
value: '$(sparkle) ' + ( localize(
|
|
132
|
+
value: '$(sparkle) ' + ( localize(9174, "Generate")),
|
|
366
133
|
original: '$(sparkle) Generate',
|
|
367
134
|
},
|
|
368
|
-
tooltip: ( localize(
|
|
135
|
+
tooltip: ( localize(9175, "Start Chat to Generate Code")),
|
|
369
136
|
f1: false,
|
|
370
137
|
menu: [
|
|
371
138
|
{
|
|
@@ -385,157 +152,20 @@ MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
|
385
152
|
command: {
|
|
386
153
|
id: 'notebook.cell.chat.start',
|
|
387
154
|
icon: Codicon.sparkle,
|
|
388
|
-
title: ( localize(
|
|
389
|
-
tooltip: ( localize(
|
|
155
|
+
title: ( localize(9176, "Generate")),
|
|
156
|
+
tooltip: ( localize(9177, "Start Chat to Generate Code"))
|
|
390
157
|
},
|
|
391
158
|
order: -10,
|
|
392
159
|
group: 'navigation/add',
|
|
393
160
|
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), ( ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'betweenCells')), ( ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'hidden')), CTX_NOTEBOOK_CHAT_HAS_AGENT, ( ContextKeyExpr.or(( ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)), ( ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))))))
|
|
394
161
|
});
|
|
395
|
-
registerAction2(class extends NotebookAction {
|
|
396
|
-
constructor() {
|
|
397
|
-
super({
|
|
398
|
-
id: 'notebook.cell.chat.focus',
|
|
399
|
-
title: ( localize(8928, 'Focus Chat')),
|
|
400
|
-
keybinding: [
|
|
401
|
-
{
|
|
402
|
-
when: ( ContextKeyExpr.and(
|
|
403
|
-
NOTEBOOK_EDITOR_FOCUSED,
|
|
404
|
-
ContextKeyExpr.not(InputFocusedContextKey),
|
|
405
|
-
( CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo('above'))
|
|
406
|
-
)),
|
|
407
|
-
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
|
|
408
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
when: ( ContextKeyExpr.and(
|
|
412
|
-
NOTEBOOK_EDITOR_FOCUSED,
|
|
413
|
-
ContextKeyExpr.not(InputFocusedContextKey),
|
|
414
|
-
( CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo('below'))
|
|
415
|
-
)),
|
|
416
|
-
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
|
|
417
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
418
|
-
}
|
|
419
|
-
],
|
|
420
|
-
f1: false
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
async runWithContext(accessor, context) {
|
|
424
|
-
NotebookChatController.get(context.notebookEditor)?.focus();
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
registerAction2(class extends NotebookAction {
|
|
428
|
-
constructor() {
|
|
429
|
-
super({
|
|
430
|
-
id: 'notebook.cell.chat.focusNextCell',
|
|
431
|
-
title: ( localize(8929, 'Focus Next Cell')),
|
|
432
|
-
keybinding: [
|
|
433
|
-
{
|
|
434
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
435
|
-
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
|
|
436
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
437
|
-
}
|
|
438
|
-
],
|
|
439
|
-
f1: false
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
async runWithContext(accessor, context) {
|
|
443
|
-
NotebookChatController.get(context.notebookEditor)?.focusNext();
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
registerAction2(class extends NotebookAction {
|
|
447
|
-
constructor() {
|
|
448
|
-
super({
|
|
449
|
-
id: 'notebook.cell.chat.focusPreviousCell',
|
|
450
|
-
title: ( localize(8930, 'Focus Previous Cell')),
|
|
451
|
-
keybinding: [
|
|
452
|
-
{
|
|
453
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
454
|
-
primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
|
|
455
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
456
|
-
}
|
|
457
|
-
],
|
|
458
|
-
f1: false
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
async runWithContext(accessor, context) {
|
|
462
|
-
NotebookChatController.get(context.notebookEditor)?.focusAbove();
|
|
463
|
-
}
|
|
464
|
-
});
|
|
465
|
-
registerAction2(class extends NotebookAction {
|
|
466
|
-
constructor() {
|
|
467
|
-
super({
|
|
468
|
-
id: 'notebook.cell.chat.previousFromHistory',
|
|
469
|
-
title: ( localize2(8931, "Previous From History")),
|
|
470
|
-
precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
471
|
-
keybinding: {
|
|
472
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
473
|
-
weight: KeybindingWeight.EditorCore + 10,
|
|
474
|
-
primary: KeyCode.UpArrow,
|
|
475
|
-
},
|
|
476
|
-
f1: false
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
async runWithContext(accessor, context) {
|
|
480
|
-
NotebookChatController.get(context.notebookEditor)?.populateHistory(true);
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
registerAction2(class extends NotebookAction {
|
|
484
|
-
constructor() {
|
|
485
|
-
super({
|
|
486
|
-
id: 'notebook.cell.chat.nextFromHistory',
|
|
487
|
-
title: ( localize2(8932, "Next From History")),
|
|
488
|
-
precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
489
|
-
keybinding: {
|
|
490
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
491
|
-
weight: KeybindingWeight.EditorCore + 10,
|
|
492
|
-
primary: KeyCode.DownArrow
|
|
493
|
-
},
|
|
494
|
-
f1: false
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
async runWithContext(accessor, context) {
|
|
498
|
-
NotebookChatController.get(context.notebookEditor)?.populateHistory(false);
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
|
-
registerAction2(class extends NotebookCellAction {
|
|
502
|
-
constructor() {
|
|
503
|
-
super({
|
|
504
|
-
id: 'notebook.cell.chat.restore',
|
|
505
|
-
title: ( localize2(8933, "Generate")),
|
|
506
|
-
icon: Codicon.sparkle,
|
|
507
|
-
menu: {
|
|
508
|
-
id: MenuId.NotebookCellTitle,
|
|
509
|
-
group: CELL_TITLE_CELL_GROUP_ID,
|
|
510
|
-
order: 0,
|
|
511
|
-
when: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), CTX_NOTEBOOK_CHAT_HAS_AGENT, NOTEBOOK_CELL_GENERATED_BY_CHAT, ( ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true))))
|
|
512
|
-
},
|
|
513
|
-
f1: false
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
async runWithContext(accessor, context) {
|
|
517
|
-
const cell = context.cell;
|
|
518
|
-
if (!cell) {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
const notebookEditor = context.notebookEditor;
|
|
522
|
-
const controller = NotebookChatController.get(notebookEditor);
|
|
523
|
-
if (!controller) {
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
const prompt = controller.getPromptFromCache(cell);
|
|
527
|
-
if (prompt) {
|
|
528
|
-
controller.restore(cell, prompt);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
});
|
|
532
162
|
class AcceptChangesAndRun extends EditorAction2 {
|
|
533
163
|
constructor() {
|
|
534
164
|
super({
|
|
535
165
|
id: 'notebook.inlineChat.acceptChangesAndRun',
|
|
536
|
-
title: ( localize2(
|
|
537
|
-
shortTitle: ( localize(
|
|
538
|
-
tooltip: ( localize(
|
|
166
|
+
title: ( localize2(9178, "Accept and Run")),
|
|
167
|
+
shortTitle: ( localize(9179, 'Accept & Run')),
|
|
168
|
+
tooltip: ( localize(9180, 'Accept the changes and run the cell')),
|
|
539
169
|
icon: Codicon.check,
|
|
540
170
|
f1: true,
|
|
541
171
|
precondition: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), CTX_INLINE_CHAT_VISIBLE)),
|
|
@@ -3,6 +3,6 @@ import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platfor
|
|
|
3
3
|
export declare class SelectAndInsertKernelVariableAction extends Action2 {
|
|
4
4
|
constructor();
|
|
5
5
|
static readonly ID = "notebook.chat.selectAndInsertKernelVariable";
|
|
6
|
-
run(accessor: ServicesAccessor, ...args:
|
|
6
|
+
run(accessor: ServicesAccessor, ...args: unknown[]): Promise<void>;
|
|
7
7
|
private addVariableReference;
|
|
8
8
|
}
|
|
@@ -15,25 +15,26 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
15
15
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
16
16
|
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
17
17
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
18
|
+
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
18
19
|
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
19
|
-
import { showChatView } from '@codingame/monaco-vscode-
|
|
20
|
+
import { showChatView } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
20
21
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
21
22
|
import { IChatContextPickService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextPickService.service';
|
|
22
|
-
import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-
|
|
23
|
+
import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
|
|
23
24
|
import { computeCompletionRanges } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions';
|
|
24
25
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
25
26
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
26
|
-
import { chatVariableLeader } from '@codingame/monaco-vscode-
|
|
27
|
+
import { chatVariableLeader } from '@codingame/monaco-vscode-aac7027b-326c-513a-95a9-e4eedd151b38-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
27
28
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
28
29
|
import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT, NOTEBOOK_CELL_HAS_OUTPUTS, NOTEBOOK_CELL_OUTPUT_MIMETYPE } from '@codingame/monaco-vscode-eda30bac-0984-5b42-9362-c68996b85232-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
29
30
|
import { INotebookKernelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
30
31
|
import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT_CONST, createNotebookOutputVariableEntry } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils';
|
|
31
|
-
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-
|
|
32
|
+
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
32
33
|
import { copyIcon } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
33
34
|
import { getOutputViewModelFromId } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/cellOutputActions';
|
|
34
35
|
import { NOTEBOOK_ACTIONS_CATEGORY } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
35
36
|
import './cellChatActions.js';
|
|
36
|
-
import { CTX_NOTEBOOK_CHAT_HAS_AGENT } from '
|
|
37
|
+
import { CTX_NOTEBOOK_CHAT_HAS_AGENT } from './notebookChatContext.js';
|
|
37
38
|
|
|
38
39
|
const NotebookKernelVariableKey = 'kernelVariable';
|
|
39
40
|
let NotebookChatContribution = class NotebookChatContribution extends Disposable {
|
|
@@ -78,7 +79,7 @@ let NotebookChatContribution = class NotebookChatContribution extends Disposable
|
|
|
78
79
|
result.suggestions.push({
|
|
79
80
|
label: `${chatVariableLeader}${NotebookKernelVariableKey}`,
|
|
80
81
|
insertText: `${chatVariableLeader}${NotebookKernelVariableKey}:`,
|
|
81
|
-
detail: ( localize(
|
|
82
|
+
detail: ( localize(9181, "Pick a variable from the kernel")),
|
|
82
83
|
range,
|
|
83
84
|
kind: CompletionItemKind.Text,
|
|
84
85
|
command: { id: SelectAndInsertKernelVariableAction.ID, title: SelectAndInsertKernelVariableAction.ID, arguments: [{ widget, range: afterRange }] },
|
|
@@ -104,7 +105,7 @@ let NotebookChatContribution = class NotebookChatContribution extends Disposable
|
|
|
104
105
|
if (!hasVariableProvider) {
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
|
-
const variables =
|
|
108
|
+
const variables = selectedKernel.provideVariables(notebook.uri, undefined, 'named', 0, CancellationToken.None);
|
|
108
109
|
for await (const variable of variables) {
|
|
109
110
|
if (pattern && !variable.name.toLowerCase().includes(pattern)) {
|
|
110
111
|
continue;
|
|
@@ -164,7 +165,7 @@ class SelectAndInsertKernelVariableAction extends Action2 {
|
|
|
164
165
|
if (!hasVariableProvider) {
|
|
165
166
|
return;
|
|
166
167
|
}
|
|
167
|
-
const variables =
|
|
168
|
+
const variables = selectedKernel.provideVariables(notebook.uri, undefined, 'named', 0, CancellationToken.None);
|
|
168
169
|
const quickPickItems = [];
|
|
169
170
|
for await (const variable of variables) {
|
|
170
171
|
quickPickItems.push({
|
|
@@ -174,8 +175,8 @@ class SelectAndInsertKernelVariableAction extends Action2 {
|
|
|
174
175
|
});
|
|
175
176
|
}
|
|
176
177
|
const placeHolder = quickPickItems.length > 0
|
|
177
|
-
? ( localize(
|
|
178
|
-
: ( localize(
|
|
178
|
+
? ( localize(9182, "Select a kernel variable"))
|
|
179
|
+
: ( localize(9183, "No kernel variables found"));
|
|
179
180
|
const pickedVariable = await quickInputService.pick(quickPickItems, { placeHolder });
|
|
180
181
|
if (!pickedVariable) {
|
|
181
182
|
return;
|
|
@@ -216,7 +217,7 @@ let KernelVariableContextPicker = class KernelVariableContextPicker {
|
|
|
216
217
|
this.editorService = editorService;
|
|
217
218
|
this.notebookKernelService = notebookKernelService;
|
|
218
219
|
this.type = 'pickerPick';
|
|
219
|
-
this.label = ( localize(
|
|
220
|
+
this.label = ( localize(9184, 'Kernel Variable...'));
|
|
220
221
|
this.icon = Codicon.serverEnvironment;
|
|
221
222
|
}
|
|
222
223
|
isEnabled(widget) {
|
|
@@ -253,7 +254,7 @@ let KernelVariableContextPicker = class KernelVariableContextPicker {
|
|
|
253
254
|
return result;
|
|
254
255
|
})();
|
|
255
256
|
return {
|
|
256
|
-
placeholder: ( localize(
|
|
257
|
+
placeholder: ( localize(9185, 'Select a kernel variable')),
|
|
257
258
|
picks
|
|
258
259
|
};
|
|
259
260
|
}
|
|
@@ -266,7 +267,7 @@ registerAction2(class CopyCellOutputAction extends Action2 {
|
|
|
266
267
|
constructor() {
|
|
267
268
|
super({
|
|
268
269
|
id: 'notebook.cellOutput.addToChat',
|
|
269
|
-
title: ( localize(
|
|
270
|
+
title: ( localize(9186, "Add Cell Output to Chat")),
|
|
270
271
|
menu: {
|
|
271
272
|
id: MenuId.NotebookOutputToolbar,
|
|
272
273
|
when: ( ContextKeyExpr.and(
|
|
@@ -290,6 +291,7 @@ registerAction2(class CopyCellOutputAction extends Action2 {
|
|
|
290
291
|
async run(accessor, outputContext) {
|
|
291
292
|
const notebookEditor = this.getNoteboookEditor(accessor.get(IEditorService), outputContext);
|
|
292
293
|
const viewService = accessor.get(IViewsService);
|
|
294
|
+
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
293
295
|
if (!notebookEditor) {
|
|
294
296
|
return;
|
|
295
297
|
}
|
|
@@ -333,7 +335,7 @@ registerAction2(class CopyCellOutputAction extends Action2 {
|
|
|
333
335
|
return;
|
|
334
336
|
}
|
|
335
337
|
widget.attachmentModel.addContext(entry);
|
|
336
|
-
(await showChatView(viewService))?.focusInput();
|
|
338
|
+
(await showChatView(viewService, layoutService))?.focusInput();
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
});
|
package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { RawContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
4
|
+
|
|
5
|
+
const CTX_NOTEBOOK_CHAT_HAS_AGENT = ( new RawContextKey('notebookChatAgentRegistered', false, ( localize(9187, "Whether a chat agent for notebook is registered"))));
|
|
6
|
+
|
|
7
|
+
export { CTX_NOTEBOOK_CHAT_HAS_AGENT };
|