@codingame/monaco-vscode-api 1.69.24 → 1.76.0-next.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/README.md +1 -3
- package/dist/_.contribution.js +3 -3
- package/dist/api.js +63 -31
- package/dist/async.js +9 -9
- package/dist/configuration.d.ts +109 -21
- package/dist/configuration.js +47 -217
- package/dist/{workspace.js → contextkey.js} +26 -47
- package/dist/dialogs.js +498 -426
- package/dist/extHost.js +1884 -909
- package/dist/files.js +65 -63
- package/dist/keybindings.d.ts +24 -18
- package/dist/keybindings.js +475 -404
- package/dist/languageConfiguration.js +5 -5
- package/dist/languageService.js +11 -3
- package/dist/languages.d.ts +24 -7
- package/dist/languages.js +1 -1
- package/dist/layout.js +104 -166
- package/dist/missing-services.js +230 -77
- package/dist/modelEditor.d.ts +1 -5
- package/dist/modelEditor.js +32 -58
- package/dist/monaco.d.ts +303 -713
- package/dist/monaco.js +2 -2
- package/dist/notifications.js +95 -235
- package/dist/polyfill.js +2022 -1637
- package/dist/services.d.ts +8908 -8467
- package/dist/services.js +1 -1
- package/dist/services2.js +293 -113
- package/dist/snippets.d.ts +24 -7
- package/dist/snippets.js +11 -9
- package/dist/textmate.d.ts +114 -20
- package/dist/textmate.js +825 -453
- package/dist/theme.js +13 -14
- package/dist/tokenClassification.d.ts +24 -7
- package/dist/tokenClassification.js +1 -1
- package/dist/tokenClassificationRegistry.js +1 -1
- package/dist/tools.js +104 -28
- package/package.json +12 -19
- package/dist/messages.d.ts +0 -10
- package/dist/messages.js +0 -11
- package/dist/types.js +0 -46
package/dist/theme.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { E as Emitter, _ as __decorate, a as __param } from './
|
|
1
|
+
import { p as parse$1, g as getNodeType } from './polyfill.js';
|
|
2
|
+
import { c as IExtensionService, h as IBrowserWorkbenchEnvironmentService, j as IHostColorSchemeService, k as IUserDataInitializationService } from './missing-services.js';
|
|
3
|
+
import { E as Emitter, _ as __decorate, a as __param } from './contextkey.js';
|
|
4
4
|
import { T as ThemeSettings, E as ExtensionData, V as VS_DARK_THEME, a as VS_LIGHT_THEME, b as VS_HC_THEME, c as VS_HC_LIGHT_THEME, d as THEME_SCOPE_OPEN_PAREN, e as THEME_SCOPE_CLOSE_PAREN, f as THEME_SCOPE_WILDCARD, t as themeScopeRegex } from './workbenchThemeService.js';
|
|
5
5
|
import { editorBackground, editorForeground, editorSelectionBackground, editorInactiveSelection, editorSelectionHighlight, editorFindMatchHighlight, editorFindMatch, editorHoverHighlight, editorFindRangeHighlight, workbenchColorsSchemaId, asCssVariableName, Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
6
6
|
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
7
7
|
import { editorLineHighlight, editorRangeHighlight, editorCursorForeground, editorWhitespaces, editorIndentGuides, editorActiveIndentGuides } from 'monaco-editor/esm/vs/editor/common/core/editorColorRegistry.js';
|
|
8
8
|
import { g as getParseErrorMessage } from './jsonErrorMessages.js';
|
|
9
9
|
import { t as tokenStylingSchemaId, T as TokenStyle, p as parseClassifierString, S as SemanticTokenRule, g as getTokenClassificationRegistry } from './tokenClassificationRegistry.js';
|
|
10
|
-
import { isUndefined, isString, isObject,
|
|
10
|
+
import { isUndefined, isString, isObject, isBoolean } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
11
11
|
import { ColorScheme } from 'monaco-editor/esm/vs/platform/theme/common/theme.js';
|
|
12
|
-
import { IThemeService, getThemeTypeSelector,
|
|
12
|
+
import { IThemeService, getThemeTypeSelector, Extensions as Extensions$3 } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
13
13
|
import { basename } from 'monaco-editor/esm/vs/base/common/path.js';
|
|
14
14
|
import { joinPath, isEqual, extname, dirname, isEqualOrParent } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
15
15
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
@@ -17,11 +17,13 @@ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform
|
|
|
17
17
|
import { getIconRegistry, iconsSchemaId, IconFontDefinition } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
18
18
|
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
19
19
|
import { createStyleSheet, asCSSUrl } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
20
|
-
import {
|
|
20
|
+
import { bj as DEFAULT_EXTENSION, br as getRemoteAuthority } from './extHost.js';
|
|
21
21
|
import { I as IWorkbenchLayoutService } from './layoutService.js';
|
|
22
|
+
import { r as registerExtensionFile, g as getServiceOverride$1, I as IExtensionResourceLoaderService } from './files.js';
|
|
22
23
|
import { E as ExtensionsRegistry, a as ExtensionMessageCollector, c as consoleExtensionMessageHandler } from './tools.js';
|
|
23
24
|
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
24
25
|
import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
26
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
25
27
|
import { S as Sequencer } from './async.js';
|
|
26
28
|
import { S as Services, c as IFileService } from './services2.js';
|
|
27
29
|
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
@@ -33,7 +35,6 @@ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
|
33
35
|
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
34
36
|
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
35
37
|
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
36
|
-
import { be as DEFAULT_EXTENSION } from './extHost.js';
|
|
37
38
|
import { ExtensionIdentifier } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
|
|
38
39
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
39
40
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
@@ -993,7 +994,7 @@ class ColorThemeData {
|
|
|
993
994
|
let themeSpecificColors;
|
|
994
995
|
for (const key in colors) {
|
|
995
996
|
const scopedColors = colors[key];
|
|
996
|
-
if (this.isThemeScope(key) && scopedColors instanceof Object && !isArray(scopedColors)) {
|
|
997
|
+
if (this.isThemeScope(key) && scopedColors instanceof Object && !Array.isArray(scopedColors)) {
|
|
997
998
|
const themeScopeList = key.match(themeScopeRegex) || [];
|
|
998
999
|
for (const themeScope of themeScopeList) {
|
|
999
1000
|
const themeId = themeScope.substring(1, themeScope.length - 1);
|
|
@@ -1005,7 +1006,7 @@ class ColorThemeData {
|
|
|
1005
1006
|
for (const subkey in scopedThemeSpecificColors) {
|
|
1006
1007
|
const originalColors = themeSpecificColors[subkey];
|
|
1007
1008
|
const overrideColors = scopedThemeSpecificColors[subkey];
|
|
1008
|
-
if (isArray(originalColors) && isArray(overrideColors)) {
|
|
1009
|
+
if (Array.isArray(originalColors) && Array.isArray(overrideColors)) {
|
|
1009
1010
|
themeSpecificColors[subkey] = originalColors.concat(overrideColors);
|
|
1010
1011
|
}
|
|
1011
1012
|
else if (overrideColors) {
|
|
@@ -2875,7 +2876,7 @@ const detectHCSchemeSettingSchema = {
|
|
|
2875
2876
|
default: true,
|
|
2876
2877
|
markdownDescription: ( (localize(
|
|
2877
2878
|
'autoDetectHighContrast',
|
|
2878
|
-
"If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by `#{0}#` and `#{1}
|
|
2879
|
+
"If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by `#{0}#` and `#{1}#`.",
|
|
2879
2880
|
ThemeSettings.PREFERRED_HC_DARK_THEME,
|
|
2880
2881
|
ThemeSettings.PREFERRED_HC_LIGHT_THEME
|
|
2881
2882
|
))),
|
|
@@ -3007,6 +3008,7 @@ const tokenColorCustomizationConfiguration = {
|
|
|
3007
3008
|
};
|
|
3008
3009
|
configurationRegistry.registerConfiguration(tokenColorCustomizationConfiguration);
|
|
3009
3010
|
function updateColorThemeConfigurationSchemas(themes) {
|
|
3011
|
+
themes.sort((a, b) => a.label.localeCompare(b.label));
|
|
3010
3012
|
colorThemeSettingEnum.splice(0, colorThemeSettingEnum.length, ...themes.map(t => t.settingsId));
|
|
3011
3013
|
colorThemeSettingEnumDescriptions.splice(0, colorThemeSettingEnumDescriptions.length, ...themes.map(t => t.description || ''));
|
|
3012
3014
|
colorThemeSettingEnumItemLabels.splice(0, colorThemeSettingEnumItemLabels.length, ...themes.map(t => t.label || ''));
|
|
@@ -3432,11 +3434,8 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
3432
3434
|
this.telemetryService = telemetryService;
|
|
3433
3435
|
this.environmentService = environmentService;
|
|
3434
3436
|
this.extensionResourceLoaderService = extensionResourceLoaderService;
|
|
3435
|
-
this.layoutService = layoutService;
|
|
3436
3437
|
this.logService = logService;
|
|
3437
3438
|
this.hostColorService = hostColorService;
|
|
3438
|
-
this.userDataInitializationService = userDataInitializationService;
|
|
3439
|
-
this.languageService = languageService;
|
|
3440
3439
|
this.themeExtensionsActivated = ( (new Map()));
|
|
3441
3440
|
this.container = layoutService.container;
|
|
3442
3441
|
this.settings = ( (new ThemeConfiguration(configurationService)));
|
|
@@ -4127,7 +4126,7 @@ const DEFAULT_THEME_EXTENSION = {
|
|
|
4127
4126
|
publisher: 'vscode',
|
|
4128
4127
|
version: '1.0.0',
|
|
4129
4128
|
engines: {
|
|
4130
|
-
vscode: "1.
|
|
4129
|
+
vscode: "1.76.0"
|
|
4131
4130
|
},
|
|
4132
4131
|
targetPlatform: "web"
|
|
4133
4132
|
};
|
|
@@ -150,17 +150,28 @@ interface UriComponents {
|
|
|
150
150
|
fragment: string;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
interface ILocalizedString {
|
|
154
|
+
/**
|
|
155
|
+
* The localized value of the string.
|
|
156
|
+
*/
|
|
157
|
+
value: string;
|
|
158
|
+
/**
|
|
159
|
+
* The original (non localized value of the string)
|
|
160
|
+
*/
|
|
161
|
+
original: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
153
164
|
/**
|
|
154
165
|
* Type of extension.
|
|
155
166
|
*
|
|
156
167
|
* **NOTE**: This is defined in `platform/environment` because it can appear as a CLI argument.
|
|
157
168
|
*/
|
|
158
|
-
|
|
169
|
+
type ExtensionKind = 'ui' | 'workspace' | 'web';
|
|
159
170
|
|
|
160
171
|
interface ICommand {
|
|
161
172
|
command: string;
|
|
162
|
-
title: string;
|
|
163
|
-
category?: string;
|
|
173
|
+
title: string | ILocalizedString;
|
|
174
|
+
category?: string | ILocalizedString;
|
|
164
175
|
}
|
|
165
176
|
interface IConfigurationProperty {
|
|
166
177
|
description: string;
|
|
@@ -282,6 +293,7 @@ interface IWalkthroughStep {
|
|
|
282
293
|
interface IWalkthrough {
|
|
283
294
|
readonly id: string;
|
|
284
295
|
readonly title: string;
|
|
296
|
+
readonly icon?: string;
|
|
285
297
|
readonly description: string;
|
|
286
298
|
readonly steps: IWalkthroughStep[];
|
|
287
299
|
readonly featuredFor: string[] | undefined;
|
|
@@ -351,8 +363,8 @@ interface IExtensionCapabilities {
|
|
|
351
363
|
readonly virtualWorkspaces?: ExtensionVirtualWorkspaceSupport;
|
|
352
364
|
readonly untrustedWorkspaces?: ExtensionUntrustedWorkspaceSupport;
|
|
353
365
|
}
|
|
354
|
-
|
|
355
|
-
|
|
366
|
+
type LimitedWorkspaceSupportType = 'limited';
|
|
367
|
+
type ExtensionUntrustedWorkspaceSupport = {
|
|
356
368
|
supported: true;
|
|
357
369
|
} | {
|
|
358
370
|
supported: false;
|
|
@@ -362,7 +374,7 @@ declare type ExtensionUntrustedWorkspaceSupport = {
|
|
|
362
374
|
description: string;
|
|
363
375
|
restrictedConfigurations?: string[];
|
|
364
376
|
};
|
|
365
|
-
|
|
377
|
+
type ExtensionVirtualWorkspaceSupport = boolean | {
|
|
366
378
|
supported: true;
|
|
367
379
|
} | {
|
|
368
380
|
supported: false | LimitedWorkspaceSupportType;
|
|
@@ -379,6 +391,8 @@ interface IRelaxedExtensionManifest {
|
|
|
379
391
|
description?: string;
|
|
380
392
|
main?: string;
|
|
381
393
|
browser?: string;
|
|
394
|
+
preview?: boolean;
|
|
395
|
+
l10n?: string;
|
|
382
396
|
icon?: string;
|
|
383
397
|
categories?: string[];
|
|
384
398
|
keywords?: string[];
|
|
@@ -451,8 +465,11 @@ interface IRelaxedExtensionDescription extends IRelaxedExtensionManifest {
|
|
|
451
465
|
isUserBuiltin: boolean;
|
|
452
466
|
isUnderDevelopment: boolean;
|
|
453
467
|
extensionLocation: URI;
|
|
468
|
+
browserNlsBundleUris?: {
|
|
469
|
+
[language: string]: URI;
|
|
470
|
+
};
|
|
454
471
|
}
|
|
455
|
-
|
|
472
|
+
type IExtensionDescription = Readonly<IRelaxedExtensionDescription>;
|
|
456
473
|
|
|
457
474
|
type IEditorOverrideServices = monaco.editor.IEditorOverrideServices
|
|
458
475
|
|
|
@@ -4,7 +4,7 @@ import { g as getExtensionPoint, a as ExtensionMessageCollector, c as consoleExt
|
|
|
4
4
|
import { g as getTokenClassificationRegistry, a as typeAndModifierIdPattern } from './tokenClassificationRegistry.js';
|
|
5
5
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
6
6
|
import { S as Services } from './services2.js';
|
|
7
|
-
import {
|
|
7
|
+
import { bj as DEFAULT_EXTENSION } from './extHost.js';
|
|
8
8
|
const tokenClassificationRegistry = getTokenClassificationRegistry();
|
|
9
9
|
const tokenTypeExtPoint$1 = ( ExtensionsRegistry.registerExtensionPoint({
|
|
10
10
|
extensionPoint: 'semanticTokenTypes',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Emitter } from './
|
|
1
|
+
import { E as Emitter } from './contextkey.js';
|
|
2
2
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
3
3
|
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
4
4
|
import { Extensions } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
package/dist/tools.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as productSchemaId } from './services2.js';
|
|
2
|
+
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
2
3
|
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
3
4
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
4
5
|
import { Extensions } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
5
6
|
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
6
|
-
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
7
7
|
import { ExtensionIdentifier } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
|
|
8
|
-
import { E as Emitter } from './
|
|
8
|
+
import { E as Emitter } from './contextkey.js';
|
|
9
9
|
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
10
10
|
const EXTENSION_CATEGORIES = [
|
|
11
11
|
'Azure',
|
|
@@ -30,23 +30,28 @@ const EXTENSION_CATEGORIES = [
|
|
|
30
30
|
const EXTENSION_IDENTIFIER_PATTERN = '^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$';
|
|
31
31
|
const allApiProposals = ( Object.freeze({
|
|
32
32
|
authSession: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts',
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
codiconDecoration: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts',
|
|
34
|
+
contribCommentEditorActionsMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts',
|
|
35
|
+
contribCommentPeekContext: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts',
|
|
36
|
+
contribCommentThreadAdditionalMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts',
|
|
35
37
|
contribEditSessions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts',
|
|
38
|
+
contribEditorContentMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts',
|
|
36
39
|
contribLabelFormatterWorkspaceTooltip: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts',
|
|
37
40
|
contribMenuBarHome: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts',
|
|
38
|
-
|
|
41
|
+
contribMergeEditorMenus: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts',
|
|
42
|
+
contribNotebookStaticPreloads: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts',
|
|
39
43
|
contribRemoteHelp: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts',
|
|
40
44
|
contribShareMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts',
|
|
41
|
-
contribViewSize: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewSize.d.ts',
|
|
42
45
|
contribViewsRemote: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts',
|
|
43
46
|
contribViewsWelcome: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts',
|
|
44
|
-
contribWebviewContext: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribWebviewContext.d.ts',
|
|
45
47
|
customEditorMove: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts',
|
|
46
48
|
diffCommand: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts',
|
|
49
|
+
diffContentOptions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts',
|
|
47
50
|
documentFiltersExclusive: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts',
|
|
48
51
|
documentPaste: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts',
|
|
52
|
+
editSessionIdentityProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts',
|
|
49
53
|
editorInsets: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts',
|
|
54
|
+
envShellEvent: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envShellEvent.d.ts',
|
|
50
55
|
extensionRuntime: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts',
|
|
51
56
|
extensionsAny: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts',
|
|
52
57
|
externalUriOpener: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts',
|
|
@@ -54,43 +59,79 @@ const allApiProposals = ( Object.freeze({
|
|
|
54
59
|
findTextInFiles: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts',
|
|
55
60
|
fsChunks: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts',
|
|
56
61
|
idToken: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts',
|
|
62
|
+
indentSize: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.indentSize.d.ts',
|
|
57
63
|
inlineCompletionsAdditions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts',
|
|
58
|
-
inlineCompletionsNew: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsNew.d.ts',
|
|
59
64
|
interactiveWindow: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts',
|
|
60
65
|
ipc: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts',
|
|
61
66
|
notebookCellExecutionState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts',
|
|
62
|
-
|
|
67
|
+
notebookControllerAffinityHidden: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts',
|
|
63
68
|
notebookControllerKind: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerKind.d.ts',
|
|
64
|
-
notebookDebugOptions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDebugOptions.d.ts',
|
|
65
69
|
notebookDeprecated: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts',
|
|
66
|
-
notebookEditor: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookEditor.d.ts',
|
|
67
|
-
notebookEditorEdit: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookEditorEdit.d.ts',
|
|
68
70
|
notebookKernelSource: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts',
|
|
69
71
|
notebookLiveShare: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts',
|
|
70
72
|
notebookMessaging: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts',
|
|
71
73
|
notebookMime: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts',
|
|
72
|
-
notebookWorkspaceEdit: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookWorkspaceEdit.d.ts',
|
|
73
74
|
portsAttributes: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts',
|
|
75
|
+
profileContentHandlers: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts',
|
|
76
|
+
quickDiffProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts',
|
|
77
|
+
quickPickItemTooltip: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts',
|
|
74
78
|
quickPickSortByLabel: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts',
|
|
75
79
|
resolvers: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts',
|
|
76
80
|
scmActionButton: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts',
|
|
77
81
|
scmSelectedProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts',
|
|
78
82
|
scmValidation: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts',
|
|
79
|
-
|
|
83
|
+
showLocal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts',
|
|
80
84
|
tabInputTextMerge: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts',
|
|
81
85
|
taskPresentationGroup: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts',
|
|
82
86
|
telemetry: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts',
|
|
83
87
|
terminalDataWriteEvent: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts',
|
|
84
88
|
terminalDimensions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts',
|
|
85
|
-
|
|
89
|
+
terminalQuickFixProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts',
|
|
90
|
+
testContinuousRun: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testContinuousRun.d.ts',
|
|
86
91
|
testCoverage: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testCoverage.d.ts',
|
|
87
92
|
testObserver: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts',
|
|
88
93
|
textSearchProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts',
|
|
89
94
|
timeline: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts',
|
|
90
95
|
tokenInformation: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts',
|
|
96
|
+
treeItemCheckbox: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeItemCheckbox.d.ts',
|
|
91
97
|
treeViewReveal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts',
|
|
98
|
+
tunnels: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts',
|
|
92
99
|
workspaceTrust: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts'
|
|
93
100
|
}));
|
|
101
|
+
class ImplicitActivationEventsImpl {
|
|
102
|
+
constructor() {
|
|
103
|
+
this._generators = ( new Map());
|
|
104
|
+
}
|
|
105
|
+
register(extensionPointName, generator) {
|
|
106
|
+
this._generators.set(extensionPointName, generator);
|
|
107
|
+
}
|
|
108
|
+
updateManifest(manifest) {
|
|
109
|
+
if (typeof manifest.main === 'undefined' && typeof manifest.browser === 'undefined') {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (manifest.activationEvents === undefined) {
|
|
113
|
+
Object.assign(manifest, { activationEvents: [] });
|
|
114
|
+
}
|
|
115
|
+
if (!Array.isArray(manifest.activationEvents) || !manifest.contributes) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
for (const extPointName in manifest.contributes) {
|
|
119
|
+
const generator = this._generators.get(extPointName);
|
|
120
|
+
if (!generator) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const contrib = manifest.contributes[extPointName];
|
|
124
|
+
const contribArr = Array.isArray(contrib) ? contrib : [contrib];
|
|
125
|
+
try {
|
|
126
|
+
generator(contribArr, manifest.activationEvents);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
onUnexpectedError(err);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const ImplicitActivationEvents = ( new ImplicitActivationEventsImpl());
|
|
94
135
|
const schemaRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
95
136
|
class ExtensionMessageCollector {
|
|
96
137
|
constructor(messageHandler, extension, extensionPointId) {
|
|
@@ -117,10 +158,6 @@ class ExtensionMessageCollector {
|
|
|
117
158
|
}
|
|
118
159
|
}
|
|
119
160
|
class ExtensionPointUserDelta {
|
|
120
|
-
constructor(added, removed) {
|
|
121
|
-
this.added = added;
|
|
122
|
-
this.removed = removed;
|
|
123
|
-
}
|
|
124
161
|
static _toSet(arr) {
|
|
125
162
|
const result = ( new Set());
|
|
126
163
|
for (let i = 0, len = arr.length; i < len; i++) {
|
|
@@ -141,6 +178,10 @@ class ExtensionPointUserDelta {
|
|
|
141
178
|
const removed = previous.filter(user => !currentSet.has(ExtensionIdentifier.toKey(user.description.identifier)));
|
|
142
179
|
return ( new ExtensionPointUserDelta(added, removed));
|
|
143
180
|
}
|
|
181
|
+
constructor(added, removed) {
|
|
182
|
+
this.added = added;
|
|
183
|
+
this.removed = removed;
|
|
184
|
+
}
|
|
144
185
|
}
|
|
145
186
|
class ExtensionPoint {
|
|
146
187
|
constructor(name, defaultExtensionKind) {
|
|
@@ -302,6 +343,20 @@ const schema = {
|
|
|
302
343
|
markdownEnumDescriptions: ( Object.values(allApiProposals))
|
|
303
344
|
}
|
|
304
345
|
},
|
|
346
|
+
api: {
|
|
347
|
+
markdownDescription: ( localize(
|
|
348
|
+
'vscode.extension.api',
|
|
349
|
+
'Describe the API provided by this extension. For more details visit: https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions'
|
|
350
|
+
)),
|
|
351
|
+
type: 'string',
|
|
352
|
+
enum: ['none'],
|
|
353
|
+
enumDescriptions: [
|
|
354
|
+
( localize(
|
|
355
|
+
'vscode.extension.api.none',
|
|
356
|
+
"Give up entirely the ability to export any APIs. This allows other extensions that depend on this extension to run in a separate extension host process or in a remote machine."
|
|
357
|
+
))
|
|
358
|
+
]
|
|
359
|
+
},
|
|
305
360
|
activationEvents: {
|
|
306
361
|
description: ( localize(
|
|
307
362
|
'vscode.extension.activationEvents',
|
|
@@ -407,6 +462,14 @@ const schema = {
|
|
|
407
462
|
)),
|
|
408
463
|
body: 'onFileSystem:${1:scheme}'
|
|
409
464
|
},
|
|
465
|
+
{
|
|
466
|
+
label: 'onEditSession',
|
|
467
|
+
description: ( localize(
|
|
468
|
+
'vscode.extension.activationEvents.onEditSession',
|
|
469
|
+
'An activation event emitted whenever an edit session is accessed with the given scheme.'
|
|
470
|
+
)),
|
|
471
|
+
body: 'onEditSession:${1:scheme}'
|
|
472
|
+
},
|
|
410
473
|
{
|
|
411
474
|
label: 'onSearch',
|
|
412
475
|
description: ( localize(
|
|
@@ -423,14 +486,6 @@ const schema = {
|
|
|
423
486
|
'An activation event emitted whenever the specified view is expanded.'
|
|
424
487
|
)),
|
|
425
488
|
},
|
|
426
|
-
{
|
|
427
|
-
label: 'onIdentity',
|
|
428
|
-
body: 'onIdentity:${8:identity}',
|
|
429
|
-
description: ( localize(
|
|
430
|
-
'vscode.extension.activationEvents.onIdentity',
|
|
431
|
-
'An activation event emitted whenever the specified user identity.'
|
|
432
|
-
)),
|
|
433
|
-
},
|
|
434
489
|
{
|
|
435
490
|
label: 'onUri',
|
|
436
491
|
body: 'onUri',
|
|
@@ -487,6 +542,14 @@ const schema = {
|
|
|
487
542
|
'An activation event emitted when a specific terminal profile is launched.'
|
|
488
543
|
)),
|
|
489
544
|
},
|
|
545
|
+
{
|
|
546
|
+
label: 'onTerminalQuickFixRequest',
|
|
547
|
+
body: 'onTerminalQuickFixRequest:${1:quickFixId}',
|
|
548
|
+
description: ( localize(
|
|
549
|
+
'vscode.extension.activationEvents.onTerminalQuickFixRequest',
|
|
550
|
+
'An activation event emitted when a command matches the selector associated with this ID'
|
|
551
|
+
)),
|
|
552
|
+
},
|
|
490
553
|
{
|
|
491
554
|
label: 'onWalkthrough',
|
|
492
555
|
body: 'onWalkthrough:${1:walkthroughID}',
|
|
@@ -771,6 +834,16 @@ const schema = {
|
|
|
771
834
|
icon: {
|
|
772
835
|
type: 'string',
|
|
773
836
|
description: ( localize('vscode.extension.icon', 'The path to a 128x128 pixel icon.'))
|
|
837
|
+
},
|
|
838
|
+
l10n: {
|
|
839
|
+
type: 'string',
|
|
840
|
+
description: ( localize({
|
|
841
|
+
key: 'vscode.extension.l10n',
|
|
842
|
+
comment: [
|
|
843
|
+
'{Locked="bundle.l10n._locale_.json"}',
|
|
844
|
+
'{Locked="vscode.l10n API"}'
|
|
845
|
+
]
|
|
846
|
+
}, 'The relative path to a folder containing localization (bundle.l10n.*.json) files. Must be specified if you are using the vscode.l10n API.'))
|
|
774
847
|
}
|
|
775
848
|
}
|
|
776
849
|
};
|
|
@@ -784,6 +857,9 @@ class ExtensionsRegistryImpl {
|
|
|
784
857
|
}
|
|
785
858
|
const result = ( new ExtensionPoint(desc.extensionPoint, desc.defaultExtensionKind));
|
|
786
859
|
this._extensionPoints.set(desc.extensionPoint, result);
|
|
860
|
+
if (desc.activationEventsGenerator) {
|
|
861
|
+
ImplicitActivationEvents.register(desc.extensionPoint, desc.activationEventsGenerator);
|
|
862
|
+
}
|
|
787
863
|
schema.properties['contributes'].properties[desc.extensionPoint] = desc.jsonSchema;
|
|
788
864
|
schemaRegistry.registerSchema(schemaId, schema);
|
|
789
865
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.76.0-next.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor",
|
|
6
6
|
"keywords": [],
|
|
@@ -24,10 +24,6 @@
|
|
|
24
24
|
"types": "./dist/services.d.ts",
|
|
25
25
|
"default": "./dist/services.js"
|
|
26
26
|
},
|
|
27
|
-
"./service-override/messages": {
|
|
28
|
-
"types": "./dist/messages.d.ts",
|
|
29
|
-
"default": "./dist/messages.js"
|
|
30
|
-
},
|
|
31
27
|
"./service-override/notifications": {
|
|
32
28
|
"types": "./dist/notifications.d.ts",
|
|
33
29
|
"default": "./dist/notifications.js"
|
|
@@ -86,9 +82,6 @@
|
|
|
86
82
|
"services": [
|
|
87
83
|
"./dist/services.d.ts"
|
|
88
84
|
],
|
|
89
|
-
"service-override/messages": [
|
|
90
|
-
"./dist/messages.d.ts"
|
|
91
|
-
],
|
|
92
85
|
"service-override/notifications": [
|
|
93
86
|
"./dist/notifications.d.ts"
|
|
94
87
|
],
|
|
@@ -136,7 +129,7 @@
|
|
|
136
129
|
],
|
|
137
130
|
"scripts": {
|
|
138
131
|
"build": "npm run clean && npm run compile && npm run lint && npm run generate-types && npm run compile-webpack-loader",
|
|
139
|
-
"compile": "rollup --config rollup/rollup.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup.json`}' --vscode-version ${npm_package_config_vscode_version}",
|
|
132
|
+
"compile": "NODE_OPTIONS=--max_old_space_size=4096 rollup --config rollup/rollup.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup.json`}' --vscode-version ${npm_package_config_vscode_version}",
|
|
140
133
|
"clean": "rm -rf dist/",
|
|
141
134
|
"compile-webpack-loader": "tsc --target es2020 -lib es2020 --module commonjs --skipLibCheck --moduleResolution node --declaration --outDir dist src/webpack-loader.ts && mv dist/webpack-loader.js dist/webpack-loader.cjs",
|
|
142
135
|
"preprepare": "./scripts/install-vscode",
|
|
@@ -146,7 +139,7 @@
|
|
|
146
139
|
},
|
|
147
140
|
"config": {
|
|
148
141
|
"vscode": {
|
|
149
|
-
"version": "1.
|
|
142
|
+
"version": "1.76.0"
|
|
150
143
|
}
|
|
151
144
|
},
|
|
152
145
|
"devDependencies": {
|
|
@@ -164,9 +157,9 @@
|
|
|
164
157
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
165
158
|
"@types/babel__core": "^7.20.0",
|
|
166
159
|
"@types/semver": "^7.3.13",
|
|
167
|
-
"@types/vscode": "~1.
|
|
168
|
-
"@typescript-eslint/eslint-plugin": "^5.54.
|
|
169
|
-
"@typescript-eslint/parser": "^5.54.
|
|
160
|
+
"@types/vscode": "~1.76.0",
|
|
161
|
+
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
|
162
|
+
"@typescript-eslint/parser": "^5.54.1",
|
|
170
163
|
"eslint": "^8.35.0",
|
|
171
164
|
"eslint-config-standard": "^17.0.0",
|
|
172
165
|
"eslint-plugin-import": "^2.27.5",
|
|
@@ -175,24 +168,24 @@
|
|
|
175
168
|
"eslint-plugin-unused-imports": "^2.0.0",
|
|
176
169
|
"js-cleanup": "^1.2.0",
|
|
177
170
|
"recast": "^0.22.0",
|
|
178
|
-
"rollup": "^3.
|
|
171
|
+
"rollup": "^3.19.1",
|
|
179
172
|
"rollup-plugin-dts": "^5.2.0",
|
|
180
173
|
"rollup-plugin-styles": "^4.0.0",
|
|
181
174
|
"semver": "^7.3.8",
|
|
182
175
|
"ts-node": "^10.9.1",
|
|
183
176
|
"typescript": "^4.9.5",
|
|
184
|
-
"webpack": "^5.
|
|
177
|
+
"webpack": "^5.76.0",
|
|
185
178
|
"zx": "^7.2.0"
|
|
186
179
|
},
|
|
187
180
|
"dependencies": {},
|
|
188
181
|
"peerDependencies": {
|
|
189
|
-
"monaco-editor": "~0.
|
|
190
|
-
"vscode-oniguruma": "^1.
|
|
191
|
-
"vscode-textmate": "^
|
|
182
|
+
"monaco-editor": "~0.36.1",
|
|
183
|
+
"vscode-oniguruma": "^1.7.0",
|
|
184
|
+
"vscode-textmate": "^9.0.0"
|
|
192
185
|
},
|
|
193
186
|
"overrides": {
|
|
194
187
|
"rollup-plugin-styles": {
|
|
195
|
-
"rollup": "3.
|
|
188
|
+
"rollup": "3.18.0"
|
|
196
189
|
}
|
|
197
190
|
},
|
|
198
191
|
"volta": {
|
package/dist/messages.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as monaco from 'monaco-editor';
|
|
2
|
-
|
|
3
|
-
type IEditorOverrideServices = monaco.editor.IEditorOverrideServices
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated use `getNotificationServiceOverride` and `getDialogServiceOverride` instead
|
|
7
|
-
*/
|
|
8
|
-
declare function getServiceOverride(container?: HTMLElement): IEditorOverrideServices;
|
|
9
|
-
|
|
10
|
-
export { getServiceOverride as default };
|
package/dist/messages.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import './polyfill.js';
|
|
2
|
-
import './missing-services.js';
|
|
3
|
-
import getServiceOverride$1 from './notifications.js';
|
|
4
|
-
import getServiceOverride$2 from './dialogs.js';
|
|
5
|
-
function getServiceOverride(container) {
|
|
6
|
-
return {
|
|
7
|
-
...getServiceOverride$1(container),
|
|
8
|
-
...getServiceOverride$2(container)
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export { getServiceOverride as default };
|
package/dist/types.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
function isString(str) {
|
|
2
|
-
return (typeof str === 'string');
|
|
3
|
-
}
|
|
4
|
-
function isStringArray(value) {
|
|
5
|
-
return Array.isArray(value) && value.every(elem => isString(elem));
|
|
6
|
-
}
|
|
7
|
-
function isObject(obj) {
|
|
8
|
-
return typeof obj === 'object'
|
|
9
|
-
&& obj !== null
|
|
10
|
-
&& !Array.isArray(obj)
|
|
11
|
-
&& !(obj instanceof RegExp)
|
|
12
|
-
&& !(obj instanceof Date);
|
|
13
|
-
}
|
|
14
|
-
function isUndefined(obj) {
|
|
15
|
-
return (typeof obj === 'undefined');
|
|
16
|
-
}
|
|
17
|
-
function isUndefinedOrNull(obj) {
|
|
18
|
-
return (isUndefined(obj) || obj === null);
|
|
19
|
-
}
|
|
20
|
-
function assertAllDefined(...args) {
|
|
21
|
-
const result = [];
|
|
22
|
-
for (let i = 0; i < args.length; i++) {
|
|
23
|
-
const arg = args[i];
|
|
24
|
-
if (isUndefinedOrNull(arg)) {
|
|
25
|
-
throw new Error(`Assertion Failed: argument at index ${i} is undefined or null`);
|
|
26
|
-
}
|
|
27
|
-
result.push(arg);
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
32
|
-
function isEmptyObject(obj) {
|
|
33
|
-
if (!isObject(obj)) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
for (const key in obj) {
|
|
37
|
-
if (hasOwnProperty.call(obj, key)) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
function withUndefinedAsNull(x) {
|
|
44
|
-
return typeof x === 'undefined' ? null : x;
|
|
45
|
-
}
|
|
46
|
-
export { assertAllDefined as a, isStringArray as b, isEmptyObject as i, withUndefinedAsNull as w };
|