@innovatorved/code-lab 0.4.0 → 0.6.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/ARCHITECTURE.md +4 -4
- package/CHANGELOG.md +36 -0
- package/README.md +6 -30
- package/dist/code-lab-sql.esm.js +1 -1
- package/dist/code-lab-sql.umd.js +2 -2
- package/dist/code-lab.css +32 -5818
- package/dist/code-lab.d.ts +1 -1
- package/dist/code-lab.esm.js +4655 -64400
- package/dist/code-lab.js +4540 -64286
- package/dist/code-lab.umd.js +4540 -64286
- package/dist/diagnostics.d.ts +3 -0
- package/dist/extensions/cpp.d.ts +2 -2
- package/dist/extensions/cpp.esm.js +1804 -14725
- package/dist/extensions/cpp.js +1804 -14725
- package/dist/extensions/guided-lab.esm.js +2938 -16127
- package/dist/extensions/guided-lab.js +2938 -16127
- package/dist/extensions/python.d.ts +2 -2
- package/dist/extensions/python.esm.js +1765 -14698
- package/dist/extensions/python.js +1765 -14698
- package/dist/index.d.ts +1 -1
- package/dist/packages/settings/src/configuration-service.d.ts +7 -0
- package/dist/packages/settings/src/index.d.ts +1 -1
- package/dist/packages/ui/src/index.d.ts +2 -2
- package/dist/packages/ui/src/plugin-registry.d.ts +1 -0
- package/dist/packages/ui/src/settings-dialog.d.ts +31 -3
- package/dist/packages/ui/src/themes.d.ts +5 -0
- package/dist/preview-sw.js +4 -188
- package/dist/runtime.esm.js +109 -10284
- package/dist/runtime.js +107 -10284
- package/dist/schemas.d.ts +2 -2
- package/dist/schemas.esm.js +2938 -16127
- package/dist/schemas.js +2941 -16130
- package/dist/scm.d.ts +296 -14
- package/dist/shell.esm.js +811 -9178
- package/dist/shell.js +811 -9178
- package/dist/storage.d.ts +56 -0
- package/dist/terminal.esm.js +20 -1347
- package/dist/terminal.js +20 -1347
- package/dist/workbench/command-palette.d.ts +16 -1
- package/dist/workbench/diff-editor.d.ts +27 -1
- package/dist/workbench/icons.d.ts +6 -2
- package/dist/workbench/index.d.ts +33 -1
- package/dist/workbench/intellisense.d.ts +194 -0
- package/dist/workbench/styles.d.ts +1 -1
- package/dist/workbench/xterm-adapter.d.ts +122 -0
- package/package.json +8 -2
- package/packages/commands/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/packages/editor/package.json +1 -1
- package/packages/fs/package.json +1 -1
- package/packages/preview/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/settings/package.json +1 -1
- package/packages/settings/src/builtin-schemas.ts +17 -6
- package/packages/settings/src/configuration-service.ts +72 -6
- package/packages/settings/src/index.ts +1 -0
- package/packages/sql/package.json +1 -1
- package/packages/terminal/package.json +1 -1
- package/packages/ui/package.json +1 -1
- package/packages/ui/src/index.ts +4 -0
- package/packages/ui/src/plugin-registry.ts +17 -2
- package/packages/ui/src/settings-dialog.ts +393 -99
- package/packages/ui/src/themes.ts +183 -24
- package/src/code-lab.css +2763 -444
- package/src/diagnostics.ts +139 -7
- package/src/extensions/cpp.ts +337 -71
- package/src/extensions/python.ts +375 -75
- package/src/index.ts +1 -1
- package/src/runtime.ts +272 -43
- package/src/schemas.ts +2 -2
- package/src/scm.ts +2172 -74
- package/src/shell.ts +1999 -193
- package/src/storage.ts +401 -5
- package/src/terminal.ts +148 -12
- package/src/workbench/command-palette.ts +289 -48
- package/src/workbench/diff-editor.ts +240 -78
- package/src/workbench/icons.ts +250 -46
- package/src/workbench/index.ts +7 -1
- package/src/workbench/intellisense.ts +1859 -0
- package/src/workbench/styles.ts +25 -19
- package/src/workbench/xterm-adapter.ts +1566 -0
- package/src/workbench.ts +13446 -3881
|
@@ -17,6 +17,8 @@ import { type JsonSchema, validateJsonSchema } from './schema';
|
|
|
17
17
|
|
|
18
18
|
export type ConfigurationTarget = 'default' | 'user' | 'workspace' | 'override';
|
|
19
19
|
|
|
20
|
+
export type ConfigurationResetScope = 'user' | 'workspace' | 'all';
|
|
21
|
+
|
|
20
22
|
export interface SettingDiagnostic {
|
|
21
23
|
readonly file: string;
|
|
22
24
|
readonly key?: string;
|
|
@@ -66,8 +68,11 @@ export interface IConfigurationService extends IDisposable {
|
|
|
66
68
|
get<T = unknown>(key: string, fallback?: T): T;
|
|
67
69
|
inspect<T = unknown>(key: string): SettingInspection<T>;
|
|
68
70
|
getDiagnostics(): readonly SettingDiagnostic[];
|
|
71
|
+
getWorkspaceSettings(): Record<string, unknown>;
|
|
69
72
|
setUserSetting(key: string, value: unknown): boolean;
|
|
70
73
|
resetSetting(key: string): void;
|
|
74
|
+
resetScopedSetting(key: string, scope: ConfigurationResetScope): Promise<void>;
|
|
75
|
+
resetAllSettings(scope?: ConfigurationResetScope): Promise<void>;
|
|
71
76
|
setWorkspaceSetting(key: string, value: unknown): boolean;
|
|
72
77
|
loadWorkspaceSettingsJson(rawJsonc: string, filePath?: string): readonly SettingDiagnostic[];
|
|
73
78
|
setOverrides(overrides: Readonly<Record<string, unknown>>): void;
|
|
@@ -225,6 +230,72 @@ export class ConfigurationService implements IConfigurationService {
|
|
|
225
230
|
}
|
|
226
231
|
}
|
|
227
232
|
|
|
233
|
+
public getWorkspaceSettings(): Record<string, unknown> {
|
|
234
|
+
const out: Record<string, unknown> = {};
|
|
235
|
+
const keys = Array.from(this.workspaceValues.keys()).sort();
|
|
236
|
+
for (const k of keys) {
|
|
237
|
+
out[k] = this.workspaceValues.get(k);
|
|
238
|
+
}
|
|
239
|
+
return out;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
public async resetScopedSetting(key: string, scope: ConfigurationResetScope): Promise<void> {
|
|
243
|
+
if (scope === 'user') {
|
|
244
|
+
if (this.userValues.delete(key)) {
|
|
245
|
+
this.fireChange([key], 'user');
|
|
246
|
+
}
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (scope === 'workspace') {
|
|
250
|
+
if (this.workspaceValues.delete(key)) {
|
|
251
|
+
this.fireChange([key], 'workspace');
|
|
252
|
+
}
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const hadUser = this.userValues.delete(key);
|
|
256
|
+
const hadWs = this.workspaceValues.delete(key);
|
|
257
|
+
const hadOv = this.overrideValues.delete(key);
|
|
258
|
+
if (hadUser || hadWs || hadOv) {
|
|
259
|
+
this.fireChange([key], 'user');
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
public async resetAllSettings(scope: ConfigurationResetScope = 'all'): Promise<void> {
|
|
264
|
+
if (scope === 'user') {
|
|
265
|
+
const affected = new Set<string>(this.userValues.keys());
|
|
266
|
+
this.userValues.clear();
|
|
267
|
+
if (affected.size > 0) {
|
|
268
|
+
this.fireChange(affected, 'user');
|
|
269
|
+
}
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (scope === 'workspace') {
|
|
273
|
+
const affected = new Set<string>(this.workspaceValues.keys());
|
|
274
|
+
this.workspaceValues.clear();
|
|
275
|
+
if (this.diagnostics.length > 0) {
|
|
276
|
+
this.updateDiagnostics([]);
|
|
277
|
+
}
|
|
278
|
+
if (affected.size > 0) {
|
|
279
|
+
this.fireChange(affected, 'workspace');
|
|
280
|
+
}
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const affected = new Set<string>([
|
|
284
|
+
...this.userValues.keys(),
|
|
285
|
+
...this.workspaceValues.keys(),
|
|
286
|
+
...this.overrideValues.keys()
|
|
287
|
+
]);
|
|
288
|
+
this.userValues.clear();
|
|
289
|
+
this.workspaceValues.clear();
|
|
290
|
+
this.overrideValues.clear();
|
|
291
|
+
if (this.diagnostics.length > 0) {
|
|
292
|
+
this.updateDiagnostics([]);
|
|
293
|
+
}
|
|
294
|
+
if (affected.size > 0) {
|
|
295
|
+
this.fireChange(affected, 'user');
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
228
299
|
public loadWorkspaceSettingsJson(
|
|
229
300
|
rawJsonc: string,
|
|
230
301
|
filePath = '.codelab/settings.json'
|
|
@@ -310,12 +381,7 @@ export class ConfigurationService implements IConfigurationService {
|
|
|
310
381
|
}
|
|
311
382
|
|
|
312
383
|
public toWorkspaceJsonString(): string {
|
|
313
|
-
|
|
314
|
-
const keys = Array.from(this.workspaceValues.keys()).sort();
|
|
315
|
-
for (const k of keys) {
|
|
316
|
-
out[k] = this.workspaceValues.get(k);
|
|
317
|
-
}
|
|
318
|
-
return JSON.stringify(out, null, 2) + '\n';
|
|
384
|
+
return JSON.stringify(this.getWorkspaceSettings(), null, 2) + '\n';
|
|
319
385
|
}
|
|
320
386
|
|
|
321
387
|
public exportProfile(): string {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-lab/sql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Zero-dependency lightweight SQL editor & PostgreSQL 18 / SQLite 3 language pack (<35 KB gzipped) with schema-aware alias autocomplete, formatter, and inline error diagnostics.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
package/packages/ui/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-lab/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Workbench UI services and components for CodeLab: ThemeService (dark/light/high-contrast/custom), Searchable Settings Dialog, Quick Open, PluginRegistry, ErrorBoundary, and Dev Observability Inspector.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
package/packages/ui/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export {
|
|
|
6
6
|
LIGHT_THEME,
|
|
7
7
|
HIGH_CONTRAST_THEME,
|
|
8
8
|
IThemeServiceId,
|
|
9
|
+
pickContrastingFg,
|
|
9
10
|
parseCustomTheme,
|
|
10
11
|
ThemeService
|
|
11
12
|
} from './themes';
|
|
@@ -23,6 +24,9 @@ export {
|
|
|
23
24
|
} from './plugin-registry';
|
|
24
25
|
|
|
25
26
|
export {
|
|
27
|
+
type SettingsScope,
|
|
28
|
+
type SettingsInlineMountOptions,
|
|
29
|
+
type SettingsOpenOptions,
|
|
26
30
|
type SettingsDialogOptions,
|
|
27
31
|
SettingsDialogController
|
|
28
32
|
} from './settings-dialog';
|
|
@@ -48,6 +48,7 @@ export interface PluginActivationContext {
|
|
|
48
48
|
readonly keybindings: IKeybindingService;
|
|
49
49
|
readonly themes: IThemeService;
|
|
50
50
|
readonly logger: ILogger;
|
|
51
|
+
readonly registerPanel?: (panel: PanelContribution) => IDisposable;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
export interface CodeLabPluginManifest {
|
|
@@ -184,7 +185,15 @@ export class PluginRegistry implements IPluginRegistry {
|
|
|
184
185
|
|
|
185
186
|
return {
|
|
186
187
|
dispose: (): void => {
|
|
187
|
-
|
|
188
|
+
if (record.active) {
|
|
189
|
+
record.active = false;
|
|
190
|
+
try {
|
|
191
|
+
record.manifest.deactivate?.();
|
|
192
|
+
} catch (err) {
|
|
193
|
+
this.logger.warn(`Plugin "${manifest.id}" threw during deactivate`, err);
|
|
194
|
+
}
|
|
195
|
+
record.runtimeDisposables.dispose();
|
|
196
|
+
}
|
|
188
197
|
record.manifestDisposables.dispose();
|
|
189
198
|
this.records.delete(manifest.id);
|
|
190
199
|
this.changeEmitter.fire(manifest.id);
|
|
@@ -205,7 +214,13 @@ export class PluginRegistry implements IPluginRegistry {
|
|
|
205
214
|
configuration: this.configuration,
|
|
206
215
|
keybindings: this.keybindings,
|
|
207
216
|
themes: this.themes,
|
|
208
|
-
logger: this.logger.child(id)
|
|
217
|
+
logger: this.logger.child(id),
|
|
218
|
+
registerPanel: (panel: PanelContribution): IDisposable => {
|
|
219
|
+
const d = this.panels.register(panel.id, panel);
|
|
220
|
+
record.runtimeDisposables.add(d);
|
|
221
|
+
this.changeEmitter.fire(id);
|
|
222
|
+
return d;
|
|
223
|
+
}
|
|
209
224
|
});
|
|
210
225
|
if (ret && typeof ret.dispose === 'function') {
|
|
211
226
|
record.runtimeDisposables.add(ret);
|