@theia/plugin-ext 1.24.0-next.5 → 1.24.0-next.50
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/common/plugin-api-rpc-model.d.ts +1 -2
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +10 -5
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +7 -6
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js +2 -10
- package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
- package/lib/main/browser/comments/comment-glyph-widget.d.ts +1 -2
- package/lib/main/browser/comments/comment-glyph-widget.d.ts.map +1 -1
- package/lib/main/browser/comments/comment-glyph-widget.js.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.d.ts +1 -2
- package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.js +1 -0
- package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
- package/lib/main/browser/comments/comments-contribution.d.ts +1 -2
- package/lib/main/browser/comments/comments-contribution.d.ts.map +1 -1
- package/lib/main/browser/comments/comments-contribution.js +1 -0
- package/lib/main/browser/comments/comments-contribution.js.map +1 -1
- package/lib/main/browser/comments/comments-decorator.d.ts +1 -2
- package/lib/main/browser/comments/comments-decorator.d.ts.map +1 -1
- package/lib/main/browser/comments/comments-decorator.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +2 -2
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +7 -7
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/documents-main.d.ts +1 -3
- package/lib/main/browser/documents-main.d.ts.map +1 -1
- package/lib/main/browser/documents-main.js +3 -3
- package/lib/main/browser/documents-main.js.map +1 -1
- package/lib/main/browser/editor/untitled-resource.d.ts +3 -10
- package/lib/main/browser/editor/untitled-resource.d.ts.map +1 -1
- package/lib/main/browser/editor/untitled-resource.js +9 -44
- package/lib/main/browser/editor/untitled-resource.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +5 -5
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +18 -14
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +1 -3
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js +14 -17
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +4 -2
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.js +4 -2
- package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts +5 -6
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/quick-open-main.js +15 -17
- package/lib/main/browser/quick-open-main.js.map +1 -1
- package/lib/main/browser/text-editor-main.d.ts +1 -1
- package/lib/main/browser/text-editor-main.d.ts.map +1 -1
- package/lib/main/browser/text-editor-main.js +11 -9
- package/lib/main/browser/text-editor-main.js.map +1 -1
- package/lib/main/browser/text-editors-main.d.ts +2 -1
- package/lib/main/browser/text-editors-main.d.ts.map +1 -1
- package/lib/main/browser/text-editors-main.js +4 -2
- package/lib/main/browser/text-editors-main.js.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +2 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +3 -2
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +5 -0
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +19 -1
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/webview/webview-environment.d.ts +1 -1
- package/lib/main/browser/webview/webview-environment.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-environment.js +7 -2
- package/lib/main/browser/webview/webview-environment.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +4 -0
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/plugin/languages/selection-range.d.ts +2 -2
- package/lib/plugin/languages/selection-range.d.ts.map +1 -1
- package/lib/plugin/languages/selection-range.js.map +1 -1
- package/lib/plugin/languages.d.ts +1 -1
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/languages.js +6 -2
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/node/debug/debug.d.ts +2 -2
- package/lib/plugin/node/debug/debug.d.ts.map +1 -1
- package/lib/plugin/node/debug/debug.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +2 -2
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/quick-open.d.ts +6 -8
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/quick-open.js +16 -11
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +18 -21
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/webviews.js +3 -3
- package/lib/plugin/webviews.js.map +1 -1
- package/package.json +24 -23
- package/src/common/plugin-api-rpc-model.ts +1 -0
- package/src/common/plugin-api-rpc.ts +12 -5
- package/src/hosted/browser/hosted-plugin.ts +8 -6
- package/src/hosted/node/hosted-plugin-deployer-handler.ts +2 -10
- package/src/main/browser/comments/comment-glyph-widget.ts +1 -0
- package/src/main/browser/comments/comment-thread-widget.tsx +1 -0
- package/src/main/browser/comments/comments-contribution.ts +1 -0
- package/src/main/browser/comments/comments-decorator.ts +1 -0
- package/src/main/browser/custom-editors/custom-editors-main.ts +9 -9
- package/src/main/browser/documents-main.ts +2 -3
- package/src/main/browser/editor/untitled-resource.ts +11 -45
- package/src/main/browser/editors-and-documents-main.ts +1 -0
- package/src/main/browser/languages-main.ts +63 -43
- package/src/main/browser/main-context.ts +1 -3
- package/src/main/browser/menus/menus-contribution-handler.ts +18 -19
- package/src/main/browser/plugin-contribution-handler.ts +4 -2
- package/src/main/browser/plugin-icon-theme-service.ts +4 -2
- package/src/main/browser/quick-open-main.ts +23 -24
- package/src/main/browser/style/tree.css +4 -0
- package/src/main/browser/text-editor-main.ts +12 -14
- package/src/main/browser/text-editors-main.ts +6 -3
- package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +2 -1
- package/src/main/browser/view/plugin-view-registry.ts +3 -3
- package/src/main/browser/view/tree-view-widget.tsx +21 -3
- package/src/main/browser/webview/webview-environment.ts +8 -2
- package/src/main/browser/webview/webview.ts +4 -0
- package/src/plugin/languages/selection-range.ts +2 -1
- package/src/plugin/languages.ts +8 -2
- package/src/plugin/node/debug/debug.ts +2 -2
- package/src/plugin/plugin-context.ts +5 -4
- package/src/plugin/quick-open.ts +21 -16
- package/src/plugin/type-converters.ts +17 -23
- package/src/plugin/webviews.ts +3 -3
- package/src/typings/monaco/index.d.ts +0 -20
|
@@ -518,13 +518,26 @@ export class MenusContributionPointHandler {
|
|
|
518
518
|
}
|
|
519
519
|
const toDispose = new DisposableCollection();
|
|
520
520
|
const commandId = this.createSyntheticCommandId(menu.command, { prefix: '__plugin.menu.action.' });
|
|
521
|
+
const altId = menu.alt && this.createSyntheticCommandId(menu.alt, { prefix: '__plugin.menu.action.' });
|
|
522
|
+
|
|
523
|
+
const inline = Boolean(menu.group && /^inline/.test(menu.group));
|
|
524
|
+
const [group, order = undefined] = (menu.group || '_').split('@');
|
|
525
|
+
|
|
521
526
|
const command: Command = { id: commandId };
|
|
527
|
+
const action: MenuAction = { commandId, alt: altId, order, when: menu.when };
|
|
528
|
+
|
|
522
529
|
toDispose.push(this.commands.registerCommand(command, handler(menu.command)));
|
|
523
530
|
toDispose.push(this.quickCommandService?.pushCommandContext(commandId, 'false'));
|
|
531
|
+
toDispose.push(this.menuRegistry.registerMenuAction(inline ? menuPath : [...menuPath, ...group.split('/')], action));
|
|
532
|
+
toDispose.push(this.onDidRegisterCommand(menu.command, pluginCommand => {
|
|
533
|
+
command.category = pluginCommand.category;
|
|
534
|
+
command.label = pluginCommand.label;
|
|
535
|
+
if (inline) {
|
|
536
|
+
command.iconClass = pluginCommand.iconClass;
|
|
537
|
+
}
|
|
538
|
+
}));
|
|
524
539
|
|
|
525
|
-
|
|
526
|
-
if (menu.alt) {
|
|
527
|
-
altId = this.createSyntheticCommandId(menu.alt, { prefix: '__plugin.menu.action.' });
|
|
540
|
+
if (menu.alt && altId) {
|
|
528
541
|
const alt: Command = { id: altId };
|
|
529
542
|
toDispose.push(this.commands.registerCommand(alt, handler(menu.alt)));
|
|
530
543
|
toDispose.push(this.quickCommandService?.pushCommandContext(altId, 'false'));
|
|
@@ -537,13 +550,9 @@ export class MenusContributionPointHandler {
|
|
|
537
550
|
}));
|
|
538
551
|
}
|
|
539
552
|
|
|
540
|
-
const { when } = menu;
|
|
541
|
-
const [group, order = undefined] = (menu.group || '_').split('@');
|
|
542
|
-
const action: MenuAction = { commandId, alt: altId, order, when };
|
|
543
|
-
|
|
544
553
|
// Register a submenu if the group is in format `<submenu group>/<submenu name>/<submenu order>.../<menu group>`
|
|
545
|
-
if (group
|
|
546
|
-
const groupSplit = group
|
|
554
|
+
if (group.includes('/')) {
|
|
555
|
+
const groupSplit = group.split('/');
|
|
547
556
|
const orderSplit = (menu.submenusOrder || '').split('/');
|
|
548
557
|
const paths: string[] = [];
|
|
549
558
|
for (let i = 0, j = 0; i < groupSplit.length - 1; i += 2, j += 1) {
|
|
@@ -554,17 +563,7 @@ export class MenusContributionPointHandler {
|
|
|
554
563
|
toDispose.push(this.menuRegistry.registerSubmenu([...menuPath, ...paths], submenuLabel, { order: submenuOrder }));
|
|
555
564
|
}
|
|
556
565
|
}
|
|
557
|
-
const inline = /^inline/.test(group);
|
|
558
|
-
menuPath = inline ? menuPath : [...menuPath, ...group.split('/')];
|
|
559
|
-
toDispose.push(this.menuRegistry.registerMenuAction(menuPath, action));
|
|
560
566
|
|
|
561
|
-
toDispose.push(this.onDidRegisterCommand(menu.command, pluginCommand => {
|
|
562
|
-
command.category = pluginCommand.category;
|
|
563
|
-
command.label = pluginCommand.label;
|
|
564
|
-
if (inline) {
|
|
565
|
-
command.iconClass = pluginCommand.iconClass;
|
|
566
|
-
}
|
|
567
|
-
}));
|
|
568
567
|
return toDispose;
|
|
569
568
|
}
|
|
570
569
|
|
|
@@ -40,6 +40,8 @@ import { MonacoThemingService } from '@theia/monaco/lib/browser/monaco-theming-s
|
|
|
40
40
|
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
41
41
|
import { PluginIconThemeService } from './plugin-icon-theme-service';
|
|
42
42
|
import { ContributionProvider } from '@theia/core/lib/common';
|
|
43
|
+
import * as monaco from '@theia/monaco-editor-core';
|
|
44
|
+
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
43
45
|
|
|
44
46
|
@injectable()
|
|
45
47
|
export class PluginContributionHandler {
|
|
@@ -360,13 +362,13 @@ export class PluginContributionHandler {
|
|
|
360
362
|
const toDispose = new DisposableCollection();
|
|
361
363
|
for (const { iconUrl, themeIcon, command, category, title, originalTitle } of contribution.commands) {
|
|
362
364
|
const reference = iconUrl && this.style.toIconClass(iconUrl);
|
|
363
|
-
const icon = themeIcon &&
|
|
365
|
+
const icon = themeIcon && ThemeIcon.fromString(themeIcon);
|
|
364
366
|
let iconClass;
|
|
365
367
|
if (reference) {
|
|
366
368
|
toDispose.push(reference);
|
|
367
369
|
iconClass = reference.object.iconClass;
|
|
368
370
|
} else if (icon) {
|
|
369
|
-
iconClass =
|
|
371
|
+
iconClass = ThemeIcon.asClassName(icon);
|
|
370
372
|
}
|
|
371
373
|
toDispose.push(this.registerCommand({ id: command, category, label: title, originalLabel: originalTitle, iconClass }));
|
|
372
374
|
}
|
|
@@ -37,6 +37,8 @@ import { Endpoint } from '@theia/core/lib/browser/endpoint';
|
|
|
37
37
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
38
38
|
import { FileStat, FileChangeType } from '@theia/filesystem/lib/common/files';
|
|
39
39
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
40
|
+
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
41
|
+
import { ILanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/languages/language';
|
|
40
42
|
|
|
41
43
|
export interface PluginIconDefinition {
|
|
42
44
|
iconPath: string;
|
|
@@ -519,8 +521,8 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh
|
|
|
519
521
|
} else {
|
|
520
522
|
classNames.unshift(this.fileIcon);
|
|
521
523
|
}
|
|
522
|
-
const language =
|
|
523
|
-
classNames.push(this.languageIcon(language.
|
|
524
|
+
const language = StandaloneServices.get(ILanguageService).createByFilepathOrFirstLine(parsedURI['codeUri']);
|
|
525
|
+
classNames.push(this.languageIcon(language.languageId));
|
|
524
526
|
}
|
|
525
527
|
return classNames;
|
|
526
528
|
}
|
|
@@ -25,7 +25,8 @@ import {
|
|
|
25
25
|
TransferInputBox,
|
|
26
26
|
TransferQuickPickItems,
|
|
27
27
|
TransferQuickInput,
|
|
28
|
-
TransferQuickInputButton
|
|
28
|
+
TransferQuickInputButton,
|
|
29
|
+
TransferQuickPickItemValue
|
|
29
30
|
} from '../../common/plugin-api-rpc';
|
|
30
31
|
import {
|
|
31
32
|
InputOptions,
|
|
@@ -37,12 +38,14 @@ import {
|
|
|
37
38
|
import { DisposableCollection, Disposable } from '@theia/core/lib/common/disposable';
|
|
38
39
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
39
40
|
import { MonacoQuickInputService } from '@theia/monaco/lib/browser/monaco-quick-input-service';
|
|
40
|
-
import * as theia from '@theia/plugin';
|
|
41
41
|
import { QuickInputButtons } from '../../plugin/types-impl';
|
|
42
42
|
import { getIconUris } from '../../plugin/quick-open';
|
|
43
|
+
import * as monaco from '@theia/monaco-editor-core';
|
|
44
|
+
import { IQuickPickItem, IQuickInput } from '@theia/monaco-editor-core/esm/vs/base/parts/quickinput/common/quickInput';
|
|
45
|
+
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
43
46
|
|
|
44
47
|
export interface QuickInputSession {
|
|
45
|
-
input:
|
|
48
|
+
input: IQuickInput;
|
|
46
49
|
handlesToItems: Map<number, TransferQuickPickItems>;
|
|
47
50
|
}
|
|
48
51
|
|
|
@@ -68,7 +71,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
68
71
|
this.toDispose.dispose();
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
async $show(instance: number, options: PickOptions<
|
|
74
|
+
async $show(instance: number, options: PickOptions<TransferQuickPickItemValue>, token: CancellationToken): Promise<number | number[] | undefined> {
|
|
72
75
|
const contents = new Promise<TransferQuickPickItems[]>((resolve, reject) => {
|
|
73
76
|
this.items[instance] = { resolve, reject };
|
|
74
77
|
});
|
|
@@ -82,21 +85,14 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
82
85
|
}
|
|
83
86
|
};
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
});
|
|
92
|
-
} else {
|
|
93
|
-
return this.delegate.pick(contents, options, token).then(item => {
|
|
94
|
-
if (item) {
|
|
95
|
-
return item.handle;
|
|
96
|
-
}
|
|
97
|
-
return undefined;
|
|
98
|
-
});
|
|
88
|
+
const result = await this.delegate.pick<TransferQuickPickItemValue>(contents, options, token);
|
|
89
|
+
|
|
90
|
+
if (Array.isArray(result)) {
|
|
91
|
+
return result.map(({ handle }) => handle);
|
|
92
|
+
} else if (result) {
|
|
93
|
+
return result.handle;
|
|
99
94
|
}
|
|
95
|
+
return undefined;
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
$setItems(instance: number, items: TransferQuickPickItems[]): Promise<any> {
|
|
@@ -194,19 +190,20 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
194
190
|
|
|
195
191
|
private sessions = new Map<number, QuickInputSession>();
|
|
196
192
|
|
|
197
|
-
$createOrUpdate
|
|
193
|
+
$createOrUpdate(params: TransferQuickInput): Promise<void> {
|
|
198
194
|
const sessionId = params.id;
|
|
199
|
-
let session
|
|
200
|
-
|
|
195
|
+
let session: QuickInputSession;
|
|
196
|
+
const candidate = this.sessions.get(sessionId);
|
|
197
|
+
if (!candidate) {
|
|
201
198
|
if (params.type === 'quickPick') {
|
|
202
199
|
const quickPick = this.quickInputService.createQuickPick();
|
|
203
200
|
quickPick.onDidAccept(() => {
|
|
204
201
|
this.proxy.$acceptOnDidAccept(sessionId);
|
|
205
202
|
});
|
|
206
|
-
quickPick.onDidChangeActive((items: Array<
|
|
203
|
+
quickPick.onDidChangeActive((items: Array<IQuickPickItem>) => {
|
|
207
204
|
this.proxy.$onDidChangeActive(sessionId, items.map(item => (item as TransferQuickPickItems).handle));
|
|
208
205
|
});
|
|
209
|
-
quickPick.onDidChangeSelection((items: Array<
|
|
206
|
+
quickPick.onDidChangeSelection((items: Array<IQuickPickItem>) => {
|
|
210
207
|
this.proxy.$onDidChangeSelection(sessionId, items.map(item => (item as TransferQuickPickItems).handle));
|
|
211
208
|
});
|
|
212
209
|
quickPick.onDidTriggerButton((button: QuickInputButtonHandle) => {
|
|
@@ -242,6 +239,8 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
242
239
|
};
|
|
243
240
|
}
|
|
244
241
|
this.sessions.set(sessionId, session);
|
|
242
|
+
} else {
|
|
243
|
+
session = candidate;
|
|
245
244
|
}
|
|
246
245
|
if (session) {
|
|
247
246
|
const { input, handlesToItems } = session;
|
|
@@ -273,7 +272,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
273
272
|
const { iconPath, tooltip, handle } = button;
|
|
274
273
|
if ('id' in iconPath) {
|
|
275
274
|
return {
|
|
276
|
-
iconClass:
|
|
275
|
+
iconClass: ThemeIcon.asClassName(iconPath),
|
|
277
276
|
tooltip,
|
|
278
277
|
handle
|
|
279
278
|
};
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
+
import * as monaco from '@theia/monaco-editor-core';
|
|
18
|
+
import { StandaloneCodeEditor } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor';
|
|
17
19
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
18
20
|
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
|
|
19
21
|
import {
|
|
@@ -84,23 +86,23 @@ export class TextEditorMain implements Disposable {
|
|
|
84
86
|
this.toDisposeOnEditor.push(Disposable.create(() => this.editor = undefined));
|
|
85
87
|
|
|
86
88
|
if (this.editor) {
|
|
87
|
-
const
|
|
89
|
+
const monacoEditor = this.editor.getControl();
|
|
88
90
|
this.toDisposeOnEditor.push(this.editor.onSelectionChanged(_ => {
|
|
89
91
|
this.updateProperties();
|
|
90
92
|
}));
|
|
91
|
-
this.toDisposeOnEditor.push(
|
|
93
|
+
this.toDisposeOnEditor.push(monacoEditor.onDidChangeModel(() => {
|
|
92
94
|
this.setEditor(undefined);
|
|
93
95
|
}));
|
|
94
|
-
this.toDisposeOnEditor.push(
|
|
96
|
+
this.toDisposeOnEditor.push(monacoEditor.onDidChangeCursorSelection(e => {
|
|
95
97
|
this.updateProperties(e.source);
|
|
96
98
|
}));
|
|
97
|
-
this.toDisposeOnEditor.push(
|
|
99
|
+
this.toDisposeOnEditor.push(monacoEditor.onDidChangeConfiguration(() => {
|
|
98
100
|
this.updateProperties();
|
|
99
101
|
}));
|
|
100
|
-
this.toDisposeOnEditor.push(
|
|
102
|
+
this.toDisposeOnEditor.push(monacoEditor.onDidLayoutChange(() => {
|
|
101
103
|
this.updateProperties();
|
|
102
104
|
}));
|
|
103
|
-
this.toDisposeOnEditor.push(
|
|
105
|
+
this.toDisposeOnEditor.push(monacoEditor.onDidScrollChange(() => {
|
|
104
106
|
this.updateProperties();
|
|
105
107
|
}));
|
|
106
108
|
|
|
@@ -263,12 +265,9 @@ export class TextEditorMain implements Disposable {
|
|
|
263
265
|
}
|
|
264
266
|
|
|
265
267
|
insertSnippet(template: string, ranges: Range[], opts: UndoStopOptions): boolean {
|
|
268
|
+
const snippetController: SnippetController2 | null | undefined = this.editor?.getControl().getContribution('snippetController2');
|
|
266
269
|
|
|
267
|
-
if (!this.editor) {
|
|
268
|
-
return false;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
const snippetController: SnippetController2 = this.editor!.getControl().getContribution('snippetController2');
|
|
270
|
+
if (!snippetController || !this.editor) { return false; }
|
|
272
271
|
|
|
273
272
|
const selections = ranges.map(r => new monaco.Selection(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn));
|
|
274
273
|
this.editor.getControl().setSelections(selections);
|
|
@@ -283,7 +282,7 @@ export class TextEditorMain implements Disposable {
|
|
|
283
282
|
if (!this.editor) {
|
|
284
283
|
return;
|
|
285
284
|
}
|
|
286
|
-
this.editor.getControl().setDecorations(key, ranges.map(option => Object.assign(option, { color: undefined })));
|
|
285
|
+
(this.editor.getControl() as unknown as StandaloneCodeEditor).setDecorations('Plugin decorations', key, ranges.map(option => Object.assign(option, { color: undefined })));
|
|
287
286
|
}
|
|
288
287
|
|
|
289
288
|
setDecorationsFast(key: string, _ranges: number[]): void {
|
|
@@ -295,8 +294,7 @@ export class TextEditorMain implements Disposable {
|
|
|
295
294
|
for (let i = 0; i < len; i++) {
|
|
296
295
|
ranges[i] = new monaco.Range(_ranges[4 * i], _ranges[4 * i + 1], _ranges[4 * i + 2], _ranges[4 * i + 3]);
|
|
297
296
|
}
|
|
298
|
-
|
|
299
|
-
this.editor.getControl().setDecorationsFast(key, ranges);
|
|
297
|
+
(this.editor.getControl() as unknown as StandaloneCodeEditor).setDecorationsFast(key, ranges);
|
|
300
298
|
}
|
|
301
299
|
|
|
302
300
|
private static toMonacoSelections(selection: Selection): monaco.Selection {
|
|
@@ -41,6 +41,9 @@ import { MonacoBulkEditService } from '@theia/monaco/lib/browser/monaco-bulk-edi
|
|
|
41
41
|
import { MonacoEditorService } from '@theia/monaco/lib/browser/monaco-editor-service';
|
|
42
42
|
import { theiaUritoUriComponents, UriComponents } from '../../common/uri-components';
|
|
43
43
|
import { Endpoint } from '@theia/core/lib/browser/endpoint';
|
|
44
|
+
import * as monaco from '@theia/monaco-editor-core';
|
|
45
|
+
import { ResourceEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
|
|
46
|
+
import { IDecorationRenderOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/editorCommon';
|
|
44
47
|
|
|
45
48
|
export class TextEditorsMainImpl implements TextEditorsMain, Disposable {
|
|
46
49
|
|
|
@@ -120,7 +123,7 @@ export class TextEditorsMainImpl implements TextEditorsMain, Disposable {
|
|
|
120
123
|
async $tryApplyWorkspaceEdit(dto: WorkspaceEditDto): Promise<boolean> {
|
|
121
124
|
const workspaceEdit = toMonacoWorkspaceEdit(dto);
|
|
122
125
|
try {
|
|
123
|
-
const edits =
|
|
126
|
+
const edits = ResourceEdit.convert(workspaceEdit);
|
|
124
127
|
const { success } = await this.bulkEditService.apply(edits);
|
|
125
128
|
return success;
|
|
126
129
|
} catch {
|
|
@@ -135,9 +138,9 @@ export class TextEditorsMainImpl implements TextEditorsMain, Disposable {
|
|
|
135
138
|
return Promise.resolve(this.editorsAndDocuments.getEditor(id)!.insertSnippet(template, ranges, opts));
|
|
136
139
|
}
|
|
137
140
|
|
|
138
|
-
$registerTextEditorDecorationType(key: string, options: DecorationRenderOptions): void {
|
|
141
|
+
$registerTextEditorDecorationType(key: string, options: DecorationRenderOptions | IDecorationRenderOptions): void {
|
|
139
142
|
this.injectRemoteUris(options);
|
|
140
|
-
this.monacoEditorService.registerDecorationType(key, options);
|
|
143
|
+
this.monacoEditorService.registerDecorationType('Plugin decoration', key, options as IDecorationRenderOptions);
|
|
141
144
|
this.toDispose.push(Disposable.create(() => this.$removeTextEditorDecorationType(key)));
|
|
142
145
|
}
|
|
143
146
|
|
|
@@ -20,6 +20,7 @@ import { LabelProviderContribution, LabelProvider, URIIconReference } from '@the
|
|
|
20
20
|
import { TreeLabelProvider } from '@theia/core/lib/browser/tree/tree-label-provider';
|
|
21
21
|
import { TreeViewNode } from './tree-view-widget';
|
|
22
22
|
import { TreeNode } from '@theia/core/lib/browser/tree/tree';
|
|
23
|
+
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
23
24
|
|
|
24
25
|
@injectable()
|
|
25
26
|
export class PluginTreeViewNodeLabelProvider implements LabelProviderContribution {
|
|
@@ -47,7 +48,7 @@ export class PluginTreeViewNodeLabelProvider implements LabelProviderContributio
|
|
|
47
48
|
const uri = node.resourceUri && new URI(node.resourceUri) || undefined;
|
|
48
49
|
return this.labelProvider.getIcon(URIIconReference.create(node.themeIconId, uri));
|
|
49
50
|
}
|
|
50
|
-
return
|
|
51
|
+
return ThemeIcon.asClassName({ id: node.themeIconId });
|
|
51
52
|
}
|
|
52
53
|
if (node.resourceUri) {
|
|
53
54
|
return this.labelProvider.getIcon(new URI(node.resourceUri));
|
|
@@ -40,7 +40,7 @@ import { DebugConsoleContribution } from '@theia/debug/lib/browser/console/debug
|
|
|
40
40
|
import { TERMINAL_WIDGET_FACTORY_ID } from '@theia/terminal/lib/browser/terminal-widget-impl';
|
|
41
41
|
import { TreeViewWidget } from './tree-view-widget';
|
|
42
42
|
import { SEARCH_VIEW_CONTAINER_ID } from '@theia/search-in-workspace/lib/browser/search-in-workspace-factory';
|
|
43
|
-
|
|
43
|
+
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
44
44
|
import { WebviewView, WebviewViewResolver } from '../webview-views/webview-views';
|
|
45
45
|
import { WebviewWidget, WebviewWidgetIdentifier } from '../webview/webview';
|
|
46
46
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
@@ -229,9 +229,9 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
229
229
|
const iconClass = 'plugin-view-container-icon-' + viewContainer.id;
|
|
230
230
|
|
|
231
231
|
if (viewContainer.themeIcon) {
|
|
232
|
-
const icon =
|
|
232
|
+
const icon = ThemeIcon.fromString(viewContainer.themeIcon);
|
|
233
233
|
if (icon) {
|
|
234
|
-
themeIconClass =
|
|
234
|
+
themeIconClass = ThemeIcon.asClassName(icon) ?? '';
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import { MenuPath, MenuModelRegistry, ActionMenuNode } from '@theia/core/lib/common/menu';
|
|
37
37
|
import * as React from '@theia/core/shared/react';
|
|
38
38
|
import { PluginSharedStyle } from '../plugin-shared-style';
|
|
39
|
-
import { ACTION_ITEM, Widget } from '@theia/core/lib/browser/widgets/widget';
|
|
39
|
+
import { ACTION_ITEM, codicon, Widget } from '@theia/core/lib/browser/widgets/widget';
|
|
40
40
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
41
41
|
import { MessageService } from '@theia/core/lib/common/message-service';
|
|
42
42
|
import { View } from '../../../common/plugin-protocol';
|
|
@@ -44,6 +44,7 @@ import CoreURI from '@theia/core/lib/common/uri';
|
|
|
44
44
|
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
45
45
|
import * as markdownit from '@theia/core/shared/markdown-it';
|
|
46
46
|
import { isMarkdownString } from '../../../plugin/markdown-string';
|
|
47
|
+
import { LabelParser } from '@theia/core/lib/browser/label-parser';
|
|
47
48
|
|
|
48
49
|
export const TREE_NODE_HYPERLINK = 'theia-TreeNodeHyperlink';
|
|
49
50
|
export const VIEW_ITEM_CONTEXT_MENU: MenuPath = ['view-item-context-menu'];
|
|
@@ -250,18 +251,35 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
250
251
|
@inject(TooltipService)
|
|
251
252
|
protected readonly tooltipService: TooltipService;
|
|
252
253
|
|
|
254
|
+
@inject(LabelParser)
|
|
255
|
+
protected readonly labelParser: LabelParser;
|
|
256
|
+
|
|
257
|
+
protected readonly markdownIt = markdownit();
|
|
258
|
+
|
|
253
259
|
@postConstruct()
|
|
254
260
|
protected override init(): void {
|
|
255
261
|
super.init();
|
|
256
262
|
this.id = this.identifier.id;
|
|
257
263
|
this.addClass('theia-tree-view');
|
|
258
264
|
this.node.style.height = '100%';
|
|
259
|
-
|
|
265
|
+
this.markdownItPlugin();
|
|
260
266
|
this.model.onDidChangeWelcomeState(this.update, this);
|
|
261
267
|
this.toDispose.push(this.model.onDidChangeWelcomeState(this.update, this));
|
|
262
268
|
this.toDispose.push(this.onDidChangeVisibilityEmitter);
|
|
263
269
|
}
|
|
264
270
|
|
|
271
|
+
protected markdownItPlugin(): void {
|
|
272
|
+
this.markdownIt.renderer.rules.text = (tokens, idx) => {
|
|
273
|
+
const content = tokens[idx].content;
|
|
274
|
+
return this.labelParser.parse(content).map(chunk => {
|
|
275
|
+
if (typeof chunk === 'string') {
|
|
276
|
+
return chunk;
|
|
277
|
+
}
|
|
278
|
+
return `<i class="${codicon(chunk.name)} ${chunk.animation ? `fa-${chunk.animation}` : ''} icon-inline"></i>`;
|
|
279
|
+
}).join('');
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
265
283
|
protected override renderIcon(node: TreeNode, props: NodeProps): React.ReactNode {
|
|
266
284
|
const icon = this.toNodeIcon(node);
|
|
267
285
|
if (icon) {
|
|
@@ -285,7 +303,7 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
285
303
|
|
|
286
304
|
if (node.tooltip && isMarkdownString(node.tooltip)) {
|
|
287
305
|
// Render markdown in custom tooltip
|
|
288
|
-
const tooltip =
|
|
306
|
+
const tooltip = this.markdownIt.render(node.tooltip.value);
|
|
289
307
|
|
|
290
308
|
attrs = {
|
|
291
309
|
...attrs,
|
|
@@ -60,8 +60,14 @@ export class WebviewEnvironment {
|
|
|
60
60
|
return (await this.externalEndpointUrl()).toString(true);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
async resourceRoot(): Promise<string> {
|
|
64
|
-
|
|
63
|
+
async resourceRoot(host: string): Promise<string> {
|
|
64
|
+
if (host === 'frontend') {
|
|
65
|
+
return (await this.externalEndpointUrl()).withPath('{{path}}').toString(true);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Make sure we preserve the scheme of the resource but convert it into a normal path segment
|
|
69
|
+
// The scheme is important as we need to know if we are requesting a local or a remote resource.
|
|
70
|
+
return (await this.externalEndpointUrl()).resolve('theia-resource/{{scheme}}//{{authority}}/{{path}}').toString(true);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
async cspSource(): Promise<string> {
|
|
@@ -44,6 +44,7 @@ import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
|
44
44
|
import { WebviewPreferences } from './webview-preferences';
|
|
45
45
|
import { WebviewResourceCache } from './webview-resource-cache';
|
|
46
46
|
import { Endpoint } from '@theia/core/lib/browser/endpoint';
|
|
47
|
+
import { isFirefox } from '@theia/core/lib/browser/browser';
|
|
47
48
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
48
49
|
import { FileOperationError, FileOperationResult } from '@theia/filesystem/lib/common/files';
|
|
49
50
|
import { BinaryBufferReadableStream } from '@theia/core/lib/common/buffer';
|
|
@@ -250,6 +251,9 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget {
|
|
|
250
251
|
const element = document.createElement('iframe');
|
|
251
252
|
element.className = 'webview';
|
|
252
253
|
element.sandbox.add('allow-scripts', 'allow-forms', 'allow-same-origin', 'allow-downloads');
|
|
254
|
+
if (!isFirefox) {
|
|
255
|
+
element.setAttribute('allow', 'clipboard-read; clipboard-write; usb; serial; hid;');
|
|
256
|
+
}
|
|
253
257
|
element.setAttribute('src', `${this.externalEndpoint}/index.html?id=${this.identifier.id}`);
|
|
254
258
|
element.style.border = 'none';
|
|
255
259
|
element.style.width = '100%';
|
|
@@ -26,6 +26,7 @@ import { URI } from '@theia/core/shared/vscode-uri';
|
|
|
26
26
|
import * as model from '../../common/plugin-api-rpc-model';
|
|
27
27
|
import * as Converter from '../type-converters';
|
|
28
28
|
import * as types from '../types-impl';
|
|
29
|
+
import { Position } from '../../common/plugin-api-rpc';
|
|
29
30
|
|
|
30
31
|
export class SelectionRangeProviderAdapter {
|
|
31
32
|
|
|
@@ -34,7 +35,7 @@ export class SelectionRangeProviderAdapter {
|
|
|
34
35
|
private readonly documents: DocumentsExtImpl
|
|
35
36
|
) { }
|
|
36
37
|
|
|
37
|
-
provideSelectionRanges(resource: URI, position:
|
|
38
|
+
provideSelectionRanges(resource: URI, position: Position[], token: theia.CancellationToken): Promise<model.SelectionRange[][]> {
|
|
38
39
|
const documentData = this.documents.getDocumentData(resource);
|
|
39
40
|
|
|
40
41
|
if (!documentData) {
|
package/src/plugin/languages.ts
CHANGED
|
@@ -531,9 +531,11 @@ export class LanguagesExtImpl implements LanguagesExt {
|
|
|
531
531
|
// ### Code Reference Provider end
|
|
532
532
|
|
|
533
533
|
// ### Document Symbol Provider begin
|
|
534
|
-
registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider, pluginInfo: PluginInfo
|
|
534
|
+
registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider, pluginInfo: PluginInfo,
|
|
535
|
+
metadata?: theia.DocumentSymbolProviderMetadata): theia.Disposable {
|
|
535
536
|
const callId = this.addNewAdapter(new OutlineAdapter(this.documents, provider));
|
|
536
|
-
|
|
537
|
+
const displayName = (metadata && metadata.label) || getPluginLabel(pluginInfo);
|
|
538
|
+
this.proxy.$registerOutlineSupport(callId, pluginInfo, this.transformDocumentSelector(selector), displayName);
|
|
537
539
|
return this.createDisposable(callId);
|
|
538
540
|
}
|
|
539
541
|
|
|
@@ -700,3 +702,7 @@ function serializeIndentation(indentationRules?: theia.IndentationRule): Seriali
|
|
|
700
702
|
unIndentedLinePattern: serializeRegExp(indentationRules.unIndentedLinePattern)
|
|
701
703
|
};
|
|
702
704
|
}
|
|
705
|
+
|
|
706
|
+
function getPluginLabel(pluginInfo: PluginInfo): string {
|
|
707
|
+
return pluginInfo.displayName || pluginInfo.name;
|
|
708
|
+
}
|
|
@@ -132,7 +132,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
132
132
|
return this.onDidChangeBreakpointsEmitter.event;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
addBreakpoints(breakpoints: theia.Breakpoint[]): void {
|
|
135
|
+
addBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
|
|
136
136
|
const added: theia.Breakpoint[] = [];
|
|
137
137
|
for (const b of breakpoints) {
|
|
138
138
|
if (this._breakpoints.has(b.id)) {
|
|
@@ -147,7 +147,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
removeBreakpoints(breakpoints: theia.Breakpoint[]): void {
|
|
150
|
+
removeBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
|
|
151
151
|
const removed: theia.Breakpoint[] = [];
|
|
152
152
|
const removedIds: string[] = [];
|
|
153
153
|
for (const b of breakpoints) {
|
|
@@ -752,8 +752,9 @@ export function createAPIFactory(
|
|
|
752
752
|
registerReferenceProvider(selector: theia.DocumentSelector, provider: theia.ReferenceProvider): theia.Disposable {
|
|
753
753
|
return languagesExt.registerReferenceProvider(selector, provider, pluginToPluginInfo(plugin));
|
|
754
754
|
},
|
|
755
|
-
registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider
|
|
756
|
-
|
|
755
|
+
registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider,
|
|
756
|
+
metadata?: theia.DocumentSymbolProviderMetadata): theia.Disposable {
|
|
757
|
+
return languagesExt.registerDocumentSymbolProvider(selector, provider, pluginToPluginInfo(plugin), metadata);
|
|
757
758
|
},
|
|
758
759
|
registerColorProvider(selector: theia.DocumentSelector, provider: theia.DocumentColorProvider): theia.Disposable {
|
|
759
760
|
return languagesExt.registerColorProvider(selector, provider, pluginToPluginInfo(plugin));
|
|
@@ -852,10 +853,10 @@ export function createAPIFactory(
|
|
|
852
853
|
stopDebugging(session?: theia.DebugSession): Thenable<void> {
|
|
853
854
|
return debugExt.stopDebugging(session);
|
|
854
855
|
},
|
|
855
|
-
addBreakpoints(breakpoints: theia.Breakpoint[]): void {
|
|
856
|
+
addBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
|
|
856
857
|
debugExt.addBreakpoints(breakpoints);
|
|
857
858
|
},
|
|
858
|
-
removeBreakpoints(breakpoints: theia.Breakpoint[]): void {
|
|
859
|
+
removeBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
|
|
859
860
|
debugExt.removeBreakpoints(breakpoints);
|
|
860
861
|
}
|
|
861
862
|
};
|
package/src/plugin/quick-open.ts
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
Item, TransferQuickInputButton, TransferQuickPickItems, TransferQuickInput
|
|
20
20
|
} from '../common/plugin-api-rpc';
|
|
21
21
|
import * as theia from '@theia/plugin';
|
|
22
|
-
import { QuickPickItem, InputBoxOptions, InputBox, QuickPick, QuickInput } from '@theia/plugin';
|
|
22
|
+
import { QuickPickItem, InputBoxOptions, InputBox, QuickPick, QuickInput, QuickPickItemValue } from '@theia/plugin';
|
|
23
23
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
24
24
|
import { RPCProtocol } from '../common/rpc-protocol';
|
|
25
25
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
@@ -74,7 +74,7 @@ export class QuickOpenExtImpl implements QuickOpenExt {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/* eslint-disable max-len */
|
|
77
|
-
showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<
|
|
77
|
+
showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<QuickPickItemValue> | undefined>;
|
|
78
78
|
showQuickPick(itemsOrItemsPromise: string[] | Promise<string[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<string | undefined>;
|
|
79
79
|
showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<QuickPickItem | undefined>;
|
|
80
80
|
showQuickPick(itemsOrItemsPromise: Item[] | Promise<Item[]>, options?: theia.QuickPickOptions, token: theia.CancellationToken = CancellationToken.None): Promise<Item | Item[] | undefined> {
|
|
@@ -420,10 +420,10 @@ export class QuickInputExt implements QuickInput {
|
|
|
420
420
|
this.dispose();
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
protected convertURL(iconPath:
|
|
423
|
+
protected convertURL(iconPath: URI | { light: string | URI; dark: string | URI } | ThemeIcon):
|
|
424
424
|
URI | { light: string | URI; dark: string | URI } | ThemeIcon {
|
|
425
|
-
const toUrl = (arg: string |
|
|
426
|
-
arg = arg instanceof
|
|
425
|
+
const toUrl = (arg: string | URI) => {
|
|
426
|
+
arg = arg instanceof URI && arg.scheme === 'file' ? arg.fsPath : arg;
|
|
427
427
|
if (typeof arg !== 'string') {
|
|
428
428
|
return arg.toString(true);
|
|
429
429
|
}
|
|
@@ -435,10 +435,10 @@ export class QuickInputExt implements QuickInput {
|
|
|
435
435
|
};
|
|
436
436
|
if (ThemeIcon.is(iconPath)) {
|
|
437
437
|
return iconPath;
|
|
438
|
-
} else if (typeof iconPath === 'string' || iconPath instanceof
|
|
438
|
+
} else if (typeof iconPath === 'string' || iconPath instanceof URI) {
|
|
439
439
|
return URI.parse(toUrl(iconPath));
|
|
440
440
|
} else {
|
|
441
|
-
const { light, dark } = iconPath as { light: string |
|
|
441
|
+
const { light, dark } = iconPath as { light: string | URI, dark: string | URI };
|
|
442
442
|
return {
|
|
443
443
|
light: toUrl(light),
|
|
444
444
|
dark: toUrl(dark)
|
|
@@ -613,15 +613,20 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
|
|
|
613
613
|
this._itemsToHandles.set(item, i);
|
|
614
614
|
});
|
|
615
615
|
this.update({
|
|
616
|
-
items: items.map((item, i) =>
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
616
|
+
items: items.map((item, i) => {
|
|
617
|
+
if (item.type === 'separator') {
|
|
618
|
+
return { type: item.type, label: item.label };
|
|
619
|
+
}
|
|
620
|
+
return {
|
|
621
|
+
type: item.type,
|
|
622
|
+
label: item.label,
|
|
623
|
+
description: item.description,
|
|
624
|
+
handle: i,
|
|
625
|
+
detail: item.detail,
|
|
626
|
+
picked: item.picked,
|
|
627
|
+
alwaysShow: item.alwaysShow
|
|
628
|
+
};
|
|
629
|
+
})
|
|
625
630
|
});
|
|
626
631
|
}
|
|
627
632
|
|