@codingame/monaco-vscode-api 1.80.0 → 1.80.1
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/README.md +2 -1
- package/dist/api.js +6 -6
- package/dist/default-extensions/npm/npmBrowserMain.js.map +1 -1
- package/dist/default-extensions/typescript-language-features/tsserver.web.js.map +1 -1
- package/dist/missing-services.js +4 -1
- package/dist/monaco.js +4 -0
- package/dist/override/vs/platform/dialogs/common/dialogs.js +7 -0
- package/dist/service-override/dialogs.js +2 -1
- package/dist/service-override/extensions.js +2 -1
- package/dist/service-override/keybindings.js +1 -0
- package/dist/service-override/languageDetectionWorker.d.ts +5 -0
- package/dist/service-override/languageDetectionWorker.js +15 -0
- package/dist/service-override/layout.js +12 -1
- package/dist/service-override/snippets.js +1 -0
- package/dist/service-override/views.d.ts +24 -2
- package/dist/service-override/views.js +119 -12
- package/dist/services.js +2 -1
- package/dist/vscode/vs/platform/audioCues/browser/media/all.mp3.js +17 -17
- package/dist/vscode/vs/platform/diagnostics/common/diagnostics.js +27 -0
- package/dist/vscode/vs/platform/dialogs/common/dialogs.js +126 -0
- package/dist/vscode/vs/workbench/api/browser/mainThreadAuthentication.js +2 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadDialogs.js +2 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadFileSystemEventService.js +2 -1
- package/dist/vscode/vs/workbench/api/browser/mainThreadMessageService.js +2 -1
- package/dist/vscode/vs/workbench/browser/actions/layoutActions.js +1 -0
- package/dist/vscode/vs/workbench/browser/actions/windowActions.js +2 -1
- package/dist/vscode/vs/workbench/browser/actions/workspaceActions.js +2 -1
- package/dist/vscode/vs/workbench/browser/actions/workspaceCommands.js +1 -0
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js +2 -1
- package/dist/vscode/vs/workbench/browser/parts/dialogs/dialogHandler.js +2 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorActions.js +2 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorGroupView.js +2 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPanes.js +2 -1
- package/dist/vscode/vs/workbench/browser/parts/editor/editorPlaceholder.js +2 -1
- package/dist/vscode/vs/workbench/common/editor/editorInput.d.ts +1 -1
- package/dist/vscode/vs/workbench/common/theme.js +5 -5
- package/dist/vscode/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +2 -1
- package/dist/vscode/vs/workbench/contrib/codeActions/browser/codeActions.contribution.js +25 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +138 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/browser/documentationContribution.js +59 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.js +61 -0
- package/dist/vscode/vs/workbench/contrib/codeActions/common/documentationExtensionPoint.js +58 -0
- package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugAdapterManager.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugService.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/debugTaskRunner.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/browser/rawDebugSession.js +2 -1
- package/dist/vscode/vs/workbench/contrib/debug/common/debugLifecycle.js +2 -1
- package/dist/vscode/vs/workbench/contrib/extensions/browser/extensionsActions.js +2 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/fileActions.js +2 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/fileCommands.js +2 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/fileImportExport.js +2 -1
- package/dist/vscode/vs/workbench/contrib/files/browser/views/explorerViewer.js +2 -1
- package/dist/vscode/vs/workbench/contrib/folding/browser/folding.contribution.js +84 -0
- package/dist/vscode/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +172 -0
- package/dist/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +2 -1
- package/dist/vscode/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +24 -0
- package/dist/vscode/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js +132 -0
- package/dist/vscode/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +360 -0
- package/dist/vscode/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
- package/dist/vscode/vs/workbench/contrib/list/browser/list.contribution.js +15 -0
- package/dist/vscode/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -1
- package/dist/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys.js +3 -0
- package/dist/vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +2 -1
- package/dist/vscode/vs/workbench/contrib/search/browser/searchView.js +2 -1
- package/dist/vscode/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +2 -1
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +20 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/configureSnippets.js +264 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +87 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/insertSnippet.js +126 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/commands/surroundWithSnippet.js +56 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetCodeActionProvider.js +133 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippetPicker.js +83 -0
- package/dist/vscode/vs/workbench/contrib/snippets/browser/snippets.contribution.js +113 -0
- package/dist/vscode/vs/workbench/contrib/tasks/browser/taskQuickPick.js +2 -1
- package/dist/vscode/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +2 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +2 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalInstance.js +2 -1
- package/dist/vscode/vs/workbench/contrib/terminal/browser/terminalService.js +5 -3
- package/dist/vscode/vs/workbench/services/authentication/browser/authenticationService.js +1 -0
- package/dist/vscode/vs/workbench/services/dialogs/browser/abstractFileDialogService.js +2 -1
- package/dist/vscode/vs/workbench/services/dialogs/browser/simpleFileDialog.js +2 -1
- package/dist/vscode/vs/workbench/services/dialogs/common/dialogService.js +1 -0
- package/dist/vscode/vs/workbench/services/extensions/browser/extensionService.js +1 -0
- package/dist/vscode/vs/workbench/services/extensions/browser/extensionUrlHandler.js +1 -0
- package/dist/vscode/vs/workbench/services/extensions/common/abstractExtensionService.js +2 -1
- package/dist/vscode/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.js +173 -0
- package/dist/vscode/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.js +257 -0
- package/dist/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js +2 -1
- package/dist/vscode/vs/workbench/services/remote/common/remoteExplorerService.js +2 -1
- package/dist/vscode/vs/workbench/services/textfile/browser/browserTextFileService.js +2 -1
- package/dist/vscode/vs/workbench/services/textfile/browser/textFileService.js +2 -1
- package/dist/vscode/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +2 -1
- package/dist/workers/languageDetection.worker.js +8 -0
- package/monaco-editor-treemending.patch +551 -551
- package/package.json +3 -2
package/dist/missing-services.js
CHANGED
|
@@ -63,7 +63,7 @@ import { IWorkingCopyBackupService } from './vscode/vs/workbench/services/workin
|
|
|
63
63
|
import { IWorkingCopyService, WorkingCopyService } from './vscode/vs/workbench/services/workingCopy/common/workingCopyService.js';
|
|
64
64
|
import { IFilesConfigurationService, FilesConfigurationService } from './vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js';
|
|
65
65
|
import { IUntitledTextEditorService } from './vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js';
|
|
66
|
-
import
|
|
66
|
+
import './override/vs/platform/dialogs/common/dialogs.js';
|
|
67
67
|
import { IElevatedFileService } from './vscode/vs/workbench/services/files/common/elevatedFileService.js';
|
|
68
68
|
import { BrowserElevatedFileService } from './vscode/vs/workbench/services/files/browser/elevatedFileService.js';
|
|
69
69
|
import { IDecorationsService } from './vscode/vs/workbench/services/decorations/common/decorations.js';
|
|
@@ -161,7 +161,9 @@ import { IChatContributionService } from './vscode/vs/workbench/contrib/chat/com
|
|
|
161
161
|
import { ITestProfileService } from './vscode/vs/workbench/contrib/testing/common/testProfileService.js';
|
|
162
162
|
import { IEncryptionService } from './vscode/vs/platform/encryption/common/encryptionService.js';
|
|
163
163
|
import { ITestResultService } from './vscode/vs/workbench/contrib/testing/common/testResultService.js';
|
|
164
|
+
import { IDiagnosticsService, NullDiagnosticsService } from './vscode/vs/platform/diagnostics/common/diagnostics.js';
|
|
164
165
|
import { unsupported } from './tools.js';
|
|
166
|
+
import { IFileDialogService } from './vscode/vs/platform/dialogs/common/dialogs.js';
|
|
165
167
|
class NullLoggerService extends AbstractLoggerService {
|
|
166
168
|
constructor() {
|
|
167
169
|
super(LogLevel.Info, URI.file('logs.log'));
|
|
@@ -1998,3 +2000,4 @@ registerSingleton(IUserDataInitializationService, class UserDataInitializationSe
|
|
|
1998
2000
|
this.initializeOtherResources = async () => { };
|
|
1999
2001
|
}
|
|
2000
2002
|
}, 1 );
|
|
2003
|
+
registerSingleton(IDiagnosticsService, NullDiagnosticsService, 1 );
|
package/dist/monaco.js
CHANGED
|
@@ -48,6 +48,10 @@ import './vscode/vs/workbench/contrib/codeEditor/browser/toggleRenderControlChar
|
|
|
48
48
|
import './vscode/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js';
|
|
49
49
|
import './vscode/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js';
|
|
50
50
|
import './vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.js';
|
|
51
|
+
import './vscode/vs/workbench/contrib/folding/browser/folding.contribution.js';
|
|
52
|
+
import './vscode/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js';
|
|
53
|
+
import './vscode/vs/workbench/contrib/codeActions/browser/codeActions.contribution.js';
|
|
54
|
+
import './vscode/vs/workbench/contrib/list/browser/list.contribution.js';
|
|
51
55
|
let ExtensionPoints = class ExtensionPoints {
|
|
52
56
|
constructor(instantiationService) {
|
|
53
57
|
this.instantiationService = instantiationService;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var ConfirmResult;
|
|
2
|
+
( (function(ConfirmResult) {
|
|
3
|
+
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
4
|
+
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
5
|
+
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
6
|
+
})(ConfirmResult || (ConfirmResult = {})));
|
|
7
|
+
export { ConfirmResult };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import '../missing-services.js';
|
|
2
2
|
import '../vscode/vs/workbench/browser/parts/dialogs/dialog.web.contribution.js';
|
|
3
3
|
import { DialogService } from '../vscode/vs/workbench/services/dialogs/common/dialogService.js';
|
|
4
|
-
import
|
|
4
|
+
import '../override/vs/platform/dialogs/common/dialogs.js';
|
|
5
5
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
6
6
|
import { AbstractFileDialogService } from '../vscode/vs/workbench/services/dialogs/browser/abstractFileDialogService.js';
|
|
7
7
|
import getServiceOverride$1 from './layout.js';
|
|
8
8
|
import { unsupported } from '../tools.js';
|
|
9
|
+
import { IDialogService, IFileDialogService } from '../vscode/vs/platform/dialogs/common/dialogs.js';
|
|
9
10
|
class FileDialogService extends AbstractFileDialogService {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -10,7 +10,7 @@ import { INotificationService } from 'monaco-editor/esm/vs/platform/notification
|
|
|
10
10
|
import { AbstractExtensionService, DeltaExtensionsQueueItem, ResolvedExtensions } from '../vscode/vs/workbench/services/extensions/common/abstractExtensionService.js';
|
|
11
11
|
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
12
12
|
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
13
|
-
import
|
|
13
|
+
import '../override/vs/platform/dialogs/common/dialogs.js';
|
|
14
14
|
import { IRemoteAuthorityResolverService } from '../vscode/vs/platform/remote/common/remoteAuthorityResolver.js';
|
|
15
15
|
import { IRemoteExtensionsScannerService } from '../vscode/vs/platform/remote/common/remoteExtensionsScanner.js';
|
|
16
16
|
import { IRemoteAgentService } from '../vscode/vs/workbench/services/remote/common/remoteAgentService.js';
|
|
@@ -121,6 +121,7 @@ import '../vscode/vs/workbench/api/browser/mainThreadProfilContentHandlers.js';
|
|
|
121
121
|
import '../vscode/vs/workbench/api/browser/mainThreadSemanticSimilarity.js';
|
|
122
122
|
import '../vscode/vs/workbench/api/browser/mainThreadIssueReporter.js';
|
|
123
123
|
import '../vscode/vs/workbench/api/common/extHost.common.services.js';
|
|
124
|
+
import { IDialogService } from '../vscode/vs/platform/dialogs/common/dialogs.js';
|
|
124
125
|
function createMessagePassingProtocolPair() {
|
|
125
126
|
const emitterA = new BufferedEmitter();
|
|
126
127
|
const emitterB = new BufferedEmitter();
|
|
@@ -12,6 +12,7 @@ import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/c
|
|
|
12
12
|
import { CommandService } from '../vscode/vs/workbench/services/commands/common/commandService.js';
|
|
13
13
|
import getServiceOverride$1 from './files.js';
|
|
14
14
|
import '../vscode/vs/workbench/browser/workbench.contribution.js';
|
|
15
|
+
import '../vscode/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js';
|
|
15
16
|
async function updateUserKeybindings(keybindingsJson) {
|
|
16
17
|
const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
|
|
17
18
|
await StandaloneServices.get(IFileService).writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsJson));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import '../missing-services.js';
|
|
2
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
3
|
+
import { LanguageDetectionService } from '../vscode/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.js';
|
|
4
|
+
import { ILanguageDetectionService } from '../vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.js';
|
|
5
|
+
import { registerAssets } from '../assets.js';
|
|
6
|
+
registerAssets({
|
|
7
|
+
'vs/../../node_modules/@vscode/vscode-languagedetection/model/model.json': new URL('@vscode/vscode-languagedetection/model/model.json', import.meta.url).href,
|
|
8
|
+
'vs/../../node_modules/@vscode/vscode-languagedetection/model/group1-shard1of1.bin': new URL('@vscode/vscode-languagedetection/model/group1-shard1of1.bin', import.meta.url).href
|
|
9
|
+
});
|
|
10
|
+
function getServiceOverride() {
|
|
11
|
+
return {
|
|
12
|
+
[( ILanguageDetectionService.toString())]: new SyncDescriptor(LanguageDetectionService)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export { getServiceOverride as default };
|
|
@@ -9,6 +9,8 @@ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
|
9
9
|
import { isAncestorUsingFlowTo } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
10
10
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
11
11
|
import { IPaneCompositePartService } from '../vscode/vs/workbench/services/panecomposite/browser/panecomposite.js';
|
|
12
|
+
import { isChrome, isFirefox, isSafari, isWindows, isLinux } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
13
|
+
import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
12
14
|
let LayoutService = class LayoutService {
|
|
13
15
|
constructor(container, paneCompositeService) {
|
|
14
16
|
this.container = container;
|
|
@@ -110,7 +112,16 @@ LayoutService = __decorate([
|
|
|
110
112
|
( __param(1, IPaneCompositePartService))
|
|
111
113
|
], LayoutService);
|
|
112
114
|
function getServiceOverride(container = document.body) {
|
|
113
|
-
|
|
115
|
+
const platformClass = isWindows ? 'windows' : isLinux ? 'linux' : 'mac';
|
|
116
|
+
const workbenchClasses = coalesce([
|
|
117
|
+
'monaco-workbench',
|
|
118
|
+
platformClass,
|
|
119
|
+
'web',
|
|
120
|
+
isChrome ? 'chromium' : isFirefox ? 'firefox' : isSafari ? 'safari' : undefined
|
|
121
|
+
]);
|
|
122
|
+
container.classList.add(...workbenchClasses);
|
|
123
|
+
document.body.classList.add(platformClass);
|
|
124
|
+
document.body.classList.add('web');
|
|
114
125
|
return {
|
|
115
126
|
[( ILayoutService.toString())]: new SyncDescriptor(LayoutService, [container]),
|
|
116
127
|
[( IWorkbenchLayoutService.toString())]: new SyncDescriptor(LayoutService, [container])
|
|
@@ -6,6 +6,7 @@ import { SnippetsService } from '../vscode/vs/workbench/contrib/snippets/browser
|
|
|
6
6
|
import { ILifecycleService } from '../vscode/vs/workbench/services/lifecycle/common/lifecycle.js';
|
|
7
7
|
import getServiceOverride$1 from './files.js';
|
|
8
8
|
import { registerServiceInitializeParticipant } from '../services.js';
|
|
9
|
+
import '../vscode/vs/workbench/contrib/snippets/browser/snippets.contribution.js';
|
|
9
10
|
registerServiceInitializeParticipant(async (accessor) => {
|
|
10
11
|
void accessor.get(ILifecycleService).when(2 ).then(() => {
|
|
11
12
|
StandaloneServices.get(ISnippetsService);
|
|
@@ -10,8 +10,10 @@ export { HoverService } from '../vscode/vs/workbench/services/hover/browser/hove
|
|
|
10
10
|
export { PanelPart } from '../vscode/vs/workbench/browser/parts/panel/panelPart.js';
|
|
11
11
|
export { IEditorOptions } from '../vscode/vs/platform/editor/common/editor.js';
|
|
12
12
|
import { Codicon } from '../vscode/vs/base/common/codicons.js';
|
|
13
|
+
import { IEditorCloseHandler, EditorInput } from '../vscode/vs/workbench/common/editor/editorInput.js';
|
|
13
14
|
export { IResolvedTextEditorModel } from '../vscode/vs/editor/common/services/resolverService.js';
|
|
14
15
|
export { StatusbarPart } from '../vscode/vs/workbench/browser/parts/statusbar/statusbarPart.js';
|
|
16
|
+
export { ConfirmResult } from '../vscode/vs/platform/dialogs/common/dialogs.js';
|
|
15
17
|
import { OpenEditor } from '../dist/types/src/service-override/tools/editor.js';
|
|
16
18
|
|
|
17
19
|
declare function renderActivitybarPar(container: HTMLElement): IDisposable;
|
|
@@ -19,8 +21,28 @@ declare function renderSidebarPart(container: HTMLElement): IDisposable;
|
|
|
19
21
|
declare function renderPanelPart(container: HTMLElement): IDisposable;
|
|
20
22
|
declare function renderEditorPart(container: HTMLElement): IDisposable;
|
|
21
23
|
declare function renderStatusBarPart(container: HTMLElement): IDisposable;
|
|
24
|
+
type Label = string | {
|
|
25
|
+
short: string;
|
|
26
|
+
medium: string;
|
|
27
|
+
long: string;
|
|
28
|
+
};
|
|
29
|
+
interface EditorPanelOption {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
renderBody(container: HTMLElement): IDisposable;
|
|
33
|
+
}
|
|
34
|
+
interface SimpleEditorInput extends EditorInput {
|
|
35
|
+
setName(name: Label): void;
|
|
36
|
+
setTitle(title: Label): void;
|
|
37
|
+
setDescription(description: Label): void;
|
|
38
|
+
setDirty(dirty: boolean): void;
|
|
39
|
+
}
|
|
40
|
+
declare function registerEditorPane(options: EditorPanelOption): {
|
|
41
|
+
disposable: IDisposable;
|
|
42
|
+
CustomEditorInput: new (closeHandler?: IEditorCloseHandler) => SimpleEditorInput;
|
|
43
|
+
};
|
|
22
44
|
interface CustomViewOption {
|
|
23
|
-
id: string;
|
|
45
|
+
readonly id: string;
|
|
24
46
|
name: string;
|
|
25
47
|
order?: number;
|
|
26
48
|
renderBody(container: HTMLElement): IDisposable;
|
|
@@ -42,4 +64,4 @@ declare function registerCustomView(options: CustomViewOption): IDisposable;
|
|
|
42
64
|
declare function isEditorPartVisible(): boolean;
|
|
43
65
|
declare function getServiceOverride(openEditorFallback?: OpenEditor, _webviewIframeAlternateDomains?: string): IEditorOverrideServices;
|
|
44
66
|
|
|
45
|
-
export { CustomViewOption, OpenEditor, ViewContainerLocation, getServiceOverride as default, isEditorPartVisible, registerCustomView, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|
|
67
|
+
export { CustomViewOption, EditorPanelOption, IEditorCloseHandler, OpenEditor, ViewContainerLocation, getServiceOverride as default, isEditorPartVisible, registerCustomView, registerEditorPane, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|
|
@@ -39,6 +39,8 @@ import '../vscode/vs/workbench/browser/workbench.contribution.js';
|
|
|
39
39
|
import '../vscode/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js';
|
|
40
40
|
import '../vscode/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js';
|
|
41
41
|
import '../vscode/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js';
|
|
42
|
+
import '../vscode/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js';
|
|
43
|
+
import '../vscode/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js';
|
|
42
44
|
import '../vscode/vs/workbench/contrib/files/browser/files.contribution.js';
|
|
43
45
|
import '../vscode/vs/workbench/contrib/files/browser/files.contribution2.js';
|
|
44
46
|
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
@@ -52,6 +54,8 @@ import { IBreadcrumbsService, BreadcrumbsService } from '../vscode/vs/workbench/
|
|
|
52
54
|
import { IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
53
55
|
import { ContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextViewService.js';
|
|
54
56
|
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
57
|
+
import { EditorInput } from '../vscode/vs/workbench/common/editor/editorInput.js';
|
|
58
|
+
import { EditorExtensions } from '../vscode/vs/workbench/common/editor.js';
|
|
55
59
|
import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
56
60
|
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
57
61
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
@@ -80,6 +84,13 @@ import { IWebviewWorkbenchService, WebviewEditorService } from '../vscode/vs/wor
|
|
|
80
84
|
import { IWebviewService } from '../vscode/vs/workbench/contrib/webview/browser/webview.js';
|
|
81
85
|
import { IWebviewViewService, WebviewViewService } from '../vscode/vs/workbench/contrib/webviewView/browser/webviewViewService.js';
|
|
82
86
|
import { ILifecycleService } from '../vscode/vs/workbench/services/lifecycle/common/lifecycle.js';
|
|
87
|
+
import { positionToString } from '../vscode/vs/workbench/services/layout/browser/layoutService.js';
|
|
88
|
+
import { EditorPaneDescriptor } from '../vscode/vs/workbench/browser/editor.js';
|
|
89
|
+
import { EditorPane } from '../vscode/vs/workbench/browser/parts/editor/editorPane.js';
|
|
90
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
91
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
92
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
93
|
+
export { ConfirmResult } from '../override/vs/platform/dialogs/common/dialogs.js';
|
|
83
94
|
import { wrapOpenEditor } from './tools/editor.js';
|
|
84
95
|
import getServiceOverride$2 from './bulkEdit.js';
|
|
85
96
|
import getServiceOverride$1 from './layout.js';
|
|
@@ -129,12 +140,21 @@ class PaneCompositePartService {
|
|
|
129
140
|
return paneCompositeSelectorParts.get(viewContainerLocation);
|
|
130
141
|
}
|
|
131
142
|
}
|
|
132
|
-
function
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
143
|
+
function createPart(id, role, classes) {
|
|
144
|
+
const part = document.createElement(role === 'status' ? 'footer' : 'div');
|
|
145
|
+
part.classList.add('part', ...classes);
|
|
146
|
+
part.id = id;
|
|
147
|
+
part.setAttribute('role', role);
|
|
148
|
+
if (role === 'status') {
|
|
149
|
+
part.setAttribute('aria-live', 'off');
|
|
150
|
+
}
|
|
151
|
+
return part;
|
|
152
|
+
}
|
|
153
|
+
function renderPart(id, role, classes, part, container) {
|
|
154
|
+
const partContainer = createPart(id, role, classes);
|
|
155
|
+
container.append(partContainer);
|
|
156
|
+
partContainer.oncontextmenu = () => false;
|
|
157
|
+
part.create(partContainer);
|
|
138
158
|
function layout() {
|
|
139
159
|
part.layout(Math.max(part.minimumWidth, Math.min(part.maximumWidth, container.offsetWidth)), Math.max(part.minimumHeight, Math.min(part.maximumHeight, container.offsetHeight)), 0, 0);
|
|
140
160
|
}
|
|
@@ -155,13 +175,13 @@ function renderPart(part, container, classNames) {
|
|
|
155
175
|
function renderActivitybarPar(container) {
|
|
156
176
|
const activitybarPart = StandaloneServices.get(IInstantiationService).createInstance(ActivitybarPart, paneCompositeParts.get(0 ));
|
|
157
177
|
paneCompositeSelectorParts.set(0 , activitybarPart);
|
|
158
|
-
activitybarPart['_register'](renderPart(
|
|
178
|
+
activitybarPart['_register'](renderPart("workbench.parts.activitybar" , 'none', ['activitybar', 'left'], activitybarPart, container));
|
|
159
179
|
return activitybarPart;
|
|
160
180
|
}
|
|
161
181
|
function renderSidebarPart(container) {
|
|
162
182
|
const sidebarPart = StandaloneServices.get(IInstantiationService).createInstance(SidebarPart);
|
|
163
183
|
paneCompositeParts.set(0 , sidebarPart);
|
|
164
|
-
sidebarPart['_register'](renderPart(
|
|
184
|
+
sidebarPart['_register'](renderPart("workbench.parts.sidebar" , 'none', ['sidebar', 'left'], sidebarPart, container));
|
|
165
185
|
if (sidebarPart.getPaneComposites().length > 0) {
|
|
166
186
|
void sidebarPart.openPaneComposite(sidebarPart.getPaneComposites()[0].id);
|
|
167
187
|
}
|
|
@@ -171,7 +191,7 @@ function renderPanelPart(container) {
|
|
|
171
191
|
const panelPart = StandaloneServices.get(IInstantiationService).createInstance(PanelPart);
|
|
172
192
|
paneCompositeSelectorParts.set(1 , panelPart);
|
|
173
193
|
paneCompositeParts.set(1 , panelPart);
|
|
174
|
-
panelPart['_register'](renderPart(
|
|
194
|
+
panelPart['_register'](renderPart("workbench.parts.panel" , 'none', ['panel', 'basepanel', positionToString(0 )], panelPart, container));
|
|
175
195
|
if (panelPart.getPaneComposites().length > 0) {
|
|
176
196
|
void panelPart.openPaneComposite(panelPart.getPaneComposites()[0].id);
|
|
177
197
|
}
|
|
@@ -179,11 +199,98 @@ function renderPanelPart(container) {
|
|
|
179
199
|
}
|
|
180
200
|
function renderEditorPart(container) {
|
|
181
201
|
const editorPart = StandaloneServices.get(IEditorGroupsService);
|
|
182
|
-
return renderPart(
|
|
202
|
+
return renderPart("workbench.parts.editor" , 'main', ['editor'], editorPart, container);
|
|
183
203
|
}
|
|
184
204
|
function renderStatusBarPart(container) {
|
|
185
205
|
const statusBarPart = StandaloneServices.get(IStatusbarService);
|
|
186
|
-
return renderPart(
|
|
206
|
+
return renderPart("workbench.parts.statusbar" , 'status', ['statusbar'], statusBarPart, container);
|
|
207
|
+
}
|
|
208
|
+
function registerEditorPane(options) {
|
|
209
|
+
let CustomEditorPane = class CustomEditorPane extends EditorPane {
|
|
210
|
+
constructor(telemetryService, themeService, storageService) {
|
|
211
|
+
super(options.id, telemetryService, themeService, storageService);
|
|
212
|
+
}
|
|
213
|
+
createEditor(parent) {
|
|
214
|
+
this.content = $('.editor-pane-content');
|
|
215
|
+
this.content.style.display = 'flex';
|
|
216
|
+
this.content.style.alignItems = 'stretch';
|
|
217
|
+
append(parent, this.content);
|
|
218
|
+
this._register(options.renderBody(this.content));
|
|
219
|
+
}
|
|
220
|
+
layout(dimension) {
|
|
221
|
+
this.content.style.height = `${dimension.height}px`;
|
|
222
|
+
this.content.style.width = `${dimension.width}px`;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
CustomEditorPane = __decorate([
|
|
226
|
+
( __param(0, ITelemetryService)),
|
|
227
|
+
( __param(1, IThemeService)),
|
|
228
|
+
( __param(2, IStorageService))
|
|
229
|
+
], CustomEditorPane);
|
|
230
|
+
class CustomEditorInput extends EditorInput {
|
|
231
|
+
constructor(closeHandler) {
|
|
232
|
+
super();
|
|
233
|
+
this.closeHandler = closeHandler;
|
|
234
|
+
this.name = options.name;
|
|
235
|
+
this.title = options.name;
|
|
236
|
+
this.description = options.name;
|
|
237
|
+
this.dirty = false;
|
|
238
|
+
}
|
|
239
|
+
get typeId() {
|
|
240
|
+
return CustomEditorInput.ID;
|
|
241
|
+
}
|
|
242
|
+
get resource() {
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
setName(name) {
|
|
246
|
+
this.name = name;
|
|
247
|
+
this._onDidChangeLabel.fire();
|
|
248
|
+
}
|
|
249
|
+
setTitle(title) {
|
|
250
|
+
this.title = title;
|
|
251
|
+
this._onDidChangeLabel.fire();
|
|
252
|
+
}
|
|
253
|
+
setDescription(description) {
|
|
254
|
+
this.description = description;
|
|
255
|
+
this._onDidChangeLabel.fire();
|
|
256
|
+
}
|
|
257
|
+
getLabelValue(label, verbosity) {
|
|
258
|
+
if (typeof label === 'string') {
|
|
259
|
+
return label;
|
|
260
|
+
}
|
|
261
|
+
switch (verbosity) {
|
|
262
|
+
case 0 :
|
|
263
|
+
return label.short;
|
|
264
|
+
case 2 :
|
|
265
|
+
return label.long;
|
|
266
|
+
case 1 :
|
|
267
|
+
default:
|
|
268
|
+
return label.medium;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
getName() {
|
|
272
|
+
return this.name;
|
|
273
|
+
}
|
|
274
|
+
getTitle(verbosity) {
|
|
275
|
+
return this.getLabelValue(this.title, verbosity);
|
|
276
|
+
}
|
|
277
|
+
getDescription(verbosity) {
|
|
278
|
+
return this.getLabelValue(this.description, verbosity);
|
|
279
|
+
}
|
|
280
|
+
isDirty() {
|
|
281
|
+
return this.dirty;
|
|
282
|
+
}
|
|
283
|
+
setDirty(dirty) {
|
|
284
|
+
this.dirty = dirty;
|
|
285
|
+
this._onDidChangeDirty.fire();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
CustomEditorInput.ID = `workbench.editors.${options.id}Input`;
|
|
289
|
+
const disposable = ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(CustomEditorPane, options.id, options.name), [new SyncDescriptor(CustomEditorInput)]);
|
|
290
|
+
return {
|
|
291
|
+
disposable,
|
|
292
|
+
CustomEditorInput
|
|
293
|
+
};
|
|
187
294
|
}
|
|
188
295
|
function registerCustomView(options) {
|
|
189
296
|
const iconUrl = options.icon != null ? ( URI.parse(options.icon)) : undefined;
|
|
@@ -347,4 +454,4 @@ function getServiceOverride(openEditorFallback, _webviewIframeAlternateDomains)
|
|
|
347
454
|
[( IWebviewWorkbenchService.toString())]: new SyncDescriptor(WebviewEditorService)
|
|
348
455
|
};
|
|
349
456
|
}
|
|
350
|
-
export { ActivityService, ActivitybarPart, HoverService, PanelPart, SidebarPart, StatusbarPart, getServiceOverride as default, isEditorPartVisible, registerCustomView, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|
|
457
|
+
export { ActivityService, ActivitybarPart, HoverService, PanelPart, SidebarPart, StatusbarPart, getServiceOverride as default, isEditorPartVisible, registerCustomView, registerEditorPane, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|
package/dist/services.js
CHANGED
|
@@ -22,7 +22,7 @@ export { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/ser
|
|
|
22
22
|
export { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
23
23
|
export { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
24
24
|
export { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
|
|
25
|
-
|
|
25
|
+
import './override/vs/platform/dialogs/common/dialogs.js';
|
|
26
26
|
export { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
27
27
|
export { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
28
28
|
export { IMarkerService } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
|
|
@@ -65,6 +65,7 @@ export { IActivityService } from './vscode/vs/workbench/services/activity/common
|
|
|
65
65
|
export { IHoverService } from './vscode/vs/workbench/services/hover/browser/hover.js';
|
|
66
66
|
export { IExplorerService } from './vscode/vs/workbench/contrib/files/browser/files.js';
|
|
67
67
|
export { IStatusbarService } from './vscode/vs/workbench/services/statusbar/browser/statusbar.js';
|
|
68
|
+
export { IDialogService } from './vscode/vs/platform/dialogs/common/dialogs.js';
|
|
68
69
|
const serviceInitializeParticipants = [];
|
|
69
70
|
function registerServiceInitializeParticipant(participant) {
|
|
70
71
|
serviceInitializeParticipants.push(participant);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var audioAssets = {
|
|
2
|
-
'vs/platform/audioCues/browser/media/break.mp3': '../../../../../../assets/break.mp3',
|
|
3
|
-
'vs/platform/audioCues/browser/media/chatRequestSent.mp3': '../../../../../../assets/chatRequestSent.mp3',
|
|
4
|
-
'vs/platform/audioCues/browser/media/chatResponsePending.mp3': '../../../../../../assets/chatResponsePending.mp3',
|
|
5
|
-
'vs/platform/audioCues/browser/media/chatResponseReceived1.mp3': '../../../../../../assets/chatResponseReceived1.mp3',
|
|
6
|
-
'vs/platform/audioCues/browser/media/chatResponseReceived2.mp3': '../../../../../../assets/chatResponseReceived2.mp3',
|
|
7
|
-
'vs/platform/audioCues/browser/media/chatResponseReceived3.mp3': '../../../../../../assets/chatResponseReceived3.mp3',
|
|
8
|
-
'vs/platform/audioCues/browser/media/chatResponseReceived4.mp3': '../../../../../../assets/chatResponseReceived4.mp3',
|
|
9
|
-
'vs/platform/audioCues/browser/media/diffLineDeleted.mp3': '../../../../../../assets/diffLineDeleted.mp3',
|
|
10
|
-
'vs/platform/audioCues/browser/media/diffLineInserted.mp3': '../../../../../../assets/diffLineInserted.mp3',
|
|
11
|
-
'vs/platform/audioCues/browser/media/diffLineModified.mp3': '../../../../../../assets/diffLineModified.mp3',
|
|
12
|
-
'vs/platform/audioCues/browser/media/error.mp3': '../../../../../../assets/error.mp3',
|
|
13
|
-
'vs/platform/audioCues/browser/media/foldedAreas.mp3': '../../../../../../assets/foldedAreas.mp3',
|
|
14
|
-
'vs/platform/audioCues/browser/media/quickFixes.mp3': '../../../../../../assets/quickFixes.mp3',
|
|
15
|
-
'vs/platform/audioCues/browser/media/taskCompleted.mp3': '../../../../../../assets/taskCompleted.mp3',
|
|
16
|
-
'vs/platform/audioCues/browser/media/taskFailed.mp3': '../../../../../../assets/taskFailed.mp3',
|
|
17
|
-
'vs/platform/audioCues/browser/media/terminalBell.mp3': '../../../../../../assets/terminalBell.mp3',
|
|
18
|
-
'vs/platform/audioCues/browser/media/warning.mp3': '../../../../../../assets/warning.mp3'
|
|
2
|
+
'vs/platform/audioCues/browser/media/break.mp3': new URL('../../../../../../assets/break.mp3', import.meta.url).href,
|
|
3
|
+
'vs/platform/audioCues/browser/media/chatRequestSent.mp3': new URL('../../../../../../assets/chatRequestSent.mp3', import.meta.url).href,
|
|
4
|
+
'vs/platform/audioCues/browser/media/chatResponsePending.mp3': new URL('../../../../../../assets/chatResponsePending.mp3', import.meta.url).href,
|
|
5
|
+
'vs/platform/audioCues/browser/media/chatResponseReceived1.mp3': new URL('../../../../../../assets/chatResponseReceived1.mp3', import.meta.url).href,
|
|
6
|
+
'vs/platform/audioCues/browser/media/chatResponseReceived2.mp3': new URL('../../../../../../assets/chatResponseReceived2.mp3', import.meta.url).href,
|
|
7
|
+
'vs/platform/audioCues/browser/media/chatResponseReceived3.mp3': new URL('../../../../../../assets/chatResponseReceived3.mp3', import.meta.url).href,
|
|
8
|
+
'vs/platform/audioCues/browser/media/chatResponseReceived4.mp3': new URL('../../../../../../assets/chatResponseReceived4.mp3', import.meta.url).href,
|
|
9
|
+
'vs/platform/audioCues/browser/media/diffLineDeleted.mp3': new URL('../../../../../../assets/diffLineDeleted.mp3', import.meta.url).href,
|
|
10
|
+
'vs/platform/audioCues/browser/media/diffLineInserted.mp3': new URL('../../../../../../assets/diffLineInserted.mp3', import.meta.url).href,
|
|
11
|
+
'vs/platform/audioCues/browser/media/diffLineModified.mp3': new URL('../../../../../../assets/diffLineModified.mp3', import.meta.url).href,
|
|
12
|
+
'vs/platform/audioCues/browser/media/error.mp3': new URL('../../../../../../assets/error.mp3', import.meta.url).href,
|
|
13
|
+
'vs/platform/audioCues/browser/media/foldedAreas.mp3': new URL('../../../../../../assets/foldedAreas.mp3', import.meta.url).href,
|
|
14
|
+
'vs/platform/audioCues/browser/media/quickFixes.mp3': new URL('../../../../../../assets/quickFixes.mp3', import.meta.url).href,
|
|
15
|
+
'vs/platform/audioCues/browser/media/taskCompleted.mp3': new URL('../../../../../../assets/taskCompleted.mp3', import.meta.url).href,
|
|
16
|
+
'vs/platform/audioCues/browser/media/taskFailed.mp3': new URL('../../../../../../assets/taskFailed.mp3', import.meta.url).href,
|
|
17
|
+
'vs/platform/audioCues/browser/media/terminalBell.mp3': new URL('../../../../../../assets/terminalBell.mp3', import.meta.url).href,
|
|
18
|
+
'vs/platform/audioCues/browser/media/warning.mp3': new URL('../../../../../../assets/warning.mp3', import.meta.url).href
|
|
19
19
|
};
|
|
20
20
|
export { audioAssets as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
2
|
+
const ID = 'diagnosticsService';
|
|
3
|
+
const IDiagnosticsService = ( createDecorator(ID));
|
|
4
|
+
class NullDiagnosticsService {
|
|
5
|
+
async getPerformanceInfo(mainProcessInfo, remoteInfo) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
async getSystemInfo(mainProcessInfo, remoteInfo) {
|
|
9
|
+
return {
|
|
10
|
+
processArgs: 'nullProcessArgs',
|
|
11
|
+
gpuStatus: 'nullGpuStatus',
|
|
12
|
+
screenReader: 'nullScreenReader',
|
|
13
|
+
remoteData: [],
|
|
14
|
+
os: 'nullOs',
|
|
15
|
+
memory: 'nullMemory',
|
|
16
|
+
vmHint: 'nullVmHint',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async getDiagnostics(mainProcessInfo, remoteInfo) {
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
async getWorkspaceFileExtensions(workspace) {
|
|
23
|
+
return { extensions: [] };
|
|
24
|
+
}
|
|
25
|
+
async reportWorkspaceStats(workspace) { }
|
|
26
|
+
}
|
|
27
|
+
export { ID, IDiagnosticsService, NullDiagnosticsService };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { basename } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
2
|
+
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
3
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
4
|
+
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
5
|
+
const IDialogService = ( createDecorator('dialogService'));
|
|
6
|
+
var DialogKind;
|
|
7
|
+
( (function(DialogKind) {
|
|
8
|
+
DialogKind[DialogKind["Confirmation"] = 1] = "Confirmation";
|
|
9
|
+
DialogKind[DialogKind["Prompt"] = 2] = "Prompt";
|
|
10
|
+
DialogKind[DialogKind["Input"] = 3] = "Input";
|
|
11
|
+
})(DialogKind || (DialogKind = {})));
|
|
12
|
+
class AbstractDialogHandler {
|
|
13
|
+
getConfirmationButtons(dialog) {
|
|
14
|
+
return this.getButtons(dialog, DialogKind.Confirmation);
|
|
15
|
+
}
|
|
16
|
+
getPromptButtons(dialog) {
|
|
17
|
+
return this.getButtons(dialog, DialogKind.Prompt);
|
|
18
|
+
}
|
|
19
|
+
getInputButtons(dialog) {
|
|
20
|
+
return this.getButtons(dialog, DialogKind.Input);
|
|
21
|
+
}
|
|
22
|
+
getButtons(dialog, kind) {
|
|
23
|
+
const buttons = [];
|
|
24
|
+
switch (kind) {
|
|
25
|
+
case DialogKind.Confirmation: {
|
|
26
|
+
const confirmationDialog = dialog;
|
|
27
|
+
if (confirmationDialog.primaryButton) {
|
|
28
|
+
buttons.push(confirmationDialog.primaryButton);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
buttons.push(( localize({ key: 'yesButton', comment: ['&& denotes a mnemonic'] }, "&&Yes")));
|
|
32
|
+
}
|
|
33
|
+
if (confirmationDialog.cancelButton) {
|
|
34
|
+
buttons.push(confirmationDialog.cancelButton);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
buttons.push(( localize('cancelButton', "Cancel")));
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case DialogKind.Prompt: {
|
|
42
|
+
const promptDialog = dialog;
|
|
43
|
+
if (Array.isArray(promptDialog.buttons) && promptDialog.buttons.length > 0) {
|
|
44
|
+
buttons.push(...( promptDialog.buttons.map(button => button.label)));
|
|
45
|
+
}
|
|
46
|
+
if (promptDialog.cancelButton) {
|
|
47
|
+
if (promptDialog.cancelButton === true) {
|
|
48
|
+
buttons.push(( localize('cancelButton', "Cancel")));
|
|
49
|
+
}
|
|
50
|
+
else if (typeof promptDialog.cancelButton === 'string') {
|
|
51
|
+
buttons.push(promptDialog.cancelButton);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (promptDialog.cancelButton.label) {
|
|
55
|
+
buttons.push(promptDialog.cancelButton.label);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
buttons.push(( localize('cancelButton', "Cancel")));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (buttons.length === 0) {
|
|
63
|
+
buttons.push(( localize({ key: 'okButton', comment: ['&& denotes a mnemonic'] }, "&&OK")));
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case DialogKind.Input: {
|
|
68
|
+
const inputDialog = dialog;
|
|
69
|
+
if (inputDialog.primaryButton) {
|
|
70
|
+
buttons.push(inputDialog.primaryButton);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
buttons.push(( localize({ key: 'okButton', comment: ['&& denotes a mnemonic'] }, "&&OK")));
|
|
74
|
+
}
|
|
75
|
+
if (inputDialog.cancelButton) {
|
|
76
|
+
buttons.push(inputDialog.cancelButton);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
buttons.push(( localize('cancelButton', "Cancel")));
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return buttons;
|
|
85
|
+
}
|
|
86
|
+
getDialogType(type) {
|
|
87
|
+
if (typeof type === 'string') {
|
|
88
|
+
return type;
|
|
89
|
+
}
|
|
90
|
+
if (typeof type === 'number') {
|
|
91
|
+
return (type === Severity.Info) ? 'info' : (type === Severity.Error) ? 'error' : (type === Severity.Warning) ? 'warning' : 'none';
|
|
92
|
+
}
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
async getPromptResult(prompt, buttonIndex, checkboxChecked) {
|
|
96
|
+
const promptButtons = [...(prompt.buttons ?? [])];
|
|
97
|
+
if (prompt.cancelButton && typeof prompt.cancelButton !== 'string' && typeof prompt.cancelButton !== 'boolean') {
|
|
98
|
+
promptButtons.push(prompt.cancelButton);
|
|
99
|
+
}
|
|
100
|
+
const result = await promptButtons[buttonIndex]?.run({ checkboxChecked });
|
|
101
|
+
return { result, checkboxChecked };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const IFileDialogService = ( createDecorator('fileDialogService'));
|
|
105
|
+
const MAX_CONFIRM_FILES = 10;
|
|
106
|
+
function getFileNamesMessage(fileNamesOrResources) {
|
|
107
|
+
const message = [];
|
|
108
|
+
message.push(...( fileNamesOrResources.slice(0, MAX_CONFIRM_FILES).map(
|
|
109
|
+
fileNameOrResource => typeof fileNameOrResource === 'string' ? fileNameOrResource : basename(fileNameOrResource)
|
|
110
|
+
)));
|
|
111
|
+
if (fileNamesOrResources.length > MAX_CONFIRM_FILES) {
|
|
112
|
+
if (fileNamesOrResources.length - MAX_CONFIRM_FILES === 1) {
|
|
113
|
+
message.push(( localize('moreFile', "...1 additional file not shown")));
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
message.push(( localize(
|
|
117
|
+
'moreFiles',
|
|
118
|
+
"...{0} additional files not shown",
|
|
119
|
+
fileNamesOrResources.length - MAX_CONFIRM_FILES
|
|
120
|
+
)));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
message.push('');
|
|
124
|
+
return message.join('\n');
|
|
125
|
+
}
|
|
126
|
+
export { AbstractDialogHandler, IDialogService, IFileDialogService, getFileNamesMessage };
|
|
@@ -5,7 +5,7 @@ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCu
|
|
|
5
5
|
import { getAuthenticationProviderActivationEvent, addAccountUsage, readAllowedExtensions, readAccountUsages, removeAccountUsage } from '../../services/authentication/browser/authenticationService.js';
|
|
6
6
|
import { IAuthenticationService } from '../../services/authentication/common/authentication.js';
|
|
7
7
|
import { ExtHostContext, MainContext } from '../common/extHost.protocol.js';
|
|
8
|
-
import
|
|
8
|
+
import '../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
9
9
|
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
10
10
|
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
11
11
|
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
@@ -13,6 +13,7 @@ import { INotificationService } from 'monaco-editor/esm/vs/platform/notification
|
|
|
13
13
|
import { fromNow } from '../../../base/common/date.js';
|
|
14
14
|
import { IExtensionService } from '../../services/extensions/common/extensions.js';
|
|
15
15
|
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
16
|
+
import { IDialogService } from '../../../platform/dialogs/common/dialogs.js';
|
|
16
17
|
class MainThreadAuthenticationProvider extends Disposable {
|
|
17
18
|
constructor(_proxy, id, label, supportsMultipleAccounts, notificationService, storageService, quickInputService, dialogService) {
|
|
18
19
|
super();
|