@theia/plugin-ext 1.73.0-next.3 → 1.73.0-next.31
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/lib/hosted/node/hosted-plugin-localization-service.d.ts +2 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +6 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/plugin-deployer-handler-impl.js +4 -3
- package/lib/hosted/node/plugin-deployer-handler-impl.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts +2 -0
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +63 -50
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +1 -0
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +1 -0
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.js +3 -0
- package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +2 -0
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/debug/debug-main.d.ts +1 -11
- package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
- package/lib/main/browser/debug/debug-main.js +3 -24
- package/lib/main/browser/debug/debug-main.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts +2 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.js +8 -3
- package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +7 -44
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.js +29 -35
- package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +2 -0
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +7 -1
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/lm-main.js +2 -2
- package/lib/main/browser/lm-main.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.d.ts +2 -0
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +10 -4
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +7 -0
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +85 -6
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.spec.d.ts +2 -0
- package/lib/main/browser/view/plugin-view-registry.spec.d.ts.map +1 -0
- package/lib/main/browser/view/plugin-view-registry.spec.js +80 -0
- package/lib/main/browser/view/plugin-view-registry.spec.js.map +1 -0
- package/lib/main/browser/webview/webview-resource-cache.d.ts +2 -0
- package/lib/main/browser/webview/webview-resource-cache.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-resource-cache.js +7 -1
- package/lib/main/browser/webview/webview-resource-cache.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +2 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +7 -1
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +2 -1
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/plugin/languages/diagnostics.d.ts +4 -1
- package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
- package/lib/plugin/languages/diagnostics.js +22 -9
- package/lib/plugin/languages/diagnostics.js.map +1 -1
- package/package.json +29 -29
- package/src/hosted/node/hosted-plugin-localization-service.ts +6 -3
- package/src/hosted/node/plugin-deployer-handler-impl.ts +5 -5
- package/src/hosted/node/scanners/scanner-theia.ts +63 -51
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +1 -0
- package/src/main/browser/custom-editors/custom-editor-widget.ts +4 -0
- package/src/main/browser/custom-editors/custom-editors-main.ts +2 -0
- package/src/main/browser/debug/debug-main.ts +3 -45
- package/src/main/browser/debug/plugin-debug-service.ts +7 -5
- package/src/main/browser/debug/plugin-debug-session-factory.ts +25 -71
- package/src/main/browser/languages-main.ts +6 -2
- package/src/main/browser/lm-main.ts +2 -2
- package/src/main/browser/plugin-contribution-handler.ts +8 -4
- package/src/main/browser/view/plugin-view-registry.spec.ts +105 -0
- package/src/main/browser/view/plugin-view-registry.ts +91 -6
- package/src/main/browser/webview/webview-resource-cache.ts +6 -2
- package/src/main/browser/webview/webview.ts +6 -3
- package/src/main/node/plugin-deployer-impl.ts +2 -2
- package/src/plugin/languages/diagnostics.ts +28 -10
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
/* eslint-disable @theia/localization-check */
|
|
18
18
|
|
|
19
|
-
import { inject, injectable, unmanaged } from '@theia/core/shared/inversify';
|
|
19
|
+
import { inject, injectable, unmanaged, named } from '@theia/core/shared/inversify';
|
|
20
20
|
import {
|
|
21
21
|
AutoClosingPair,
|
|
22
22
|
AutoClosingPairConditional,
|
|
@@ -82,10 +82,19 @@ import { ColorDefinition } from '@theia/core/lib/common/color';
|
|
|
82
82
|
import { CSSIcon } from '@theia/core/lib/common/markdown-rendering/icon-utilities';
|
|
83
83
|
import { PluginUriFactory } from './plugin-uri-factory';
|
|
84
84
|
import { PreferenceScope } from '@theia/core/lib/common/preferences/preference-scope';
|
|
85
|
+
import { ILogger } from '@theia/core';
|
|
85
86
|
|
|
86
87
|
const colorIdPattern = '^\\w+[.\\w+]*$';
|
|
87
88
|
const iconIdPattern = `^${CSSIcon.iconNameSegment}(-${CSSIcon.iconNameSegment})+$`;
|
|
88
89
|
|
|
90
|
+
/** Maps the view container locations used by VS Code extensions to the Theia shell locations. */
|
|
91
|
+
const VIEW_CONTAINER_LOCATION_ALIASES: Record<string, string> = {
|
|
92
|
+
activitybar: 'left',
|
|
93
|
+
panel: 'bottom',
|
|
94
|
+
secondarySidebar: 'right',
|
|
95
|
+
auxiliarybar: 'right'
|
|
96
|
+
};
|
|
97
|
+
|
|
89
98
|
function getFileExtension(filePath: string): string {
|
|
90
99
|
const index = filePath.lastIndexOf('.');
|
|
91
100
|
return index === -1 ? '' : filePath.substring(index + 1);
|
|
@@ -276,6 +285,9 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
276
285
|
super('theiaPlugin', 'backend-init-theia');
|
|
277
286
|
}
|
|
278
287
|
|
|
288
|
+
@inject(ILogger) @named('plugin-ext:TheiaPluginScanner')
|
|
289
|
+
protected readonly logger: ILogger;
|
|
290
|
+
|
|
279
291
|
protected getEntryPoint(plugin: PluginPackage): PluginEntryPoint {
|
|
280
292
|
const result: PluginEntryPoint = {
|
|
281
293
|
frontend: plugin.theiaPlugin!.frontend,
|
|
@@ -327,7 +339,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
327
339
|
}
|
|
328
340
|
}
|
|
329
341
|
} catch (err) {
|
|
330
|
-
|
|
342
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'configuration'.`, rawPlugin.contributes.configuration, err);
|
|
331
343
|
}
|
|
332
344
|
|
|
333
345
|
const configurationDefaults = rawPlugin.contributes.configurationDefaults;
|
|
@@ -338,7 +350,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
338
350
|
contributions.submenus = this.readSubmenus(rawPlugin.contributes.submenus, rawPlugin);
|
|
339
351
|
}
|
|
340
352
|
} catch (err) {
|
|
341
|
-
|
|
353
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'submenus'.`, rawPlugin.contributes.submenus, err);
|
|
342
354
|
}
|
|
343
355
|
|
|
344
356
|
try {
|
|
@@ -347,7 +359,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
347
359
|
contributions.customEditors = customEditors;
|
|
348
360
|
}
|
|
349
361
|
} catch (err) {
|
|
350
|
-
|
|
362
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'customEditors'.`, rawPlugin.contributes.customEditors, err);
|
|
351
363
|
}
|
|
352
364
|
|
|
353
365
|
try {
|
|
@@ -357,7 +369,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
357
369
|
|
|
358
370
|
for (const location of Object.keys(viewsContainers)) {
|
|
359
371
|
const containers = this.readViewsContainers(viewsContainers[location], rawPlugin);
|
|
360
|
-
const loc = location
|
|
372
|
+
const loc = VIEW_CONTAINER_LOCATION_ALIASES[location] ?? location;
|
|
361
373
|
if (contributions.viewsContainers[loc]) {
|
|
362
374
|
contributions.viewsContainers[loc] = contributions.viewsContainers[loc].concat(containers);
|
|
363
375
|
} else {
|
|
@@ -366,7 +378,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
366
378
|
}
|
|
367
379
|
}
|
|
368
380
|
} catch (err) {
|
|
369
|
-
|
|
381
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'viewsContainers'.`, rawPlugin.contributes.viewsContainers, err);
|
|
370
382
|
}
|
|
371
383
|
|
|
372
384
|
try {
|
|
@@ -379,7 +391,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
379
391
|
}
|
|
380
392
|
}
|
|
381
393
|
} catch (err) {
|
|
382
|
-
|
|
394
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'views'.`, rawPlugin.contributes.views, err);
|
|
383
395
|
}
|
|
384
396
|
|
|
385
397
|
try {
|
|
@@ -387,7 +399,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
387
399
|
contributions.viewsWelcome = this.readViewsWelcome(rawPlugin.contributes!.viewsWelcome, rawPlugin.contributes.views);
|
|
388
400
|
}
|
|
389
401
|
} catch (err) {
|
|
390
|
-
|
|
402
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'viewsWelcome'.`, rawPlugin.contributes.viewsWelcome, err);
|
|
391
403
|
}
|
|
392
404
|
|
|
393
405
|
try {
|
|
@@ -397,7 +409,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
397
409
|
contributions.commands = commands.map(command => this.readCommand(command, rawPlugin));
|
|
398
410
|
}
|
|
399
411
|
} catch (err) {
|
|
400
|
-
|
|
412
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'commands'.`, rawPlugin.contributes!.commands, err);
|
|
401
413
|
}
|
|
402
414
|
|
|
403
415
|
try {
|
|
@@ -410,7 +422,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
410
422
|
}
|
|
411
423
|
}
|
|
412
424
|
} catch (err) {
|
|
413
|
-
|
|
425
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'menus'.`, rawPlugin.contributes.menus, err);
|
|
414
426
|
}
|
|
415
427
|
|
|
416
428
|
try {
|
|
@@ -419,7 +431,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
419
431
|
contributions.keybindings = rawKeybindings.map(rawKeybinding => this.readKeybinding(rawKeybinding));
|
|
420
432
|
}
|
|
421
433
|
} catch (err) {
|
|
422
|
-
|
|
434
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'keybindings'.`, rawPlugin.contributes.keybindings, err);
|
|
423
435
|
}
|
|
424
436
|
|
|
425
437
|
try {
|
|
@@ -428,7 +440,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
428
440
|
contributions.debuggers = debuggers;
|
|
429
441
|
}
|
|
430
442
|
} catch (err) {
|
|
431
|
-
|
|
443
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'debuggers'.`, rawPlugin.contributes.debuggers, err);
|
|
432
444
|
}
|
|
433
445
|
|
|
434
446
|
try {
|
|
@@ -437,91 +449,91 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
437
449
|
contributions.taskDefinitions = definitions.map(definitionContribution => this.readTaskDefinition(rawPlugin.name, definitionContribution));
|
|
438
450
|
}
|
|
439
451
|
} catch (err) {
|
|
440
|
-
|
|
452
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'taskDefinitions'.`, rawPlugin.contributes.taskDefinitions, err);
|
|
441
453
|
}
|
|
442
454
|
|
|
443
455
|
try {
|
|
444
456
|
contributions.problemMatchers = rawPlugin.contributes.problemMatchers;
|
|
445
457
|
} catch (err) {
|
|
446
|
-
|
|
458
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'problemMatchers'.`, rawPlugin.contributes.problemMatchers, err);
|
|
447
459
|
}
|
|
448
460
|
|
|
449
461
|
try {
|
|
450
462
|
contributions.problemPatterns = rawPlugin.contributes.problemPatterns;
|
|
451
463
|
} catch (err) {
|
|
452
|
-
|
|
464
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'problemPatterns'.`, rawPlugin.contributes.problemPatterns, err);
|
|
453
465
|
}
|
|
454
466
|
|
|
455
467
|
try {
|
|
456
468
|
contributions.resourceLabelFormatters = rawPlugin.contributes.resourceLabelFormatters;
|
|
457
469
|
} catch (err) {
|
|
458
|
-
|
|
470
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'resourceLabelFormatters'.`, rawPlugin.contributes.resourceLabelFormatters, err);
|
|
459
471
|
}
|
|
460
472
|
|
|
461
473
|
try {
|
|
462
474
|
contributions.authentication = rawPlugin.contributes.authentication;
|
|
463
475
|
} catch (err) {
|
|
464
|
-
|
|
476
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'authentication'.`, rawPlugin.contributes.authentication, err);
|
|
465
477
|
}
|
|
466
478
|
|
|
467
479
|
try {
|
|
468
480
|
contributions.notebooks = rawPlugin.contributes.notebooks;
|
|
469
481
|
} catch (err) {
|
|
470
|
-
|
|
482
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'notebooks'.`, rawPlugin.contributes.notebooks, err);
|
|
471
483
|
}
|
|
472
484
|
|
|
473
485
|
try {
|
|
474
486
|
contributions.notebookRenderer = rawPlugin.contributes.notebookRenderer;
|
|
475
487
|
} catch (err) {
|
|
476
|
-
|
|
488
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'notebook-renderer'.`, rawPlugin.contributes.notebookRenderer, err);
|
|
477
489
|
}
|
|
478
490
|
|
|
479
491
|
try {
|
|
480
492
|
contributions.notebookPreload = rawPlugin.contributes.notebookPreload;
|
|
481
493
|
} catch (err) {
|
|
482
|
-
|
|
494
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'notebooks-preload'.`, rawPlugin.contributes.notebookPreload, err);
|
|
483
495
|
}
|
|
484
496
|
|
|
485
497
|
try {
|
|
486
498
|
contributions.snippets = this.readSnippets(rawPlugin);
|
|
487
499
|
} catch (err) {
|
|
488
|
-
|
|
500
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'snippets'.`, rawPlugin.contributes!.snippets, err);
|
|
489
501
|
}
|
|
490
502
|
|
|
491
503
|
try {
|
|
492
504
|
contributions.themes = this.readThemes(rawPlugin);
|
|
493
505
|
} catch (err) {
|
|
494
|
-
|
|
506
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'themes'.`, rawPlugin.contributes.themes, err);
|
|
495
507
|
}
|
|
496
508
|
|
|
497
509
|
try {
|
|
498
510
|
contributions.icons = this.readIcons(rawPlugin);
|
|
499
511
|
} catch (err) {
|
|
500
|
-
|
|
512
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'icons'.`, rawPlugin.contributes.icons, err);
|
|
501
513
|
}
|
|
502
514
|
|
|
503
515
|
try {
|
|
504
516
|
contributions.iconThemes = this.readIconThemes(rawPlugin);
|
|
505
517
|
} catch (err) {
|
|
506
|
-
|
|
518
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'iconThemes'.`, rawPlugin.contributes.iconThemes, err);
|
|
507
519
|
}
|
|
508
520
|
|
|
509
521
|
try {
|
|
510
522
|
contributions.colors = this.readColors(rawPlugin);
|
|
511
523
|
} catch (err) {
|
|
512
|
-
|
|
524
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'colors'.`, rawPlugin.contributes.colors, err);
|
|
513
525
|
}
|
|
514
526
|
|
|
515
527
|
try {
|
|
516
528
|
contributions.terminalProfiles = this.readTerminals(rawPlugin);
|
|
517
529
|
} catch (err) {
|
|
518
|
-
|
|
530
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'terminals'.`, rawPlugin.contributes.terminal, err);
|
|
519
531
|
}
|
|
520
532
|
|
|
521
533
|
try {
|
|
522
534
|
contributions.localizations = this.readLocalizations(rawPlugin);
|
|
523
535
|
} catch (err) {
|
|
524
|
-
|
|
536
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'localizations'.`, rawPlugin.contributes.localizations, err);
|
|
525
537
|
}
|
|
526
538
|
|
|
527
539
|
const [languagesResult, grammarsResult] = await Promise.allSettled([
|
|
@@ -533,7 +545,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
533
545
|
if (languagesResult.status === 'fulfilled') {
|
|
534
546
|
contributions.languages = languagesResult.value;
|
|
535
547
|
} else {
|
|
536
|
-
|
|
548
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'languages'.`, rawPlugin.contributes.languages, languagesResult.reason);
|
|
537
549
|
}
|
|
538
550
|
}
|
|
539
551
|
|
|
@@ -541,7 +553,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
541
553
|
if (grammarsResult.status === 'fulfilled') {
|
|
542
554
|
contributions.grammars = grammarsResult.value;
|
|
543
555
|
} else {
|
|
544
|
-
|
|
556
|
+
this.logger.error(`Could not read '${rawPlugin.name}' contribution 'grammars'.`, rawPlugin.contributes.grammars, grammarsResult.reason);
|
|
545
557
|
}
|
|
546
558
|
}
|
|
547
559
|
|
|
@@ -616,20 +628,20 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
616
628
|
const result: ColorDefinition[] = [];
|
|
617
629
|
for (const contribution of pck.contributes.colors) {
|
|
618
630
|
if (typeof contribution.id !== 'string' || contribution.id.length === 0) {
|
|
619
|
-
|
|
631
|
+
this.logger.error("'configuration.colors.id' must be defined and can not be empty");
|
|
620
632
|
continue;
|
|
621
633
|
}
|
|
622
634
|
if (!contribution.id.match(colorIdPattern)) {
|
|
623
|
-
|
|
635
|
+
this.logger.error("'configuration.colors.id' must follow the word[.word]*");
|
|
624
636
|
continue;
|
|
625
637
|
}
|
|
626
638
|
if (typeof contribution.description !== 'string' || contribution.id.length === 0) {
|
|
627
|
-
|
|
639
|
+
this.logger.error("'configuration.colors.description' must be defined and can not be empty");
|
|
628
640
|
continue;
|
|
629
641
|
}
|
|
630
642
|
const defaults = contribution.defaults;
|
|
631
643
|
if (!defaults || typeof defaults !== 'object' || typeof defaults.light !== 'string' || typeof defaults.dark !== 'string' || typeof defaults.highContrast !== 'string') {
|
|
632
|
-
|
|
644
|
+
this.logger.error("'configuration.colors.defaults' must be defined and must contain 'light', 'dark' and 'highContrast'");
|
|
633
645
|
continue;
|
|
634
646
|
}
|
|
635
647
|
result.push({
|
|
@@ -671,11 +683,11 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
671
683
|
const result: IconThemeContribution[] = [];
|
|
672
684
|
for (const contribution of pck.contributes.iconThemes) {
|
|
673
685
|
if (typeof contribution.id !== 'string') {
|
|
674
|
-
|
|
686
|
+
this.logger.error('Expected string in `contributes.iconThemes.id`. Provided value:', contribution.id);
|
|
675
687
|
continue;
|
|
676
688
|
}
|
|
677
689
|
if (typeof contribution.path !== 'string') {
|
|
678
|
-
|
|
690
|
+
this.logger.error('Expected string in `contributes.iconThemes.path`. Provided value:', contribution.path);
|
|
679
691
|
continue;
|
|
680
692
|
}
|
|
681
693
|
result.push({
|
|
@@ -698,13 +710,13 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
698
710
|
for (const id in iconEntries) {
|
|
699
711
|
if (pck.contributes.icons.hasOwnProperty(id)) {
|
|
700
712
|
if (!id.match(iconIdPattern)) {
|
|
701
|
-
|
|
713
|
+
this.logger.error("'configuration.icons' keys represent the icon id and can only contain letter, digits and minuses. " +
|
|
702
714
|
'They need to consist of at least two segments in the form `component-iconname`.', 'extension: ', pck.name, 'icon id: ', id);
|
|
703
715
|
return;
|
|
704
716
|
}
|
|
705
717
|
const iconContribution = iconEntries[id];
|
|
706
718
|
if (typeof iconContribution.description !== 'string' || iconContribution.description['length'] === 0) {
|
|
707
|
-
|
|
719
|
+
this.logger.error('configuration.icons.description must be defined and can not be empty, ', 'extension: ', pck.name, 'icon id: ', id);
|
|
708
720
|
return;
|
|
709
721
|
}
|
|
710
722
|
|
|
@@ -719,7 +731,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
719
731
|
} else if (typeof defaultIcon === 'object' && typeof defaultIcon.fontPath === 'string' && typeof defaultIcon.fontCharacter === 'string') {
|
|
720
732
|
const format = getFileExtension(defaultIcon.fontPath);
|
|
721
733
|
if (['woff', 'woff2', 'ttf'].indexOf(format) === -1) {
|
|
722
|
-
|
|
734
|
+
this.logger.warn("Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.", format);
|
|
723
735
|
return;
|
|
724
736
|
}
|
|
725
737
|
|
|
@@ -734,7 +746,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
734
746
|
}
|
|
735
747
|
});
|
|
736
748
|
} else {
|
|
737
|
-
|
|
749
|
+
this.logger.error("'configuration.icons.default' must be either a reference to the id of an other theme icon (string) or a icon definition (object) with ",
|
|
738
750
|
'properties `fontPath` and `fontCharacter`.');
|
|
739
751
|
}
|
|
740
752
|
}
|
|
@@ -769,7 +781,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
769
781
|
return content;
|
|
770
782
|
} catch (e) {
|
|
771
783
|
if (!isENOENT(e)) {
|
|
772
|
-
|
|
784
|
+
this.logger.error(e);
|
|
773
785
|
}
|
|
774
786
|
return '';
|
|
775
787
|
}
|
|
@@ -1010,7 +1022,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
1010
1022
|
return undefined;
|
|
1011
1023
|
}
|
|
1012
1024
|
if (!Array.isArray(source)) {
|
|
1013
|
-
|
|
1025
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`autoClosingPairs\` to be an array.`);
|
|
1014
1026
|
return undefined;
|
|
1015
1027
|
}
|
|
1016
1028
|
|
|
@@ -1019,27 +1031,27 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
1019
1031
|
const pair = source[i];
|
|
1020
1032
|
if (Array.isArray(pair)) {
|
|
1021
1033
|
if (!isCharacterPair(pair)) {
|
|
1022
|
-
|
|
1034
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`autoClosingPairs[${i}]\` to be an array of two strings or an object.`);
|
|
1023
1035
|
continue;
|
|
1024
1036
|
}
|
|
1025
1037
|
result = result || [];
|
|
1026
1038
|
result.push({ open: pair[0], close: pair[1] });
|
|
1027
1039
|
} else {
|
|
1028
1040
|
if (!isObject(pair)) {
|
|
1029
|
-
|
|
1041
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`autoClosingPairs[${i}]\` to be an array of two strings or an object.`);
|
|
1030
1042
|
continue;
|
|
1031
1043
|
}
|
|
1032
1044
|
if (typeof pair.open !== 'string') {
|
|
1033
|
-
|
|
1045
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`autoClosingPairs[${i}].open\` to be a string.`);
|
|
1034
1046
|
continue;
|
|
1035
1047
|
}
|
|
1036
1048
|
if (typeof pair.close !== 'string') {
|
|
1037
|
-
|
|
1049
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`autoClosingPairs[${i}].close\` to be a string.`);
|
|
1038
1050
|
continue;
|
|
1039
1051
|
}
|
|
1040
1052
|
if (typeof pair.notIn !== 'undefined') {
|
|
1041
1053
|
if (!isStringArray(pair.notIn)) {
|
|
1042
|
-
|
|
1054
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`autoClosingPairs[${i}].notIn\` to be a string array.`);
|
|
1043
1055
|
continue;
|
|
1044
1056
|
}
|
|
1045
1057
|
}
|
|
@@ -1056,7 +1068,7 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
1056
1068
|
return undefined;
|
|
1057
1069
|
}
|
|
1058
1070
|
if (!Array.isArray(source)) {
|
|
1059
|
-
|
|
1071
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`surroundingPairs\` to be an array.`);
|
|
1060
1072
|
return undefined;
|
|
1061
1073
|
}
|
|
1062
1074
|
|
|
@@ -1065,22 +1077,22 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
1065
1077
|
const pair = source[i];
|
|
1066
1078
|
if (Array.isArray(pair)) {
|
|
1067
1079
|
if (!isCharacterPair(pair)) {
|
|
1068
|
-
|
|
1080
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`surroundingPairs[${i}]\` to be an array of two strings or an object.`);
|
|
1069
1081
|
continue;
|
|
1070
1082
|
}
|
|
1071
1083
|
result = result || [];
|
|
1072
1084
|
result.push({ open: pair[0], close: pair[1] });
|
|
1073
1085
|
} else {
|
|
1074
1086
|
if (!isObject(pair)) {
|
|
1075
|
-
|
|
1087
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`surroundingPairs[${i}]\` to be an array of two strings or an object.`);
|
|
1076
1088
|
continue;
|
|
1077
1089
|
}
|
|
1078
1090
|
if (typeof pair.open !== 'string') {
|
|
1079
|
-
|
|
1091
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`surroundingPairs[${i}].open\` to be a string.`);
|
|
1080
1092
|
continue;
|
|
1081
1093
|
}
|
|
1082
1094
|
if (typeof pair.close !== 'string') {
|
|
1083
|
-
|
|
1095
|
+
this.logger.warn(`[${langId}]: language configuration: expected \`surroundingPairs[${i}].close\` to be a string.`);
|
|
1084
1096
|
continue;
|
|
1085
1097
|
}
|
|
1086
1098
|
result = result || [];
|
|
@@ -105,6 +105,7 @@ export class CustomEditorOpener implements OpenHandler {
|
|
|
105
105
|
try {
|
|
106
106
|
w.viewType = this.editor.viewType;
|
|
107
107
|
w.resource = uri;
|
|
108
|
+
w.updateID();
|
|
108
109
|
await this.editorRegistry.resolveWidget(w);
|
|
109
110
|
if (options?.widgetOptions) {
|
|
110
111
|
await this.shell.addWidget(w, options.widgetOptions);
|
|
@@ -65,6 +65,10 @@ export class CustomEditorWidget extends WebviewWidget implements CustomEditorWid
|
|
|
65
65
|
}));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
updateID(): void {
|
|
69
|
+
this.id = CustomEditorWidget.FACTORY_ID + `:${this.resource.toString()}:${this.identifier.id}`;
|
|
70
|
+
}
|
|
71
|
+
|
|
68
72
|
undo(): void {
|
|
69
73
|
this._modelRef.object?.undo();
|
|
70
74
|
}
|
|
@@ -145,6 +145,8 @@ export class CustomEditorsMainImpl implements CustomEditorsMain, Disposable {
|
|
|
145
145
|
|
|
146
146
|
this.webviewsMain.hookWebview(widget);
|
|
147
147
|
widget.title.label = this.labelProvider.getName(resource);
|
|
148
|
+
widget.title.caption = resource.path.fsPath();
|
|
149
|
+
widget.title.iconClass = this.labelProvider.getIcon(resource) + ' file-icon';
|
|
148
150
|
|
|
149
151
|
const _cancellationSource = new CancellationTokenSource();
|
|
150
152
|
await this.proxy.$resolveWebviewEditor(
|
|
@@ -26,8 +26,6 @@ import {
|
|
|
26
26
|
} from '../../../common/plugin-api-rpc';
|
|
27
27
|
import { DebugSessionManager } from '@theia/debug/lib/browser/debug-session-manager';
|
|
28
28
|
import { Breakpoint, DebugStackFrameDTO, DebugThreadDTO, WorkspaceFolder } from '../../../common/plugin-api-rpc-model';
|
|
29
|
-
import { LabelProvider } from '@theia/core/lib/browser';
|
|
30
|
-
import { EditorManager } from '@theia/editor/lib/browser';
|
|
31
29
|
import { BreakpointManager, BreakpointsChangeEvent } from '@theia/debug/lib/browser/breakpoint/breakpoint-manager';
|
|
32
30
|
import { URI as Uri } from '@theia/core/shared/vscode-uri';
|
|
33
31
|
import { SourceBreakpoint, FunctionBreakpoint, BaseBreakpoint } from '@theia/debug/lib/browser/breakpoint/breakpoint-marker';
|
|
@@ -35,10 +33,6 @@ import { DebugConfiguration, DebugSessionOptions } from '@theia/debug/lib/common
|
|
|
35
33
|
import { DebuggerDescription } from '@theia/debug/lib/common/debug-service';
|
|
36
34
|
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
37
35
|
import { DebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager';
|
|
38
|
-
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
39
|
-
import { MessageClient } from '@theia/core/lib/common/message-service-protocol';
|
|
40
|
-
import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
41
|
-
import { DebugPreferences } from '@theia/debug/lib/common/debug-preferences';
|
|
42
36
|
import { PluginDebugAdapterContribution } from './plugin-debug-adapter-contribution';
|
|
43
37
|
import { PluginDebugConfigurationProvider } from './plugin-debug-configuration-provider';
|
|
44
38
|
import { PluginDebugSessionContributionRegistrator, PluginDebugSessionContributionRegistry } from './plugin-debug-session-contribution-registry';
|
|
@@ -46,17 +40,12 @@ import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposa
|
|
|
46
40
|
import { PluginDebugSessionFactory } from './plugin-debug-session-factory';
|
|
47
41
|
import { PluginDebugService } from './plugin-debug-service';
|
|
48
42
|
import { HostedPluginSupport } from '../../../hosted/browser/hosted-plugin';
|
|
49
|
-
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
50
43
|
import { ConsoleSessionManager } from '@theia/console/lib/browser/console-session-manager';
|
|
51
44
|
import { DebugConsoleSession } from '@theia/debug/lib/browser/console/debug-console-session';
|
|
52
|
-
import { CommandService, ContributionProvider } from '@theia/core/lib/common';
|
|
53
|
-
import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';
|
|
54
45
|
import { ConnectionImpl } from '../../../common/connection';
|
|
55
|
-
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
56
46
|
import { DebugSessionOptions as TheiaDebugSessionOptions } from '@theia/debug/lib/browser/debug-session-options';
|
|
57
47
|
import { DebugStackFrame } from '@theia/debug/lib/browser/model/debug-stack-frame';
|
|
58
48
|
import { DebugThread } from '@theia/debug/lib/browser/model/debug-thread';
|
|
59
|
-
import { TestService } from '@theia/test/lib/browser/test-service';
|
|
60
49
|
import { DebugBreakpoint } from '@theia/debug/lib/browser/model/debug-breakpoint';
|
|
61
50
|
|
|
62
51
|
function toOrigin<T extends BaseBreakpoint>(input: DebugBreakpoint<T>): T {
|
|
@@ -75,24 +64,14 @@ function eventToOrigins<T extends BaseBreakpoint>({ added, removed, changed, uri
|
|
|
75
64
|
export class DebugMainImpl implements DebugMain, Disposable {
|
|
76
65
|
private readonly debugExt: DebugExt;
|
|
77
66
|
|
|
67
|
+
private readonly container: interfaces.Container;
|
|
78
68
|
private readonly sessionManager: DebugSessionManager;
|
|
79
|
-
private readonly labelProvider: LabelProvider;
|
|
80
|
-
private readonly editorManager: EditorManager;
|
|
81
69
|
private readonly breakpointsManager: BreakpointManager;
|
|
82
70
|
private readonly consoleSessionManager: ConsoleSessionManager;
|
|
83
71
|
private readonly configurationManager: DebugConfigurationManager;
|
|
84
|
-
private readonly terminalService: TerminalService;
|
|
85
|
-
private readonly messages: MessageClient;
|
|
86
|
-
private readonly outputChannelManager: OutputChannelManager;
|
|
87
|
-
private readonly debugPreferences: DebugPreferences;
|
|
88
72
|
private readonly sessionContributionRegistrator: PluginDebugSessionContributionRegistrator;
|
|
89
73
|
private readonly pluginDebugService: PluginDebugService;
|
|
90
|
-
private readonly fileService: FileService;
|
|
91
74
|
private readonly pluginService: HostedPluginSupport;
|
|
92
|
-
private readonly debugContributionProvider: ContributionProvider<DebugContribution>;
|
|
93
|
-
private readonly testService: TestService;
|
|
94
|
-
private readonly workspaceService: WorkspaceService;
|
|
95
|
-
private readonly commandService: CommandService;
|
|
96
75
|
|
|
97
76
|
private readonly debuggerContributions = new Map<string, DisposableCollection>();
|
|
98
77
|
private readonly configurationProviders = new Map<number, DisposableCollection>();
|
|
@@ -100,24 +79,14 @@ export class DebugMainImpl implements DebugMain, Disposable {
|
|
|
100
79
|
|
|
101
80
|
constructor(rpc: RPCProtocol, readonly connectionMain: ConnectionImpl, container: interfaces.Container) {
|
|
102
81
|
this.debugExt = rpc.getProxy(MAIN_RPC_CONTEXT.DEBUG_EXT);
|
|
82
|
+
this.container = container;
|
|
103
83
|
this.sessionManager = container.get(DebugSessionManager);
|
|
104
|
-
this.labelProvider = container.get(LabelProvider);
|
|
105
|
-
this.editorManager = container.get(EditorManager);
|
|
106
84
|
this.breakpointsManager = container.get(BreakpointManager);
|
|
107
85
|
this.consoleSessionManager = container.get(ConsoleSessionManager);
|
|
108
86
|
this.configurationManager = container.get(DebugConfigurationManager);
|
|
109
|
-
this.terminalService = container.get(TerminalService);
|
|
110
|
-
this.messages = container.get(MessageClient);
|
|
111
|
-
this.outputChannelManager = container.get(OutputChannelManager);
|
|
112
|
-
this.debugPreferences = container.get(DebugPreferences);
|
|
113
87
|
this.pluginDebugService = container.get(PluginDebugService);
|
|
114
88
|
this.sessionContributionRegistrator = container.get(PluginDebugSessionContributionRegistry);
|
|
115
|
-
this.debugContributionProvider = container.getNamed(ContributionProvider, DebugContribution);
|
|
116
|
-
this.fileService = container.get(FileService);
|
|
117
89
|
this.pluginService = container.get(HostedPluginSupport);
|
|
118
|
-
this.testService = container.get(TestService);
|
|
119
|
-
this.workspaceService = container.get(WorkspaceService);
|
|
120
|
-
this.commandService = container.get(CommandService);
|
|
121
90
|
|
|
122
91
|
const fireDidChangeBreakpoints = ({ added, removed, changed }: BreakpointsChangeEvent<SourceBreakpoint | FunctionBreakpoint>) => {
|
|
123
92
|
this.debugExt.$breakpointsDidChange(
|
|
@@ -168,23 +137,12 @@ export class DebugMainImpl implements DebugMain, Disposable {
|
|
|
168
137
|
}
|
|
169
138
|
|
|
170
139
|
const debugSessionFactory = new PluginDebugSessionFactory(
|
|
171
|
-
this.terminalService,
|
|
172
|
-
this.editorManager,
|
|
173
|
-
this.breakpointsManager,
|
|
174
|
-
this.labelProvider,
|
|
175
|
-
this.messages,
|
|
176
|
-
this.outputChannelManager,
|
|
177
|
-
this.debugPreferences,
|
|
178
140
|
async (sessionId: string) => {
|
|
179
141
|
const connection = await this.connectionMain.ensureConnection(sessionId);
|
|
180
142
|
return connection;
|
|
181
143
|
},
|
|
182
|
-
this.fileService,
|
|
183
144
|
terminalOptionsExt,
|
|
184
|
-
this.
|
|
185
|
-
this.testService,
|
|
186
|
-
this.workspaceService,
|
|
187
|
-
this.commandService,
|
|
145
|
+
this.container,
|
|
188
146
|
);
|
|
189
147
|
|
|
190
148
|
const toDispose = new DisposableCollection(
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
import { DebuggerDescription, DebugPath, DebugService, DynamicDebugConfigurationProvider } from '@theia/debug/lib/common/debug-service';
|
|
18
18
|
import debounce = require('@theia/core/shared/lodash.debounce');
|
|
19
|
-
import { deepClone, Emitter, Event, nls } from '@theia/core';
|
|
19
|
+
import { deepClone, Emitter, Event, nls, ILogger } from '@theia/core';
|
|
20
20
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
21
21
|
import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration';
|
|
22
22
|
import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-schema';
|
|
23
23
|
import { PluginDebugAdapterContribution } from './plugin-debug-adapter-contribution';
|
|
24
24
|
import { PluginDebugConfigurationProvider } from './plugin-debug-configuration-provider';
|
|
25
|
-
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
25
|
+
import { injectable, inject, postConstruct, named } from '@theia/core/shared/inversify';
|
|
26
26
|
import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging/ws-connection-provider';
|
|
27
27
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
28
28
|
import { CommandIdVariables } from '@theia/variable-resolver/lib/common/variable-types';
|
|
@@ -64,6 +64,8 @@ export class PluginDebugService implements DebugService {
|
|
|
64
64
|
protected readonly connectionProvider: WebSocketConnectionProvider;
|
|
65
65
|
@inject(WorkspaceService)
|
|
66
66
|
protected readonly workspaceService: WorkspaceService;
|
|
67
|
+
@inject(ILogger) @named('plugin-ext:PluginDebugService')
|
|
68
|
+
protected readonly logger: ILogger;
|
|
67
69
|
|
|
68
70
|
@postConstruct()
|
|
69
71
|
protected init(): void {
|
|
@@ -84,7 +86,7 @@ export class PluginDebugService implements DebugService {
|
|
|
84
86
|
const { type } = contrib;
|
|
85
87
|
|
|
86
88
|
if (this.contributors.has(type)) {
|
|
87
|
-
|
|
89
|
+
this.logger.warn(`Debugger with type '${type}' already registered.`);
|
|
88
90
|
return Disposable.NULL;
|
|
89
91
|
}
|
|
90
92
|
|
|
@@ -105,7 +107,7 @@ export class PluginDebugService implements DebugService {
|
|
|
105
107
|
if (this.configurationProviders.has(provider.handle)) {
|
|
106
108
|
const configuration = this.configurationProviders.get(provider.handle);
|
|
107
109
|
if (configuration && configuration.type !== provider.type) {
|
|
108
|
-
|
|
110
|
+
this.logger.warn(`Different debug configuration provider with type '${configuration.type}' already registered.`);
|
|
109
111
|
provider.handle = this.configurationProviders.size;
|
|
110
112
|
}
|
|
111
113
|
}
|
|
@@ -358,7 +360,7 @@ export class PluginDebugService implements DebugService {
|
|
|
358
360
|
}
|
|
359
361
|
resolved = await resolver(workspaceFolderUri, resolved);
|
|
360
362
|
} catch (e) {
|
|
361
|
-
|
|
363
|
+
this.logger.error(e);
|
|
362
364
|
}
|
|
363
365
|
}
|
|
364
366
|
return resolved;
|