@theia/core 1.53.2 → 1.55.0-next.14

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.
Files changed (70) hide show
  1. package/README.md +9 -9
  2. package/i18n/nls.cs.json +3 -0
  3. package/i18n/nls.de.json +3 -0
  4. package/i18n/nls.es.json +3 -0
  5. package/i18n/nls.fr.json +3 -0
  6. package/i18n/nls.hu.json +3 -0
  7. package/i18n/nls.it.json +3 -0
  8. package/i18n/nls.ja.json +3 -0
  9. package/i18n/nls.json +3 -0
  10. package/i18n/nls.ko.json +3 -0
  11. package/i18n/nls.pl.json +3 -0
  12. package/i18n/nls.pt-br.json +3 -0
  13. package/i18n/nls.ru.json +3 -0
  14. package/i18n/nls.tr.json +3 -0
  15. package/i18n/nls.zh-cn.json +3 -0
  16. package/i18n/nls.zh-tw.json +3 -0
  17. package/lib/browser/authentication-service.d.ts +15 -14
  18. package/lib/browser/authentication-service.d.ts.map +1 -1
  19. package/lib/browser/authentication-service.js +5 -5
  20. package/lib/browser/authentication-service.js.map +1 -1
  21. package/lib/browser/catalog.json +274 -61
  22. package/lib/browser/core-preferences.d.ts.map +1 -1
  23. package/lib/browser/core-preferences.js +9 -0
  24. package/lib/browser/core-preferences.js.map +1 -1
  25. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  26. package/lib/browser/frontend-application-module.js +4 -0
  27. package/lib/browser/frontend-application-module.js.map +1 -1
  28. package/lib/browser/index.d.ts +1 -0
  29. package/lib/browser/index.d.ts.map +1 -1
  30. package/lib/browser/index.js +1 -0
  31. package/lib/browser/index.js.map +1 -1
  32. package/lib/browser/open-with-service.d.ts +13 -1
  33. package/lib/browser/open-with-service.d.ts.map +1 -1
  34. package/lib/browser/open-with-service.js +52 -9
  35. package/lib/browser/open-with-service.js.map +1 -1
  36. package/lib/browser/opener-service.d.ts +3 -0
  37. package/lib/browser/opener-service.d.ts.map +1 -1
  38. package/lib/browser/opener-service.js +13 -1
  39. package/lib/browser/opener-service.js.map +1 -1
  40. package/lib/browser/widget-status-bar-service.d.ts +29 -0
  41. package/lib/browser/widget-status-bar-service.d.ts.map +1 -0
  42. package/lib/browser/widget-status-bar-service.js +81 -0
  43. package/lib/browser/widget-status-bar-service.js.map +1 -0
  44. package/lib/browser/widgets/extractable-widget.js +1 -1
  45. package/lib/browser/widgets/extractable-widget.js.map +1 -1
  46. package/lib/browser/widgets/split-widget.d.ts +2 -3
  47. package/lib/browser/widgets/split-widget.d.ts.map +1 -1
  48. package/lib/browser/widgets/split-widget.js +2 -2
  49. package/lib/browser/widgets/split-widget.js.map +1 -1
  50. package/lib/common/glob.d.ts +4 -4
  51. package/lib/node/logger-cli-contribution.d.ts.map +1 -1
  52. package/lib/node/logger-cli-contribution.js +10 -8
  53. package/lib/node/logger-cli-contribution.js.map +1 -1
  54. package/package.json +8 -8
  55. package/shared/@parcel/watcher/index.d.ts +2 -0
  56. package/shared/@parcel/watcher/index.js +1 -0
  57. package/src/browser/authentication-service.ts +18 -19
  58. package/src/browser/core-preferences.ts +9 -0
  59. package/src/browser/frontend-application-module.ts +5 -0
  60. package/src/browser/index.ts +1 -0
  61. package/src/browser/open-with-service.ts +58 -7
  62. package/src/browser/opener-service.ts +13 -0
  63. package/src/browser/style/tabs.css +55 -138
  64. package/src/browser/widget-status-bar-service.ts +84 -0
  65. package/src/browser/widgets/extractable-widget.ts +1 -1
  66. package/src/browser/widgets/split-widget.ts +1 -2
  67. package/src/common/glob.ts +4 -4
  68. package/src/node/logger-cli-contribution.ts +10 -8
  69. package/shared/nsfw/index.d.ts +0 -2
  70. package/shared/nsfw/index.js +0 -1
