@codingame/monaco-vscode-api 2.1.0 → 2.1.2
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/api.js +1 -1
- package/extensions.js +3 -3
- package/missing-services.js +2 -2
- package/package.json +8 -8
- package/services.js +2 -2
- package/vscode/src/vs/platform/remote/common/remoteAgentEnvironment.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/media/style.css.js +4 -0
- package/vscode/src/vs/workbench/browser/style.js +1 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.save.js +167 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +15 -1
- package/vscode/src/vs/workbench/services/banner/browser/bannerService.d.ts +1 -0
package/api.js
CHANGED
package/extensions.js
CHANGED
|
@@ -12,7 +12,7 @@ import { IInstantiationService } from './vscode/src/vs/platform/instantiation/co
|
|
|
12
12
|
import { CustomSchemas, registerExtensionFile } from '@codingame/monaco-vscode-files-service-override';
|
|
13
13
|
import { getService } from './services.js';
|
|
14
14
|
import { ExtensionManifestTranslator } from './tools/l10n.js';
|
|
15
|
-
import { throttle } from './tools.js';
|
|
15
|
+
import { throttle, memoized } from './tools.js';
|
|
16
16
|
import { setDefaultApi } from './api.js';
|
|
17
17
|
let apiFactory;
|
|
18
18
|
function registerLocalApiFactory(_apiFactory) {
|
|
@@ -21,7 +21,7 @@ function registerLocalApiFactory(_apiFactory) {
|
|
|
21
21
|
function registerExtensionFileUrl(extensionLocation, filePath, url, mimeType) {
|
|
22
22
|
const fileDisposable = new DisposableStore();
|
|
23
23
|
fileDisposable.add(FileAccess.registerStaticBrowserUri(joinPath(extensionLocation, filePath), ( URI.parse(url))));
|
|
24
|
-
fileDisposable.add(registerExtensionFile(extensionLocation, filePath, async () => {
|
|
24
|
+
fileDisposable.add(registerExtensionFile(extensionLocation, filePath, memoized(async () => {
|
|
25
25
|
const response = await fetch(url, {
|
|
26
26
|
headers: mimeType != null
|
|
27
27
|
? {
|
|
@@ -33,7 +33,7 @@ function registerExtensionFileUrl(extensionLocation, filePath, url, mimeType) {
|
|
|
33
33
|
throw new Error(response.statusText);
|
|
34
34
|
}
|
|
35
35
|
return new Uint8Array(await response.arrayBuffer());
|
|
36
|
-
}));
|
|
36
|
+
})));
|
|
37
37
|
return fileDisposable;
|
|
38
38
|
}
|
|
39
39
|
const deltaExtensions = throttle(async ({ toAdd, toRemove }) => {
|
package/missing-services.js
CHANGED
|
@@ -520,8 +520,8 @@ registerSingleton(IPathService, BrowserPathService, 1 );
|
|
|
520
520
|
registerSingleton(IProductService, class ProductService {
|
|
521
521
|
constructor() {
|
|
522
522
|
this._serviceBrand = undefined;
|
|
523
|
-
this.version = "1.86.
|
|
524
|
-
this.commit = "1.86.
|
|
523
|
+
this.version = "1.86.1";
|
|
524
|
+
this.commit = "1.86.1";
|
|
525
525
|
this.quality = 'oss';
|
|
526
526
|
this.nameShort = 'Code - OSS Dev';
|
|
527
527
|
this.nameLong = 'Code - OSS Dev';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "VSCode public API plugged on the monaco editor",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": {
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
98
98
|
"vscode-semver": "npm:semver@=5.5.0",
|
|
99
|
-
"@codingame/monaco-vscode-extensions-service-override": "2.1.
|
|
100
|
-
"@codingame/monaco-vscode-files-service-override": "2.1.
|
|
101
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "2.1.
|
|
102
|
-
"@codingame/monaco-vscode-environment-service-override": "2.1.
|
|
103
|
-
"@codingame/monaco-vscode-layout-service-override": "2.1.
|
|
104
|
-
"@codingame/monaco-vscode-host-service-override": "2.1.
|
|
105
|
-
"@codingame/monaco-vscode-base-service-override": "2.1.
|
|
99
|
+
"@codingame/monaco-vscode-extensions-service-override": "2.1.2",
|
|
100
|
+
"@codingame/monaco-vscode-files-service-override": "2.1.2",
|
|
101
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "2.1.2",
|
|
102
|
+
"@codingame/monaco-vscode-environment-service-override": "2.1.2",
|
|
103
|
+
"@codingame/monaco-vscode-layout-service-override": "2.1.2",
|
|
104
|
+
"@codingame/monaco-vscode-host-service-override": "2.1.2",
|
|
105
|
+
"@codingame/monaco-vscode-base-service-override": "2.1.2"
|
|
106
106
|
}
|
|
107
107
|
}
|
package/services.js
CHANGED
|
@@ -144,9 +144,9 @@ async function initialize(overrides, container = document.body, configuration =
|
|
|
144
144
|
initialize$1(container, configuration);
|
|
145
145
|
const instantiationService = StandaloneServices.initialize({
|
|
146
146
|
[( IProductService.toString())]: mixin({
|
|
147
|
-
version: "1.86.
|
|
147
|
+
version: "1.86.1",
|
|
148
148
|
quality: 'oss',
|
|
149
|
-
commit: "1.86.
|
|
149
|
+
commit: "1.86.1",
|
|
150
150
|
nameShort: 'Code - OSS Dev',
|
|
151
151
|
nameLong: 'Code - OSS Dev',
|
|
152
152
|
applicationName: 'code-oss',
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import n from '../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
var css = "@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.mac{font-family:-apple-system,BlinkMacSystemFont,sans-serif}.mac:lang(zh-Hans){font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,sans-serif}.mac:lang(zh-Hant){font-family:-apple-system,BlinkMacSystemFont,PingFang TC,sans-serif}.mac:lang(ja){font-family:-apple-system,BlinkMacSystemFont,Hiragino Kaku Gothic Pro,sans-serif}.mac:lang(ko){font-family:-apple-system,BlinkMacSystemFont,Nanum Gothic,Apple SD Gothic Neo,AppleGothic,sans-serif}.windows{font-family:Segoe WPC,Segoe UI,sans-serif}.windows:lang(zh-Hans){font-family:Segoe WPC,Segoe UI,Microsoft YaHei,sans-serif}.windows:lang(zh-Hant){font-family:Segoe WPC,Segoe UI,Microsoft Jhenghei,sans-serif}.windows:lang(ja){font-family:Segoe WPC,Segoe UI,Yu Gothic UI,Meiryo UI,sans-serif}.windows:lang(ko){font-family:Segoe WPC,Segoe UI,Malgun Gothic,Dotom,sans-serif}.linux{font-family:system-ui,Ubuntu,Droid Sans,sans-serif}.linux:lang(zh-Hans){font-family:system-ui,Ubuntu,Droid Sans,Source Han Sans SC,Source Han Sans CN,Source Han Sans,sans-serif}.linux:lang(zh-Hant){font-family:system-ui,Ubuntu,Droid Sans,Source Han Sans TC,Source Han Sans TW,Source Han Sans,sans-serif}.linux:lang(ja){font-family:system-ui,Ubuntu,Droid Sans,Source Han Sans J,Source Han Sans JP,Source Han Sans,sans-serif}.linux:lang(ko){font-family:system-ui,Ubuntu,Droid Sans,Source Han Sans K,Source Han Sans JR,Source Han Sans,UnDotum,FBaekmuk Gulim,sans-serif}.mac{--monaco-monospace-font:\"SF Mono\",Monaco,Menlo,Courier,monospace}.windows{--monaco-monospace-font:Consolas,\"Courier New\",monospace}.linux{--monaco-monospace-font:\"Ubuntu Mono\",\"Liberation Mono\",\"DejaVu Sans Mono\",\"Courier New\",monospace}.monaco-workbench .monaco-editor,.monaco-workbench .part{color:var(--vscode-foreground);font-size:13px;line-height:1.4em;overflow:hidden;position:relative;z-index:1}.monaco-workbench.web .monaco-editor,.monaco-workbench.web .part{touch-action:none}.monaco-workbench .monaco-editor img,.monaco-workbench .part img{border:0}.monaco-workbench .monaco-editor label,.monaco-workbench .part label{cursor:pointer}.monaco-workbench .monaco-editor a,.monaco-workbench .part a{text-decoration:none}.monaco-workbench .monaco-editor a:active,.monaco-workbench .part a:active{background-color:inherit;color:inherit}.monaco-workbench .monaco-editor a.plain,.monaco-workbench .monaco-editor a.plain.hover,.monaco-workbench .monaco-editor a.plain:hover,.monaco-workbench .part a.plain,.monaco-workbench .part a.plain.hover,.monaco-workbench .part a.plain:hover{color:inherit;text-decoration:none}.monaco-workbench .monaco-editor input,.monaco-workbench .part input{color:inherit;font-family:inherit;font-size:100%}.monaco-workbench .monaco-editor input::placeholder,.monaco-workbench .part input::placeholder{color:var(--vscode-input-placeholderForeground)}.monaco-workbench .monaco-editor input::-webkit-input-placeholder,.monaco-workbench .part input::-webkit-input-placeholder{color:var(--vscode-input-placeholderForeground)}.monaco-workbench .monaco-editor input::-moz-placeholder,.monaco-workbench .part input::-moz-placeholder{color:var(--vscode-input-placeholderForeground)}.monaco-workbench .monaco-editor textarea::placeholder,.monaco-workbench .part textarea::placeholder{color:var(--vscode-input-placeholderForeground)}.monaco-workbench .monaco-editor textarea::-webkit-input-placeholder,.monaco-workbench .part textarea::-webkit-input-placeholder{color:var(--vscode-input-placeholderForeground)}.monaco-workbench .monaco-editor textarea::-moz-placeholder,.monaco-workbench .part textarea::-moz-placeholder{color:var(--vscode-input-placeholderForeground)}.monaco-workbench .monaco-editor .pointer,.monaco-workbench .part .pointer{cursor:pointer}.monaco-workbench.mac.monaco-font-aliasing-antialiased .monaco-editor,.monaco-workbench.mac.monaco-font-aliasing-antialiased .part{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.monaco-workbench.mac.monaco-font-aliasing-none .monaco-editor,.monaco-workbench.mac.monaco-font-aliasing-none .part{-webkit-font-smoothing:none;-moz-osx-font-smoothing:unset}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.monaco-workbench.mac.monaco-font-aliasing-auto .monaco-editor,.monaco-workbench.mac.monaco-font-aliasing-auto .part{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}.monaco-workbench .context-view{-webkit-app-region:no-drag}.monaco-workbench .codicon{color:var(--vscode-icon-foreground)}.monaco-workbench .codicon[class*=codicon-]{font-size:16px}.monaco-workbench .predefined-file-icon[class*=codicon-]:before{font-family:codicon;padding-left:3px;padding-right:3px;width:16px}.monaco-workbench:not(.file-icons-enabled) .predefined-file-icon[class*=codicon-]:before{content:unset!important}.monaco-workbench.modal-dialog-visible .monaco-progress-container.infinite .progress-bit{display:none}.monaco-workbench .monaco-editor select,.monaco-workbench .part select{appearance:none;-webkit-appearance:none;-moz-appearance:none;border:1px solid;font-family:inherit}.monaco-workbench .select-container{position:relative}.monaco-workbench .select-container:after{bottom:0;content:\"\\eab4\";font-family:codicon;font-size:16px;height:16px;line-height:16px;margin:auto;pointer-events:none;position:absolute;right:6px;top:0;width:16px}.monaco-workbench .monaco-editor .synthetic-focus,.monaco-workbench .monaco-editor [tabindex=\"-1\"]:focus,.monaco-workbench .monaco-editor [tabindex=\"0\"]:focus,.monaco-workbench .monaco-editor button:focus,.monaco-workbench .monaco-editor input[type=button]:focus,.monaco-workbench .monaco-editor input[type=checkbox]:focus,.monaco-workbench .monaco-editor input[type=search]:focus,.monaco-workbench .monaco-editor input[type=text]:focus,.monaco-workbench .monaco-editor select:focus,.monaco-workbench .monaco-editor textarea:focus,.monaco-workbench .mpart [tabindex=\"0\"]:focus,.monaco-workbench .part .synthetic-focus,.monaco-workbench .part [tabindex=\"-1\"]:focus,.monaco-workbench .part button:focus,.monaco-workbench .part input[type=button]:focus,.monaco-workbench .part input[type=checkbox]:focus,.monaco-workbench .part input[type=search]:focus,.monaco-workbench .part input[type=text]:focus,.monaco-workbench .part select:focus,.monaco-workbench .part textarea:focus{opacity:1;outline-color:var(--vscode-focusBorder);outline-offset:-1px;outline-style:solid;outline-width:1px}.monaco-workbench.hc-black .synthetic-focus input,.monaco-workbench.hc-light .synthetic-focus input{background:transparent}.monaco-workbench .monaco-editor input[type=checkbox]:focus,.monaco-workbench .part input[type=checkbox]:focus{outline-offset:2px}.monaco-workbench .monaco-editor [tabindex=\"-1\"]:active,.monaco-workbench .monaco-editor [tabindex=\"0\"]:active,.monaco-workbench .monaco-editor input[type=button]:active,.monaco-workbench .monaco-editor input[type=checkbox]:active,.monaco-workbench .monaco-editor select:active,.monaco-workbench .part [tabindex=\"-1\"]:active,.monaco-workbench .part input[type=button]:active,.monaco-workbench .part input[type=checkbox]:active,.monaco-workbench .part select:active,.monaco-workbench part [tabindex=\"0\"]:active{outline:0!important}.monaco-workbench.mac .monaco-editor select:focus,.monaco-workbench.mac .part select:focus{border-color:transparent}.monaco-workbench .monaco-list:not(.element-focused):focus:before{content:\"\";height:100%;left:0;outline:1px solid;outline-color:var(--vscode-focusBorder);outline-offset:-1px;outline-style:solid;outline-width:1px;pointer-events:none;position:absolute;top:0;width:100%;z-index:15}.monaco-workbench .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{color:var(--vscode-list-highlightForeground)}.monaco-workbench .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)}.monaco-workbench .monaco-inputbox.error input[type=text]:focus,.monaco-workbench .monaco-inputbox.error.synthetic-focus,.monaco-workbench .monaco-inputbox.info input[type=text]:focus,.monaco-workbench .monaco-inputbox.info.synthetic-focus,.monaco-workbench .monaco-inputbox.warning input[type=text]:focus,.monaco-workbench .monaco-inputbox.warning.synthetic-focus,.monaco-workbench .monaco-list:focus,.monaco-workbench .synthetic-focus :focus{outline:0!important}.monaco-workbench a.monaco-link:hover{text-decoration:underline}.monaco-workbench .monaco-action-bar:not(.vertical) .action-label:not(.disabled):hover,.monaco-workbench .monaco-action-bar:not(.vertical) .monaco-dropdown-with-primary:not(.disabled):hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .monaco-action-bar:not(.vertical) .action-item.active .action-label:not(.disabled),.monaco-workbench .monaco-action-bar:not(.vertical) .monaco-dropdown.active .action-label:not(.disabled){background-color:var(--vscode-toolbar-activeBackground)}.monaco-workbench .monaco-action-bar:not(.vertical) .action-item .action-label:hover:not(.disabled){outline:1px dashed var(--vscode-toolbar-hoverOutline);outline-offset:-1px}";
|
|
3
|
+
n(css,{});
|
|
4
|
+
export { css, css as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import './media/style.css.js';
|
|
1
2
|
import { isWindows, isMacintosh } from '../../base/common/platform.js';
|
|
2
3
|
const DEFAULT_FONT_FAMILY = isWindows ? '"Segoe WPC", "Segoe UI", sans-serif' : isMacintosh ? '-apple-system, BlinkMacSystemFont, sans-serif' : 'system-ui, "Ubuntu", "Droid Sans", sans-serif';
|
|
3
4
|
export { DEFAULT_FONT_FAMILY };
|
|
@@ -206,7 +206,7 @@ const configuration = {
|
|
|
206
206
|
'`#audioCues.lineHasError#`'
|
|
207
207
|
)),
|
|
208
208
|
'type': 'boolean',
|
|
209
|
-
'default':
|
|
209
|
+
'default': false,
|
|
210
210
|
tags: ['accessibility']
|
|
211
211
|
},
|
|
212
212
|
["accessibility.alert.warning" ]: {
|
|
@@ -217,7 +217,7 @@ const configuration = {
|
|
|
217
217
|
'`#audioCues.lineHasWarning#`'
|
|
218
218
|
)),
|
|
219
219
|
'type': 'boolean',
|
|
220
|
-
'default':
|
|
220
|
+
'default': false,
|
|
221
221
|
tags: ['accessibility']
|
|
222
222
|
},
|
|
223
223
|
["accessibility.alert.foldedArea" ]: {
|
|
@@ -228,7 +228,7 @@ const configuration = {
|
|
|
228
228
|
'`#audioCues.lineHasFoldedArea#`'
|
|
229
229
|
)),
|
|
230
230
|
'type': 'boolean',
|
|
231
|
-
'default':
|
|
231
|
+
'default': false,
|
|
232
232
|
tags: ['accessibility']
|
|
233
233
|
},
|
|
234
234
|
["accessibility.alert.terminalQuickFix" ]: {
|
|
@@ -326,7 +326,7 @@ const configuration = {
|
|
|
326
326
|
'`#audioCues.lineHasBreakpoint#`'
|
|
327
327
|
)),
|
|
328
328
|
'type': 'boolean',
|
|
329
|
-
'default':
|
|
329
|
+
'default': false,
|
|
330
330
|
tags: ['accessibility']
|
|
331
331
|
},
|
|
332
332
|
["accessibility.alert.notebookCellCompleted" ]: {
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { toAction } from '../../../../base/common/actions.js';
|
|
2
|
+
import { coalesce } from '../../../../base/common/arrays.js';
|
|
3
|
+
import { toErrorMessage } from '../../../../base/common/errorMessage.js';
|
|
4
|
+
import { isCancellationError } from '../../../../base/common/errors.js';
|
|
5
|
+
import { hash } from '../../../../base/common/hash.js';
|
|
6
|
+
import { KeyChord } from '../../../../base/common/keyCodes.js';
|
|
7
|
+
import { isEqual } from '../../../../base/common/resources.js';
|
|
8
|
+
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
|
|
9
|
+
import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/embeddedCodeEditorWidget.js';
|
|
10
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
11
|
+
import { CommandsRegistry } from '../../../../platform/commands/common/commands.js';
|
|
12
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
13
|
+
import { KeybindingsRegistry } from '../../../../platform/keybinding/common/keybindingsRegistry.js';
|
|
14
|
+
import { IListService } from '../../../../platform/list/browser/listService.js';
|
|
15
|
+
import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js';
|
|
16
|
+
import { getMultiSelectedEditorContexts } from '../../../browser/parts/editor/editorCommands.js';
|
|
17
|
+
import { EditorResourceAccessor, SideBySideEditor } from '../../../common/editor.js';
|
|
18
|
+
import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js';
|
|
19
|
+
import { getOpenEditorsViewMultiSelection } from './files.js';
|
|
20
|
+
import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js';
|
|
21
|
+
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
22
|
+
import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
|
|
23
|
+
import { SAVE_FILE_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_IN_GROUP_COMMAND_ID, SAVE_FILES_COMMAND_ID } from './fileConstants.js';
|
|
24
|
+
async function saveSelectedEditors(accessor, options) {
|
|
25
|
+
const listService = accessor.get(IListService);
|
|
26
|
+
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
27
|
+
const codeEditorService = accessor.get(ICodeEditorService);
|
|
28
|
+
const textFileService = accessor.get(ITextFileService);
|
|
29
|
+
let editors = getOpenEditorsViewMultiSelection(listService);
|
|
30
|
+
if (!editors) {
|
|
31
|
+
const activeGroup = editorGroupService.activeGroup;
|
|
32
|
+
if (activeGroup.activeEditor) {
|
|
33
|
+
editors = [];
|
|
34
|
+
if (activeGroup.activeEditor instanceof SideBySideEditorInput &&
|
|
35
|
+
!options?.saveAs && !(activeGroup.activeEditor.primary.hasCapability(4 ) || activeGroup.activeEditor.secondary.hasCapability(4 )) &&
|
|
36
|
+
activeGroup.activeEditor.secondary.isModified()) {
|
|
37
|
+
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.primary });
|
|
38
|
+
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.secondary });
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!editors || editors.length === 0) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
await doSaveEditors(accessor, editors, options);
|
|
49
|
+
const focusedCodeEditor = codeEditorService.getFocusedCodeEditor();
|
|
50
|
+
if (focusedCodeEditor instanceof EmbeddedCodeEditorWidget && !focusedCodeEditor.isSimpleWidget) {
|
|
51
|
+
const resource = focusedCodeEditor.getModel()?.uri;
|
|
52
|
+
if (resource && !( editors.some(
|
|
53
|
+
({ editor }) => isEqual(EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY }), resource)
|
|
54
|
+
))) {
|
|
55
|
+
const model = textFileService.files.get(resource);
|
|
56
|
+
if (!model?.isReadonly()) {
|
|
57
|
+
await textFileService.save(resource, options);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function saveDirtyEditorsOfGroups(accessor, groups, options) {
|
|
63
|
+
const dirtyEditors = [];
|
|
64
|
+
for (const group of groups) {
|
|
65
|
+
for (const editor of group.getEditors(0 )) {
|
|
66
|
+
if (editor.isDirty()) {
|
|
67
|
+
dirtyEditors.push({ groupId: group.id, editor });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return doSaveEditors(accessor, dirtyEditors, options);
|
|
72
|
+
}
|
|
73
|
+
async function doSaveEditors(accessor, editors, options) {
|
|
74
|
+
const editorService = accessor.get(IEditorService);
|
|
75
|
+
const notificationService = accessor.get(INotificationService);
|
|
76
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
77
|
+
try {
|
|
78
|
+
await editorService.save(editors, options);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (!isCancellationError(error)) {
|
|
82
|
+
notificationService.notify({
|
|
83
|
+
id: ( editors.map(({ editor }) => hash(editor.resource?.toString()))).join(),
|
|
84
|
+
severity: Severity.Error,
|
|
85
|
+
message: ( localizeWithPath(
|
|
86
|
+
'vs/workbench/contrib/files/browser/fileCommands.save',
|
|
87
|
+
{ key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] },
|
|
88
|
+
"Failed to save '{0}': {1}",
|
|
89
|
+
( editors.map(({ editor }) => editor.getName())).join(', '),
|
|
90
|
+
toErrorMessage(error, false)
|
|
91
|
+
)),
|
|
92
|
+
actions: {
|
|
93
|
+
primary: [
|
|
94
|
+
toAction({ id: 'workbench.action.files.saveEditors', label: ( localizeWithPath('vs/workbench/contrib/files/browser/fileCommands.save', 'retry', "Retry")), run: () => instantiationService.invokeFunction(accessor => doSaveEditors(accessor, editors, options)) }),
|
|
95
|
+
toAction({ id: 'workbench.action.files.revertEditors', label: ( localizeWithPath(
|
|
96
|
+
'vs/workbench/contrib/files/browser/fileCommands.save',
|
|
97
|
+
'discard',
|
|
98
|
+
"Discard"
|
|
99
|
+
)), run: () => editorService.revert(editors) })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
107
|
+
when: undefined,
|
|
108
|
+
weight: 200 ,
|
|
109
|
+
primary: 2048 | 49 ,
|
|
110
|
+
id: SAVE_FILE_COMMAND_ID,
|
|
111
|
+
handler: accessor => {
|
|
112
|
+
return saveSelectedEditors(accessor, { reason: 1 , force: true });
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
116
|
+
when: undefined,
|
|
117
|
+
weight: 200 ,
|
|
118
|
+
primary: KeyChord(2048 | 41 , 49 ),
|
|
119
|
+
win: { primary: KeyChord(2048 | 41 , 2048 | 1024 | 49 ) },
|
|
120
|
+
id: SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID,
|
|
121
|
+
handler: accessor => {
|
|
122
|
+
return saveSelectedEditors(accessor, { reason: 1 , force: true , skipSaveParticipants: true });
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
126
|
+
id: SAVE_FILE_AS_COMMAND_ID,
|
|
127
|
+
weight: 200 ,
|
|
128
|
+
when: undefined,
|
|
129
|
+
primary: 2048 | 1024 | 49 ,
|
|
130
|
+
handler: accessor => {
|
|
131
|
+
return saveSelectedEditors(accessor, { reason: 1 , saveAs: true });
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
135
|
+
when: undefined,
|
|
136
|
+
weight: 200 ,
|
|
137
|
+
primary: undefined,
|
|
138
|
+
mac: { primary: 2048 | 512 | 49 },
|
|
139
|
+
win: { primary: KeyChord(2048 | 41 , 49 ) },
|
|
140
|
+
id: SAVE_ALL_COMMAND_ID,
|
|
141
|
+
handler: accessor => {
|
|
142
|
+
return saveDirtyEditorsOfGroups(accessor, accessor.get(IEditorGroupsService).getGroups(1 ), { reason: 1 });
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
CommandsRegistry.registerCommand({
|
|
146
|
+
id: SAVE_ALL_IN_GROUP_COMMAND_ID,
|
|
147
|
+
handler: (accessor, _, editorContext) => {
|
|
148
|
+
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
149
|
+
const contexts = getMultiSelectedEditorContexts(editorContext, accessor.get(IListService), accessor.get(IEditorGroupsService));
|
|
150
|
+
let groups = undefined;
|
|
151
|
+
if (!contexts.length) {
|
|
152
|
+
groups = editorGroupService.getGroups(1 );
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
groups = coalesce(( contexts.map(context => editorGroupService.getGroup(context.groupId))));
|
|
156
|
+
}
|
|
157
|
+
return saveDirtyEditorsOfGroups(accessor, groups, { reason: 1 });
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
CommandsRegistry.registerCommand({
|
|
161
|
+
id: SAVE_FILES_COMMAND_ID,
|
|
162
|
+
handler: async (accessor) => {
|
|
163
|
+
const editorService = accessor.get(IEditorService);
|
|
164
|
+
const res = await editorService.saveAll({ includeUntitled: false, reason: 1 });
|
|
165
|
+
return res.success;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
@@ -16,6 +16,7 @@ import { generateUuid } from '../../../../base/common/uuid.js';
|
|
|
16
16
|
import { IBulkEditService } from '../../../../editor/browser/services/bulkEditService.js';
|
|
17
17
|
import { Position } from '../../../../editor/common/core/position.js';
|
|
18
18
|
import { Range } from '../../../../editor/common/core/range.js';
|
|
19
|
+
import { Selection } from '../../../../editor/common/core/selection.js';
|
|
19
20
|
import { TextEdit } from '../../../../editor/common/languages.js';
|
|
20
21
|
import { IEditorWorkerService } from '../../../../editor/common/services/editorWorker.js';
|
|
21
22
|
import { InlineCompletionsController } from '../../../../editor/contrib/inlineCompletions/browser/inlineCompletionsController.js';
|
|
@@ -41,6 +42,19 @@ import { INLINE_CHAT_ID, CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST, CTX_INLINE_CHAT_DID
|
|
|
41
42
|
import { ICommandService } from '../../../../platform/commands/common/commands.js';
|
|
42
43
|
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
|
|
43
44
|
var InlineChatController_1;
|
|
45
|
+
class InlineChatRunOptions {
|
|
46
|
+
static isInteractiveEditorOptions(options) {
|
|
47
|
+
const { initialSelection, initialRange, message, autoSend, position } = options;
|
|
48
|
+
if (typeof message !== 'undefined' && typeof message !== 'string'
|
|
49
|
+
|| typeof autoSend !== 'undefined' && typeof autoSend !== 'boolean'
|
|
50
|
+
|| typeof initialRange !== 'undefined' && !Range.isIRange(initialRange)
|
|
51
|
+
|| typeof initialSelection !== 'undefined' && !Selection.isISelection(initialSelection)
|
|
52
|
+
|| typeof position !== 'undefined' && !Position.isIPosition(position)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
44
58
|
let InlineChatController = class InlineChatController {
|
|
45
59
|
static { InlineChatController_1 = this; }
|
|
46
60
|
static get(editor) {
|
|
@@ -981,4 +995,4 @@ async function sendRequest(accessor, query) {
|
|
|
981
995
|
}
|
|
982
996
|
widget.acceptInput(query);
|
|
983
997
|
}
|
|
984
|
-
export { InlineChatController };
|
|
998
|
+
export { InlineChatController, InlineChatRunOptions };
|
|
@@ -11,6 +11,7 @@ interface IBannerItem {
|
|
|
11
11
|
readonly actions?: ILinkDescriptor[];
|
|
12
12
|
readonly ariaLabel?: string;
|
|
13
13
|
readonly onClose?: () => void;
|
|
14
|
+
readonly disableCloseAction?: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare const IBannerService: ServiceIdentifier<IBannerService>;
|
|
16
17
|
interface IBannerService {
|