@codingame/monaco-vscode-api 1.69.0 → 1.69.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/dist/configuration.js +178 -5
- package/dist/extHost.js +2 -1
- package/dist/files.js +225 -225
- package/dist/keybindings.js +1 -1
- package/dist/languageConfiguration.d.ts +1 -151
- package/dist/languageConfiguration.js +6 -10
- package/dist/languageService.js +1 -1
- package/dist/messages.js +5 -5
- package/dist/missing-services.js +1 -1
- package/dist/modelEditor.js +1 -1
- package/dist/monaco.d.ts +218 -99
- package/dist/monaco.js +23 -5
- package/dist/services2.js +1 -1
- package/dist/snippets.js +9 -48
- package/dist/textmate.d.ts +3 -2
- package/dist/textmate.js +7 -8
- package/dist/theme.d.ts +4 -3
- package/dist/theme.js +1 -1
- package/dist/tokenClassification.js +5 -7
- package/dist/tools.js +16 -2
- package/dist/workspaceContext.js +49 -0
- package/package.json +1 -1
package/dist/textmate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __decorate, a as __param } from './tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { h as ExtensionsRegistry, O as ExtensionMessageCollector, Q as ITextMateService, E as Emitter } from './missing-services.js';
|
|
3
3
|
export { Q as ITextMateService } from './missing-services.js';
|
|
4
4
|
import { l as languagesExtPoint } from './languageService.js';
|
|
5
5
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
@@ -21,13 +21,12 @@ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
|
21
21
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
22
22
|
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
23
23
|
import { nullTokenizeEncoded } from 'monaco-editor/esm/vs/editor/common/languages/nullTokenize.js';
|
|
24
|
-
import { g as getExtensionPoint, c as consoleExtensionMessageHandler } from './tools.js';
|
|
24
|
+
import { g as getExtensionPoint, c as consoleExtensionMessageHandler, o as onServicesInitialized } from './tools.js';
|
|
25
25
|
import { S as Services } from './services2.js';
|
|
26
26
|
import { bd as DEFAULT_EXTENSION } from './extHost.js';
|
|
27
27
|
import { c as createInjectedClass } from './injection.js';
|
|
28
28
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
29
29
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
30
|
-
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
31
30
|
const grammarsExtPoint = ( (ExtensionsRegistry.registerExtensionPoint({
|
|
32
31
|
extensionPoint: 'grammars',
|
|
33
32
|
deps: [languagesExtPoint],
|
|
@@ -458,7 +457,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
458
457
|
if (this._grammarFactory) {
|
|
459
458
|
return this._grammarFactory;
|
|
460
459
|
}
|
|
461
|
-
const [vscodeTextmate, vscodeOniguruma] = await Promise.all([import('vscode-textmate'), this._getVSCodeOniguruma()]);
|
|
460
|
+
const [vscodeTextmate, vscodeOniguruma] = await Promise.all([import('vscode-textmate').then(module => module.default ?? module), this._getVSCodeOniguruma()]);
|
|
462
461
|
const onigLib = Promise.resolve({
|
|
463
462
|
createOnigScanner: (sources) => vscodeOniguruma.createOnigScanner(sources),
|
|
464
463
|
createOnigString: (str) => vscodeOniguruma.createOnigString(str)
|
|
@@ -651,7 +650,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
651
650
|
return this._vscodeOniguruma;
|
|
652
651
|
}
|
|
653
652
|
async _doGetVSCodeOniguruma() {
|
|
654
|
-
const [vscodeOniguruma, wasm] = await Promise.all([import('vscode-oniguruma'), this._loadVSCodeOnigurumWASM()]);
|
|
653
|
+
const [vscodeOniguruma, wasm] = await Promise.all([import('vscode-oniguruma').then(module => module.default ?? module), this._loadVSCodeOnigurumWASM()]);
|
|
655
654
|
const options = {
|
|
656
655
|
data: wasm,
|
|
657
656
|
print: (str) => {
|
|
@@ -727,11 +726,11 @@ function setGrammars(grammars, getContent, extension = Services.get().extension
|
|
|
727
726
|
registerExtensionFile(joinPath(extension.extensionLocation, grammar.path), () => getContent(grammar));
|
|
728
727
|
}
|
|
729
728
|
}
|
|
730
|
-
function initialize() {
|
|
731
|
-
|
|
729
|
+
function initialize(instantiationService) {
|
|
730
|
+
instantiationService.invokeFunction((accessor) => accessor.get(ITextMateService));
|
|
732
731
|
}
|
|
733
732
|
function getServiceOverride(getOnigLib) {
|
|
734
|
-
|
|
733
|
+
onServicesInitialized(initialize);
|
|
735
734
|
return {
|
|
736
735
|
...getServiceOverride$1(),
|
|
737
736
|
[( ITextMateService.toString())]: new SyncDescriptor(TextMateService, [getOnigLib])
|
package/dist/theme.d.ts
CHANGED
|
@@ -15,8 +15,9 @@ interface IThemeExtensionPoint {
|
|
|
15
15
|
|
|
16
16
|
type IEditorOverrideServices = monaco.editor.IEditorOverrideServices
|
|
17
17
|
|
|
18
|
-
declare
|
|
19
|
-
declare function
|
|
18
|
+
declare type PartialIThemeExtensionPoint = Partial<IThemeExtensionPoint> & Pick<IThemeExtensionPoint, 'id' | 'path'>;
|
|
19
|
+
declare function setThemes<T extends PartialIThemeExtensionPoint>(_themes: T[], getContent: (theme: T) => Promise<string>): void;
|
|
20
|
+
declare function setDefaultThemes<T extends PartialIThemeExtensionPoint>(_themes: T[], getContent: (theme: T) => Promise<string>): void;
|
|
20
21
|
declare function getServiceOverride(): IEditorOverrideServices;
|
|
21
22
|
|
|
22
|
-
export { IThemeExtensionPoint, getServiceOverride as default, setDefaultThemes, setThemes };
|
|
23
|
+
export { PartialIThemeExtensionPoint as IThemeExtensionPoint, getServiceOverride as default, setDefaultThemes, setThemes };
|
package/dist/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IExtensionService, T as IBrowserWorkbenchEnvironmentService, V as IHostColorSchemeService, W as IUserDataInitializationService,
|
|
1
|
+
import { I as IExtensionService, T as IBrowserWorkbenchEnvironmentService, V as IHostColorSchemeService, W as IUserDataInitializationService, h as ExtensionsRegistry, E as Emitter, X as Sequencer, O as ExtensionMessageCollector, P as parse$1, S as getNodeType } from './missing-services.js';
|
|
2
2
|
import { _ as __decorate, a as __param } from './tslib.es6.js';
|
|
3
3
|
import { V as VS_DARK_THEME, a as VS_LIGHT_THEME, b as VS_HC_THEME, c as VS_HC_LIGHT_THEME, T as ThemeSettings, E as ExtensionData, d as THEME_SCOPE_OPEN_PAREN, e as THEME_SCOPE_CLOSE_PAREN, f as THEME_SCOPE_WILDCARD, t as themeScopeRegex } from './workbenchThemeService.js';
|
|
4
4
|
import { workbenchColorsSchemaId, editorBackground, editorForeground, editorSelectionBackground, editorInactiveSelection, editorSelectionHighlight, editorFindMatchHighlight, editorFindMatch, editorHoverHighlight, editorFindRangeHighlight, asCssVariableName, Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as ExtensionsRegistry, O as ExtensionMessageCollector } from './missing-services.js';
|
|
2
2
|
import { g as getTokenClassificationRegistry, a as typeAndModifierIdPattern } from './tokenClassificationRegistry.js';
|
|
3
3
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
4
|
-
import { g as getExtensionPoint, c as consoleExtensionMessageHandler } from './tools.js';
|
|
4
|
+
import { g as getExtensionPoint, c as consoleExtensionMessageHandler, o as onServicesInitialized } from './tools.js';
|
|
5
5
|
import { S as Services } from './services2.js';
|
|
6
6
|
import { bd as DEFAULT_EXTENSION } from './extHost.js';
|
|
7
|
-
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
8
|
-
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
9
7
|
const tokenClassificationRegistry = getTokenClassificationRegistry();
|
|
10
8
|
const tokenTypeExtPoint$1 = ( ExtensionsRegistry.registerExtensionPoint({
|
|
11
9
|
extensionPoint: 'semanticTokenTypes',
|
|
@@ -294,11 +292,11 @@ function setTokenStyleDefaults(tokenStyleDefaults, extension = Services.get().ex
|
|
|
294
292
|
collector: new ExtensionMessageCollector(consoleExtensionMessageHandler, extension, tokenModifierExtPoint.name)
|
|
295
293
|
}]);
|
|
296
294
|
}
|
|
297
|
-
function
|
|
298
|
-
|
|
295
|
+
function initialize(instantiationService) {
|
|
296
|
+
instantiationService.createInstance(TokenClassificationExtensionPoints);
|
|
299
297
|
}
|
|
300
298
|
function getServiceOverride() {
|
|
301
|
-
|
|
299
|
+
onServicesInitialized(initialize);
|
|
302
300
|
return {};
|
|
303
301
|
}
|
|
304
302
|
export { getServiceOverride as default, setTokenModifiers, setTokenStyleDefaults, setTokenTypes };
|
package/dist/tools.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as ExtensionsRegistry } from './missing-services.js';
|
|
2
|
+
import { EventEmitter } from 'vscode';
|
|
3
|
+
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
2
4
|
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
3
5
|
function consoleExtensionMessageHandler(msg) {
|
|
4
6
|
if (msg.type === Severity.Error) {
|
|
@@ -14,4 +16,16 @@ function consoleExtensionMessageHandler(msg) {
|
|
|
14
16
|
function getExtensionPoint(extensionPoint) {
|
|
15
17
|
return ExtensionsRegistry.getExtensionPoints().find(ep => ep.name === extensionPoint);
|
|
16
18
|
}
|
|
17
|
-
|
|
19
|
+
const emitter = new EventEmitter();
|
|
20
|
+
const onServicesInitialized = emitter.event;
|
|
21
|
+
let initialized = false;
|
|
22
|
+
const original = StandaloneServices.initialize;
|
|
23
|
+
StandaloneServices.initialize = (overrides) => {
|
|
24
|
+
const instantiationService = original.call(StandaloneServices, overrides);
|
|
25
|
+
if (!initialized) {
|
|
26
|
+
initialized = true;
|
|
27
|
+
emitter.fire(instantiationService);
|
|
28
|
+
}
|
|
29
|
+
return instantiationService;
|
|
30
|
+
};
|
|
31
|
+
export { consoleExtensionMessageHandler as c, getExtensionPoint as g, onServicesInitialized as o };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { u as unsupported } from './missing-services.js';
|
|
2
|
+
import { S as Services } from './services2.js';
|
|
3
|
+
import { IWorkspaceContextService, WorkspaceFolder } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
4
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
5
|
+
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
6
|
+
class SimpleWorkspaceContextService {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.onDidChangeWorkspaceName = Event.None;
|
|
9
|
+
this.onWillChangeWorkspaceFolders = Event.None;
|
|
10
|
+
this.onDidChangeWorkspaceFolders = Event.None;
|
|
11
|
+
this.onDidChangeWorkbenchState = Event.None;
|
|
12
|
+
this.isCurrentWorkspace = unsupported;
|
|
13
|
+
}
|
|
14
|
+
getCompleteWorkspace() {
|
|
15
|
+
return Promise.resolve(this.getWorkspace());
|
|
16
|
+
}
|
|
17
|
+
getWorkspace() {
|
|
18
|
+
const workspaceFolders = Services.get().workspace?.workspaceFolders;
|
|
19
|
+
return {
|
|
20
|
+
id: '4064f6ec-cb38-4ad0-af64-ee6467e63c82',
|
|
21
|
+
folders: workspaceFolders?.map(folder => new WorkspaceFolder(folder)) ?? []
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
getWorkbenchState() {
|
|
25
|
+
const workspaceFoldersCount = Services.get().workspace?.workspaceFolders?.length ?? 1;
|
|
26
|
+
if (workspaceFoldersCount === 0) {
|
|
27
|
+
return 1 ;
|
|
28
|
+
}
|
|
29
|
+
else if (workspaceFoldersCount === 1) {
|
|
30
|
+
return 2 ;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return 3 ;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
getWorkspaceFolder(resource) {
|
|
37
|
+
const workspace = this.getWorkspace();
|
|
38
|
+
return workspace.folders.find(folder => folder.uri.scheme === resource.scheme && resource.path.startsWith(folder.uri.path)) ?? null;
|
|
39
|
+
}
|
|
40
|
+
isInsideWorkspace(resource) {
|
|
41
|
+
return this.getWorkspaceFolder(resource) != null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function getServiceOverride() {
|
|
45
|
+
return {
|
|
46
|
+
[( IWorkspaceContextService.toString())]: new SyncDescriptor(SimpleWorkspaceContextService)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export { getServiceOverride as g };
|