@@ -0,0 +1,84 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { inject, injectable, named } from 'inversify';
18
+ import { Widget } from './widgets';
19
+ import { StatusBar } from './status-bar';
20
+ import { FrontendApplicationContribution } from './frontend-application-contribution';
21
+ import { ContributionProvider } from '../common';
22
+ import { FrontendApplication } from './frontend-application';
23
+
24
+ export const WidgetStatusBarContribution = Symbol('WidgetStatusBarContribution');
25
+
26
+ export interface WidgetStatusBarContribution<T extends Widget> {
27
+ canHandle(widget: Widget): widget is T;
28
+ activate(statusBar: StatusBar, widget: T): void;
29
+ deactivate(statusBar: StatusBar): void;
30
+ }
31
+
32
+ /**
33
+ * Creates an empty {@link WidgetStatusBarContribution} that does nothing.
34
+ * Useful for widgets that are not handled by any other contribution, for example:
35
+ * * Settings widget
36
+ * * Welcome widget
37
+ * * Webview widget
38
+ *
39
+ * @param prototype Prototype to identify the kind of the widget.
40
+ * @returns An empty {@link WidgetStatusBarContribution}.
41
+ */
42
+ export function noopWidgetStatusBarContribution(prototype: Function): WidgetStatusBarContribution<Widget> {
43
+ return {
44
+ canHandle(widget: Widget): widget is Widget {
45
+ return widget instanceof prototype;
46
+ },
47
+ activate: () => { },
48
+ deactivate: () => { }
49
+ };
50
+ }
51
+
52
+ @injectable()
53
+ export class WidgetStatusBarService implements FrontendApplicationContribution {
54
+
55
+ @inject(ContributionProvider) @named(WidgetStatusBarContribution)
56
+ protected readonly contributionProvider: ContributionProvider<WidgetStatusBarContribution<Widget>>;
57
+
58
+ @inject(StatusBar)
59
+ protected readonly statusBar: StatusBar;
60
+
61
+ onStart(app: FrontendApplication): void {
62
+ app.shell.onDidChangeCurrentWidget(event => {
63
+ if (event.newValue) {
64
+ this.show(event.newValue);
65
+ }
66
+ });
67
+ }
68
+
69
+ protected show(widget: Widget): void {
70
+ const contributions = this.contributionProvider.getContributions();
71
+ // If any contribution can handle the widget, activate it
72
+ // If none can, keep everything as is
73
+ if (contributions.some(contribution => contribution.canHandle(widget))) {
74
+ for (const contribution of contributions) {
75
+ // Deactivate all contributions
76
+ contribution.deactivate(this.statusBar);
77
+ if (contribution.canHandle(widget)) {
78
+ // Selectively re-activate them
79
+ contribution.activate(this.statusBar, widget);
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
@@ -28,6 +28,6 @@ export interface ExtractableWidget extends Widget {
28
28
 
29
29
  export namespace ExtractableWidget {
30
30
  export function is(widget: unknown): widget is ExtractableWidget {
31
- return widget instanceof Widget && widget.hasOwnProperty('isExtractable') && (widget as ExtractableWidget).isExtractable === true;
31
+ return widget instanceof Widget && 'isExtractable' in widget && (widget as ExtractableWidget).isExtractable === true;
32
32
  }
33
33
  }
@@ -14,12 +14,11 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { Emitter } from 'vscode-languageserver-protocol';
18
17
  import { ApplicationShell, StatefulWidget } from '../shell';
19
18
  import { BaseWidget, Message, PanelLayout, SplitPanel, Widget } from './widget';
20
19
  import { CompositeSaveable, Saveable, SaveableSource } from '../saveable';
21
20
  import { Navigatable } from '../navigatable-types';
22
- import { URI } from '../../common';
21
+ import { Emitter, URI } from '../../common';
23
22
 
24
23
  /**
25
24
  * A widget containing a number of panes in a split layout.
@@ -454,10 +454,10 @@ function toRegExp(pattern: string): ParsedStringPattern {
454
454
 
455
455
  /**
456
456
  * Simplified glob matching. Supports a subset of glob patterns:
457
- * - * matches anything inside a path segment
458
- * - ? matches 1 character inside a path segment
459
- * - ** matches anything including an empty path segment
460
- * - simple brace expansion ({js,ts} => js or ts)
457
+ * - `*` matches anything inside a path segment
458
+ * - `?` matches 1 character inside a path segment
459
+ * - `**` matches anything including an empty path segment
460
+ * - simple brace expansion (`{js,ts}` => js or ts)
461
461
  * - character ranges (using [...])
462
462
  */
463
463
  export function match(pattern: string | IRelativePattern, path: string): boolean;
@@ -19,7 +19,7 @@ import { injectable } from 'inversify';
19
19
  import { LogLevel } from '../common/logger';
20
20
  import { CliContribution } from './cli';
21
21
  import * as fs from 'fs-extra';
22
- import * as nsfw from 'nsfw';
22
+ import { subscribe } from '@parcel/watcher';
23
23
  import { Event, Emitter } from '../common/event';
24
24
  import * as path from 'path';
25
25
 
@@ -89,13 +89,17 @@ export class LogLevelCliContribution implements CliContribution {
89
89
  }
90
90
  }
91
91
 
92
- protected watchLogConfigFile(filename: string): Promise<void> {
93
- return nsfw(filename, async (events: nsfw.FileChangeEvent[]) => {
92
+ protected async watchLogConfigFile(filename: string): Promise<void> {
93
+ await subscribe(filename, async (err, events) => {
94
+ if (err) {
95
+ console.log(`Error during log file watching ${filename}: ${err}`);
96
+ return;
97
+ }
94
98
  try {
95
99
  for (const event of events) {
96
- switch (event.action) {
97
- case nsfw.actions.CREATED:
98
- case nsfw.actions.MODIFIED:
100
+ switch (event.type) {
101
+ case 'create':
102
+ case 'update':
99
103
  await this.slurpLogConfigFile(filename);
100
104
  this.logConfigChangedEvent.fire(undefined);
101
105
  break;
@@ -104,8 +108,6 @@ export class LogLevelCliContribution implements CliContribution {
104
108
  } catch (e) {
105
109
  console.error(`Error reading log config file ${filename}: ${e}`);
106
110
  }
107
- }).then((watcher: nsfw.NSFW) => {
108
- watcher.start();
109
111
  });
110
112
  }
111
113
 
@@ -1,2 +0,0 @@
1
- import nsfw = require('nsfw');
2
- export = nsfw;
@@ -1 +0,0 @@
1
- module.exports = require('nsfw');