@theia/core 1.43.1 → 1.44.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/README.md +6 -6
- package/lib/browser/common-frontend-contribution.d.ts +4 -0
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +16 -1
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +3 -0
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/icon-theme-contribution.d.ts +1 -0
- package/lib/browser/icon-theme-contribution.d.ts.map +1 -1
- package/lib/browser/icon-theme-contribution.js +1 -0
- package/lib/browser/icon-theme-contribution.js.map +1 -1
- package/lib/browser/icon-theme-service.d.ts +1 -0
- package/lib/browser/icon-theme-service.d.ts.map +1 -1
- package/lib/browser/icon-theme-service.js.map +1 -1
- package/lib/browser/language-icon-provider.d.ts +15 -0
- package/lib/browser/language-icon-provider.d.ts.map +1 -0
- package/lib/browser/language-icon-provider.js +74 -0
- package/lib/browser/language-icon-provider.js.map +1 -0
- package/lib/browser/language-service.d.ts +22 -0
- package/lib/browser/language-service.d.ts.map +1 -1
- package/lib/browser/language-service.js +28 -0
- package/lib/browser/language-service.js.map +1 -1
- package/lib/common/contribution-filter/contribution-filter.d.ts +9 -0
- package/lib/common/contribution-filter/contribution-filter.d.ts.map +1 -1
- package/lib/common/event.js +1 -1
- package/lib/common/event.js.map +1 -1
- package/lib/common/nls.js +12 -1
- package/lib/common/nls.js.map +1 -1
- package/lib/electron-browser/preload.d.ts.map +1 -1
- package/lib/electron-browser/preload.js +1 -0
- package/lib/electron-browser/preload.js.map +1 -1
- package/lib/electron-browser/window/electron-secondary-window-service.d.ts +1 -1
- package/lib/electron-browser/window/electron-secondary-window-service.d.ts.map +1 -1
- package/lib/electron-browser/window/electron-window-preferences.js +1 -1
- package/lib/electron-browser/window/electron-window-preferences.js.map +1 -1
- package/lib/electron-common/electron-api.d.ts +1 -0
- package/lib/electron-common/electron-api.d.ts.map +1 -1
- package/lib/electron-common/electron-api.js.map +1 -1
- package/lib/electron-main/electron-main-application.d.ts +2 -0
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +26 -4
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/lib/node/backend-application.d.ts +2 -0
- package/lib/node/backend-application.d.ts.map +1 -1
- package/lib/node/backend-application.js +11 -9
- package/lib/node/backend-application.js.map +1 -1
- package/lib/node/cli.d.ts +1 -1
- package/lib/node/cli.d.ts.map +1 -1
- package/lib/node/cli.js +9 -5
- package/lib/node/cli.js.map +1 -1
- package/lib/node/cli.spec.js +3 -3
- package/lib/node/cli.spec.js.map +1 -1
- package/lib/node/env-variables/env-variables-server.d.ts +3 -0
- package/lib/node/env-variables/env-variables-server.d.ts.map +1 -1
- package/lib/node/env-variables/env-variables-server.js +25 -1
- package/lib/node/env-variables/env-variables-server.js.map +1 -1
- package/lib/node/i18n/localization-server.d.ts +1 -1
- package/lib/node/i18n/localization-server.d.ts.map +1 -1
- package/lib/node/messaging/ipc-protocol.js +1 -1
- package/lib/node/messaging/ipc-protocol.js.map +1 -1
- package/package.json +6 -6
- package/src/browser/common-frontend-contribution.ts +15 -0
- package/src/browser/frontend-application-module.ts +3 -0
- package/src/browser/icon-theme-contribution.ts +1 -0
- package/src/browser/icon-theme-service.ts +1 -0
- package/src/browser/language-icon-provider.ts +55 -0
- package/src/browser/language-service.ts +34 -0
- package/src/browser/style/index.css +1 -0
- package/src/browser/style/os.css +87 -0
- package/src/common/contribution-filter/contribution-filter.ts +9 -0
- package/src/common/event.ts +1 -1
- package/src/common/i18n/nls.metadata.json +7143 -6953
- package/src/common/nls.ts +12 -1
- package/src/electron-browser/preload.ts +1 -0
- package/src/electron-browser/window/electron-secondary-window-service.ts +1 -1
- package/src/electron-browser/window/electron-window-preferences.ts +1 -1
- package/src/electron-common/electron-api.ts +1 -0
- package/src/electron-main/electron-main-application.ts +28 -5
- package/src/node/backend-application.ts +14 -11
- package/src/node/cli.spec.ts +3 -3
- package/src/node/cli.ts +9 -5
- package/src/node/env-variables/env-variables-server.ts +21 -1
- package/src/node/i18n/localization-server.ts +1 -1
- package/src/node/messaging/ipc-protocol.ts +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 EclipseSource 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, postConstruct } from 'inversify';
|
|
18
|
+
import { Emitter, Event } from '../common';
|
|
19
|
+
import { IconThemeService } from './icon-theme-service';
|
|
20
|
+
import { DidChangeLabelEvent, LabelProviderContribution } from './label-provider';
|
|
21
|
+
import { LanguageService } from './language-service';
|
|
22
|
+
|
|
23
|
+
@injectable()
|
|
24
|
+
export class LanguageIconLabelProvider implements LabelProviderContribution {
|
|
25
|
+
@inject(IconThemeService) protected readonly iconThemeService: IconThemeService;
|
|
26
|
+
@inject(LanguageService) protected readonly languageService: LanguageService;
|
|
27
|
+
|
|
28
|
+
protected readonly onDidChangeEmitter = new Emitter<DidChangeLabelEvent>();
|
|
29
|
+
|
|
30
|
+
@postConstruct()
|
|
31
|
+
protected init(): void {
|
|
32
|
+
this.languageService.onDidChangeIcon(() => this.fireDidChange());
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
canHandle(element: object): number {
|
|
36
|
+
const current = this.iconThemeService.getDefinition(this.iconThemeService.current);
|
|
37
|
+
return current?.showLanguageModeIcons === true && this.languageService.getIcon(element) ? Number.MAX_SAFE_INTEGER : 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
getIcon(element: object): string | undefined {
|
|
41
|
+
const language = this.languageService.detectLanguage(element);
|
|
42
|
+
return this.languageService.getIcon(language!.id);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get onDidChange(): Event<DidChangeLabelEvent> {
|
|
46
|
+
return this.onDidChangeEmitter.event;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected fireDidChange(): void {
|
|
50
|
+
this.onDidChangeEmitter.fire({
|
|
51
|
+
affects: element => this.canHandle(element) > 0
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
@@ -15,16 +15,19 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable } from 'inversify';
|
|
18
|
+
import { Disposable, Emitter, Event } from '../common';
|
|
18
19
|
|
|
19
20
|
export interface Language {
|
|
20
21
|
readonly id: string;
|
|
21
22
|
readonly name: string;
|
|
22
23
|
readonly extensions: Set<string>;
|
|
23
24
|
readonly filenames: Set<string>;
|
|
25
|
+
readonly iconClass?: string;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
@injectable()
|
|
27
29
|
export class LanguageService {
|
|
30
|
+
protected readonly onDidChangeIconEmitter = new Emitter<DidChangeIconEvent>();
|
|
28
31
|
|
|
29
32
|
/**
|
|
30
33
|
* It should be implemented by an extension, e.g. by the monaco extension.
|
|
@@ -40,4 +43,35 @@ export class LanguageService {
|
|
|
40
43
|
return undefined;
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
/**
|
|
47
|
+
* It should be implemented by an extension, e.g. by the monaco extension.
|
|
48
|
+
*/
|
|
49
|
+
detectLanguage(obj: unknown): Language | undefined {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* It should be implemented by an extension, e.g. by the monaco extension.
|
|
55
|
+
*/
|
|
56
|
+
registerIcon(languageId: string, iconClass: string): Disposable {
|
|
57
|
+
return Disposable.NULL;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* It should be implemented by an extension, e.g. by the monaco extension.
|
|
62
|
+
*/
|
|
63
|
+
getIcon(obj: unknown): string | undefined {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Emit when the icon of a particular language was changed.
|
|
69
|
+
*/
|
|
70
|
+
get onDidChangeIcon(): Event<DidChangeIconEvent> {
|
|
71
|
+
return this.onDidChangeIconEmitter.event;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface DidChangeIconEvent {
|
|
76
|
+
languageId: string;
|
|
43
77
|
}
|
|
@@ -322,6 +322,7 @@ button.secondary[disabled],
|
|
|
322
322
|
| Import children style files
|
|
323
323
|
|----------------------------------------------------------------------------*/
|
|
324
324
|
|
|
325
|
+
@import "./os.css";
|
|
325
326
|
@import "./dockpanel.css";
|
|
326
327
|
@import "./dialog.css";
|
|
327
328
|
@import "./menus.css";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2019 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
|
+
.mac {
|
|
18
|
+
--theia-ui-font-family: -apple-system,BlinkMacSystemFont,sans-serif
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.mac:lang(zh-Hans) {
|
|
22
|
+
--theia-ui-font-family: -apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,sans-serif
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.mac:lang(zh-Hant) {
|
|
26
|
+
--theia-ui-font-family: -apple-system,BlinkMacSystemFont,PingFang TC,sans-serif
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.mac:lang(ja) {
|
|
30
|
+
--theia-ui-font-family: -apple-system,BlinkMacSystemFont,Hiragino Kaku Gothic Pro,sans-serif
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.mac:lang(ko) {
|
|
34
|
+
--theia-ui-font-family: -apple-system,BlinkMacSystemFont,Nanum Gothic,Apple SD Gothic Neo,AppleGothic,sans-serif
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.windows {
|
|
38
|
+
--theia-ui-font-family: Segoe WPC,Segoe UI,sans-serif
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.windows:lang(zh-Hans) {
|
|
42
|
+
--theia-ui-font-family: Segoe WPC,Segoe UI,Microsoft YaHei,sans-serif
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.windows:lang(zh-Hant) {
|
|
46
|
+
--theia-ui-font-family: Segoe WPC,Segoe UI,Microsoft Jhenghei,sans-serif
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.windows:lang(ja) {
|
|
50
|
+
--theia-ui-font-family: Segoe WPC,Segoe UI,Yu Gothic UI,Meiryo UI,sans-serif
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.windows:lang(ko) {
|
|
54
|
+
--theia-ui-font-family: Segoe WPC,Segoe UI,Malgun Gothic,Dotom,sans-serif
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.linux {
|
|
58
|
+
--theia-ui-font-family: system-ui,Ubuntu,Droid Sans,sans-serif
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.linux:lang(zh-Hans) {
|
|
62
|
+
--theia-ui-font-family: system-ui,Ubuntu,Droid Sans,Source Han Sans SC,Source Han Sans CN,Source Han Sans,sans-serif
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.linux:lang(zh-Hant) {
|
|
66
|
+
--theia-ui-font-family: system-ui,Ubuntu,Droid Sans,Source Han Sans TC,Source Han Sans TW,Source Han Sans,sans-serif
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.linux:lang(ja) {
|
|
70
|
+
--theia-ui-font-family: system-ui,Ubuntu,Droid Sans,Source Han Sans J,Source Han Sans JP,Source Han Sans,sans-serif
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.linux:lang(ko) {
|
|
74
|
+
--theia-ui-font-family: system-ui,Ubuntu,Droid Sans,Source Han Sans K,Source Han Sans JR,Source Han Sans,UnDotum,FBaekmuk Gulim,sans-serif
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.mac {
|
|
78
|
+
--monaco-monospace-font: "SF Mono",Monaco,Menlo,Courier,monospace
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.windows {
|
|
82
|
+
--monaco-monospace-font: Consolas,"Courier New",monospace
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.linux {
|
|
86
|
+
--monaco-monospace-font: "Ubuntu Mono","Liberation Mono","DejaVu Sans Mono","Courier New",monospace
|
|
87
|
+
}
|
|
@@ -50,6 +50,15 @@ export const FilterContribution = Symbol('FilterContribution');
|
|
|
50
50
|
export interface FilterContribution {
|
|
51
51
|
/**
|
|
52
52
|
* Use the registry to register your contribution filters.
|
|
53
|
+
* * Note that filtering contributions based on their class (constructor) name is discouraged.
|
|
54
|
+
* Class names are minified in production builds and therefore not reliable.
|
|
55
|
+
* Use instance of checks or direct constructor comparison instead:
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* registry.addFilters('*', [
|
|
59
|
+
* contrib => !(contrib instanceof SampleFilteredCommandContribution)
|
|
60
|
+
* ]);
|
|
61
|
+
* ```
|
|
53
62
|
*/
|
|
54
63
|
registerContributionFilters(registry: ContributionFilterRegistry): void;
|
|
55
64
|
}
|
package/src/common/event.ts
CHANGED