@codingame/monaco-vscode-layout-service-override 26.2.2 → 28.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -20,8 +20,6 @@ import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/wor
|
|
|
20
20
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
21
21
|
import { LayoutSettings, Parts, positionFromString, ActivityBarPosition, positionToString } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
22
22
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
23
|
-
import { WorkbenchModeService } from './vscode/src/vs/workbench/services/layout/browser/workbenchModeService.js';
|
|
24
|
-
import { IWorkbenchModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/common/workbenchModeService.service';
|
|
25
23
|
import { IPaneCompositePartService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
26
24
|
import { IStatusbarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
27
25
|
import { onRenderWorkbench } from '@codingame/monaco-vscode-api/lifecycle';
|
|
@@ -399,8 +397,7 @@ onRenderWorkbench((accessor) => {
|
|
|
399
397
|
});
|
|
400
398
|
function getServiceOverride(container) {
|
|
401
399
|
return {
|
|
402
|
-
[ILayoutService.toString()]: new SyncDescriptor(LayoutService, [container], true)
|
|
403
|
-
[IWorkbenchModeService.toString()]: new SyncDescriptor(WorkbenchModeService, [], true)
|
|
400
|
+
[ILayoutService.toString()]: new SyncDescriptor(LayoutService, [container], true)
|
|
404
401
|
};
|
|
405
402
|
}
|
|
406
403
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-layout-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "28.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - layout service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "28.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
4
|
-
import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service";
|
|
5
|
-
import { IWorkbenchModeConfiguration } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/common/workbenchModeService";
|
|
6
|
-
import { IWorkbenchModeService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/common/workbenchModeService.service";
|
|
7
|
-
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
8
|
-
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
9
|
-
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
10
|
-
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
11
|
-
export declare class WorkbenchModeService extends Disposable implements IWorkbenchModeService {
|
|
12
|
-
private readonly workspaceContextService;
|
|
13
|
-
private readonly fileService;
|
|
14
|
-
private readonly environmentService;
|
|
15
|
-
private readonly uriIdentityService;
|
|
16
|
-
private readonly logService;
|
|
17
|
-
private readonly storageService;
|
|
18
|
-
readonly _serviceBrand: undefined;
|
|
19
|
-
private static readonly WORKBENCH_MODE_STORAGE_KEY;
|
|
20
|
-
private _workbenchMode;
|
|
21
|
-
get workbenchMode(): string | undefined;
|
|
22
|
-
private readonly _onDidChangeWorkbenchMode;
|
|
23
|
-
readonly onDidChangeWorkbenchMode: Event<string | undefined>;
|
|
24
|
-
private readonly workbenchModeFileWatcherDiposables;
|
|
25
|
-
private readonly configurationRegistry;
|
|
26
|
-
private configurationDefaults;
|
|
27
|
-
constructor(workspaceContextService: IWorkspaceContextService, fileService: IFileService, environmentService: IEnvironmentService, uriIdentityService: IUriIdentityService, logService: ILogService, storageService: IStorageService);
|
|
28
|
-
initialize(): Promise<void>;
|
|
29
|
-
private updateWorkbenchModeConfiguration;
|
|
30
|
-
private updateConfigurationDefaults;
|
|
31
|
-
private watchCurrentModeFile;
|
|
32
|
-
private getWorkbenchModeFileUri;
|
|
33
|
-
getWorkbenchModeConfiguration(id: string): Promise<IWorkbenchModeConfiguration | undefined>;
|
|
34
|
-
getWorkbenchModeConfigurations(): Promise<IWorkbenchModeConfiguration[]>;
|
|
35
|
-
private resolveWorkbenchModeConfiguration;
|
|
36
|
-
setWorkbenchMode(modeId: string | undefined): Promise<void>;
|
|
37
|
-
private updateWorkbenchMode;
|
|
38
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
-
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
6
|
-
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
7
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
8
|
-
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
9
|
-
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
10
|
-
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
11
|
-
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
12
|
-
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
13
|
-
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
14
|
-
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
15
|
-
|
|
16
|
-
var WorkbenchModeService_1;
|
|
17
|
-
let WorkbenchModeService = class WorkbenchModeService extends Disposable {
|
|
18
|
-
static {
|
|
19
|
-
WorkbenchModeService_1 = this;
|
|
20
|
-
}
|
|
21
|
-
static {
|
|
22
|
-
this.WORKBENCH_MODE_STORAGE_KEY = "workbench.mode";
|
|
23
|
-
}
|
|
24
|
-
get workbenchMode() {
|
|
25
|
-
return this._workbenchMode;
|
|
26
|
-
}
|
|
27
|
-
constructor(
|
|
28
|
-
workspaceContextService,
|
|
29
|
-
fileService,
|
|
30
|
-
environmentService,
|
|
31
|
-
uriIdentityService,
|
|
32
|
-
logService,
|
|
33
|
-
storageService
|
|
34
|
-
) {
|
|
35
|
-
super();
|
|
36
|
-
this.workspaceContextService = workspaceContextService;
|
|
37
|
-
this.fileService = fileService;
|
|
38
|
-
this.environmentService = environmentService;
|
|
39
|
-
this.uriIdentityService = uriIdentityService;
|
|
40
|
-
this.logService = logService;
|
|
41
|
-
this.storageService = storageService;
|
|
42
|
-
this._onDidChangeWorkbenchMode = this._register(( new Emitter()));
|
|
43
|
-
this.onDidChangeWorkbenchMode = this._onDidChangeWorkbenchMode.event;
|
|
44
|
-
this.workbenchModeFileWatcherDiposables = this._register(( new DisposableStore()));
|
|
45
|
-
this.configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
46
|
-
this._workbenchMode = this.workspaceContextService.getWorkspace().isAgentSessionsWorkspace ? "agent-sessions" : this.storageService.get(WorkbenchModeService_1.WORKBENCH_MODE_STORAGE_KEY, StorageScope.WORKSPACE);
|
|
47
|
-
this.watchCurrentModeFile();
|
|
48
|
-
}
|
|
49
|
-
async initialize() {
|
|
50
|
-
return this.updateWorkbenchModeConfiguration();
|
|
51
|
-
}
|
|
52
|
-
async updateWorkbenchModeConfiguration() {
|
|
53
|
-
const workbenchModeConfiguration = this._workbenchMode ? await this.getWorkbenchModeConfiguration(this._workbenchMode) : undefined;
|
|
54
|
-
this.updateConfigurationDefaults(workbenchModeConfiguration?.settings);
|
|
55
|
-
}
|
|
56
|
-
updateConfigurationDefaults(configurationDefaults) {
|
|
57
|
-
if (this.configurationDefaults) {
|
|
58
|
-
this.configurationRegistry.deregisterDefaultConfigurations([this.configurationDefaults]);
|
|
59
|
-
}
|
|
60
|
-
if (configurationDefaults) {
|
|
61
|
-
this.configurationDefaults = {
|
|
62
|
-
overrides: configurationDefaults,
|
|
63
|
-
donotCache: true
|
|
64
|
-
};
|
|
65
|
-
this.configurationRegistry.registerDefaultConfigurations([this.configurationDefaults]);
|
|
66
|
-
} else {
|
|
67
|
-
this.configurationDefaults = undefined;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
watchCurrentModeFile() {
|
|
71
|
-
if (!this._workbenchMode) {
|
|
72
|
-
this.workbenchModeFileWatcherDiposables.clear();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const workbenchModeFileUri = this.getWorkbenchModeFileUri(this._workbenchMode);
|
|
76
|
-
if (!workbenchModeFileUri) {
|
|
77
|
-
this.workbenchModeFileWatcherDiposables.clear();
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
this.workbenchModeFileWatcherDiposables.add(this.fileService.watch(workbenchModeFileUri));
|
|
81
|
-
this.workbenchModeFileWatcherDiposables.add(this.fileService.onDidFilesChange(e => {
|
|
82
|
-
if (e.affects(workbenchModeFileUri)) {
|
|
83
|
-
this.updateWorkbenchModeConfiguration();
|
|
84
|
-
this._onDidChangeWorkbenchMode.fire(this._workbenchMode);
|
|
85
|
-
}
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
getWorkbenchModeFileUri(layoutId) {
|
|
89
|
-
return this.uriIdentityService.extUri.joinPath(
|
|
90
|
-
this.environmentService.builtinWorkbenchModesHome,
|
|
91
|
-
`${layoutId}.code-workbench-mode`
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
async getWorkbenchModeConfiguration(id) {
|
|
95
|
-
const resource = this.getWorkbenchModeFileUri(id);
|
|
96
|
-
return this.resolveWorkbenchModeConfiguration(resource);
|
|
97
|
-
}
|
|
98
|
-
async getWorkbenchModeConfigurations() {
|
|
99
|
-
const result = [];
|
|
100
|
-
const workbenchModesFolder = this.environmentService.builtinWorkbenchModesHome;
|
|
101
|
-
try {
|
|
102
|
-
const stat = await this.fileService.resolve(workbenchModesFolder);
|
|
103
|
-
if (!stat.children?.length) {
|
|
104
|
-
return result;
|
|
105
|
-
}
|
|
106
|
-
for (const child of stat.children) {
|
|
107
|
-
if (child.isDirectory) {
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
const workbenchModeConfiguration = await this.resolveWorkbenchModeConfiguration(child.resource);
|
|
111
|
-
if (workbenchModeConfiguration) {
|
|
112
|
-
result.push(workbenchModeConfiguration);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
} catch (error) {
|
|
116
|
-
this.logService.error(`Error while reading workbench mode files from ${( workbenchModesFolder.toString())}`, error);
|
|
117
|
-
}
|
|
118
|
-
return result;
|
|
119
|
-
}
|
|
120
|
-
async resolveWorkbenchModeConfiguration(workbenchConfigurationModeFile) {
|
|
121
|
-
if (this.uriIdentityService.extUri.extname(workbenchConfigurationModeFile) !== ".code-workbench-mode") {
|
|
122
|
-
return undefined;
|
|
123
|
-
}
|
|
124
|
-
try {
|
|
125
|
-
const content = ( (await this.fileService.readFile(workbenchConfigurationModeFile)).value.toString());
|
|
126
|
-
const name = this.uriIdentityService.extUri.basename(workbenchConfigurationModeFile);
|
|
127
|
-
const workbenchModeConfiguration = {
|
|
128
|
-
id: name.substring(0, name.length - ".code-workbench-mode".length),
|
|
129
|
-
...parse(content)
|
|
130
|
-
};
|
|
131
|
-
return workbenchModeConfiguration;
|
|
132
|
-
} catch (error) {
|
|
133
|
-
this.logService.error(`Error while reading workbench mode file from ${( workbenchConfigurationModeFile.toString())}`, error);
|
|
134
|
-
return undefined;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
async setWorkbenchMode(modeId) {
|
|
138
|
-
if (this.workspaceContextService.getWorkspace().isAgentSessionsWorkspace) {
|
|
139
|
-
throw ( new Error("Cannot set workbench mode in an agent sessions workspace"));
|
|
140
|
-
}
|
|
141
|
-
if (this._workbenchMode === modeId) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
this.updateWorkbenchMode(modeId);
|
|
145
|
-
await this.updateWorkbenchModeConfiguration();
|
|
146
|
-
this.watchCurrentModeFile();
|
|
147
|
-
this._onDidChangeWorkbenchMode.fire(modeId);
|
|
148
|
-
}
|
|
149
|
-
updateWorkbenchMode(modeId) {
|
|
150
|
-
this._workbenchMode = modeId;
|
|
151
|
-
if (modeId === undefined) {
|
|
152
|
-
this.storageService.remove(WorkbenchModeService_1.WORKBENCH_MODE_STORAGE_KEY, StorageScope.WORKSPACE);
|
|
153
|
-
} else {
|
|
154
|
-
this.storageService.store(
|
|
155
|
-
WorkbenchModeService_1.WORKBENCH_MODE_STORAGE_KEY,
|
|
156
|
-
modeId,
|
|
157
|
-
StorageScope.WORKSPACE,
|
|
158
|
-
StorageTarget.MACHINE
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
WorkbenchModeService = WorkbenchModeService_1 = ( __decorate([( __param(0, IWorkspaceContextService)), ( __param(1, IFileService)), ( __param(2, IEnvironmentService)), ( __param(3, IUriIdentityService)), ( __param(4, ILogService)), ( __param(5, IStorageService))], WorkbenchModeService));
|
|
164
|
-
|
|
165
|
-
export { WorkbenchModeService };
|