@theia/plugin-ext 1.39.0 → 1.40.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/lib/common/plugin-api-rpc-model.d.ts +3 -0
- 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 -2
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +1 -1
- package/lib/main/browser/authentication-main.d.ts.map +1 -1
- package/lib/main/browser/authentication-main.js +19 -5
- package/lib/main/browser/authentication-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +3 -3
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +12 -3
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +3 -1
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +23 -1
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/workspace-main.d.ts +6 -0
- package/lib/main/browser/workspace-main.d.ts.map +1 -1
- package/lib/main/browser/workspace-main.js +27 -0
- package/lib/main/browser/workspace-main.js.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.d.ts +2 -0
- package/lib/main/node/paths/plugin-paths-service.d.ts.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.js +6 -10
- package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
- package/lib/main/node/plugins-key-value-storage.d.ts.map +1 -1
- package/lib/main/node/plugins-key-value-storage.js +3 -6
- package/lib/main/node/plugins-key-value-storage.js.map +1 -1
- package/lib/main/node/plugins-key-value-storage.spec.js +4 -0
- package/lib/main/node/plugins-key-value-storage.spec.js.map +1 -1
- package/lib/plugin/authentication-ext.d.ts +2 -6
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/languages/completion.d.ts.map +1 -1
- package/lib/plugin/languages/completion.js +4 -1
- package/lib/plugin/languages/completion.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 +2 -2
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +11 -3
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-manager.js +1 -0
- package/lib/plugin/plugin-manager.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +7 -1
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +4 -2
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/workspace.d.ts +5 -0
- package/lib/plugin/workspace.d.ts.map +1 -1
- package/lib/plugin/workspace.js +33 -0
- package/lib/plugin/workspace.js.map +1 -1
- package/package.json +27 -27
- package/src/common/plugin-api-rpc-model.ts +4 -0
- package/src/common/plugin-api-rpc.ts +11 -2
- package/src/main/browser/authentication-main.ts +23 -6
- package/src/main/browser/languages-main.ts +17 -4
- package/src/main/browser/view/tree-view-widget.tsx +26 -2
- package/src/main/browser/workspace-main.ts +35 -2
- package/src/main/node/paths/plugin-paths-service.ts +9 -11
- package/src/main/node/plugins-key-value-storage.spec.ts +4 -0
- package/src/main/node/plugins-key-value-storage.ts +3 -6
- package/src/plugin/authentication-ext.ts +2 -2
- package/src/plugin/languages/completion.ts +5 -1
- package/src/plugin/languages.ts +6 -2
- package/src/plugin/plugin-context.ts +11 -3
- package/src/plugin/plugin-manager.ts +1 -0
- package/src/plugin/types-impl.ts +13 -1
- package/src/plugin/workspace.ts +39 -1
package/src/plugin/languages.ts
CHANGED
|
@@ -494,9 +494,13 @@ export class LanguagesExtImpl implements LanguagesExt {
|
|
|
494
494
|
return this.withAdapter(handle, DocumentDropEditAdapter, adapter => adapter.provideDocumentDropEdits(URI.revive(resource), position, dataTransfer, token), undefined);
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
registerDocumentDropEditProvider(
|
|
497
|
+
registerDocumentDropEditProvider(
|
|
498
|
+
selector: theia.DocumentSelector,
|
|
499
|
+
provider: theia.DocumentDropEditProvider,
|
|
500
|
+
metadata?: theia.DocumentDropEditProviderMetadata
|
|
501
|
+
): theia.Disposable {
|
|
498
502
|
const callId = this.addNewAdapter(new DocumentDropEditAdapter(provider, this.documents, this.filesSystem));
|
|
499
|
-
this.proxy.$registerDocumentDropEditProvider(callId, this.transformDocumentSelector(selector));
|
|
503
|
+
this.proxy.$registerDocumentDropEditProvider(callId, this.transformDocumentSelector(selector), metadata);
|
|
500
504
|
return this.createDisposable(callId);
|
|
501
505
|
}
|
|
502
506
|
// ### Drop Edit Provider end
|
|
@@ -589,7 +589,9 @@ export function createAPIFactory(
|
|
|
589
589
|
/** @stubbed TerminalQuickFixProvider */
|
|
590
590
|
registerTerminalQuickFixProvider(id: string, provider: theia.TerminalQuickFixProvider): theia.Disposable {
|
|
591
591
|
return terminalExt.registerTerminalQuickFixProvider(id, provider);
|
|
592
|
-
}
|
|
592
|
+
},
|
|
593
|
+
/** @stubbed ShareProvider */
|
|
594
|
+
registerShareProvider: () => Disposable.NULL,
|
|
593
595
|
};
|
|
594
596
|
|
|
595
597
|
const workspace: typeof theia.workspace = {
|
|
@@ -747,6 +749,12 @@ export function createAPIFactory(
|
|
|
747
749
|
* that currently use this proposed API.
|
|
748
750
|
*/
|
|
749
751
|
onWillCreateEditSessionIdentity: () => Disposable.NULL,
|
|
752
|
+
registerCanonicalUriProvider(scheme: string, provider: theia.CanonicalUriProvider): theia.Disposable {
|
|
753
|
+
return workspaceExt.registerCanonicalUriProvider(scheme, provider);
|
|
754
|
+
},
|
|
755
|
+
getCanonicalUri(uri: theia.Uri, options: theia.CanonicalUriRequestOptions, token: CancellationToken): theia.ProviderResult<theia.Uri> {
|
|
756
|
+
return workspaceExt.getCanonicalUri(uri, options, token);
|
|
757
|
+
}
|
|
750
758
|
};
|
|
751
759
|
|
|
752
760
|
const onDidChangeLogLevel = new Emitter<theia.LogLevel>();
|
|
@@ -900,8 +908,8 @@ export function createAPIFactory(
|
|
|
900
908
|
): theia.Disposable {
|
|
901
909
|
return languagesExt.registerOnTypeFormattingEditProvider(selector, provider, [firstTriggerCharacter].concat(moreTriggerCharacters), pluginToPluginInfo(plugin));
|
|
902
910
|
},
|
|
903
|
-
registerDocumentDropEditProvider(selector: theia.DocumentSelector, provider: theia.DocumentDropEditProvider) {
|
|
904
|
-
return languagesExt.registerDocumentDropEditProvider(selector, provider);
|
|
911
|
+
registerDocumentDropEditProvider(selector: theia.DocumentSelector, provider: theia.DocumentDropEditProvider, metadata?: theia.DocumentDropEditProviderMetadata) {
|
|
912
|
+
return languagesExt.registerDocumentDropEditProvider(selector, provider, metadata);
|
|
905
913
|
},
|
|
906
914
|
registerDocumentLinkProvider(selector: theia.DocumentSelector, provider: theia.DocumentLinkProvider): theia.Disposable {
|
|
907
915
|
return languagesExt.registerDocumentLinkProvider(selector, provider, pluginToPluginInfo(plugin));
|
|
@@ -403,6 +403,7 @@ export class PluginManagerExtImpl implements PluginManagerExt, PluginManager {
|
|
|
403
403
|
if (typeof pluginMain[plugin.lifecycle.startMethod] === 'function') {
|
|
404
404
|
await this.localization.initializeLocalizedMessages(plugin, this.envExt.language);
|
|
405
405
|
const pluginExport = await pluginMain[plugin.lifecycle.startMethod].apply(getGlobal(), [pluginContext]);
|
|
406
|
+
console.log(`calling activation function on ${id}`);
|
|
406
407
|
this.activatedPlugins.set(plugin.model.id, new ActivatedPlugin(pluginContext, pluginExport, stopFn));
|
|
407
408
|
} else {
|
|
408
409
|
// https://github.com/TypeFox/vscode/blob/70b8db24a37fafc77247de7f7cb5bb0195120ed0/src/vs/workbench/api/common/extHostExtensionService.ts#L400-L401
|
package/src/plugin/types-impl.ts
CHANGED
|
@@ -1542,6 +1542,13 @@ export class DocumentLink {
|
|
|
1542
1542
|
|
|
1543
1543
|
@es5ClassCompat
|
|
1544
1544
|
export class DocumentDropEdit {
|
|
1545
|
+
|
|
1546
|
+
id?: string;
|
|
1547
|
+
|
|
1548
|
+
priority?: number;
|
|
1549
|
+
|
|
1550
|
+
label?: string;
|
|
1551
|
+
|
|
1545
1552
|
insertText: string | SnippetString;
|
|
1546
1553
|
|
|
1547
1554
|
additionalEdit?: WorkspaceEdit;
|
|
@@ -3499,11 +3506,16 @@ export class InteractiveWindowInput {
|
|
|
3499
3506
|
// #region DocumentPaste
|
|
3500
3507
|
@es5ClassCompat
|
|
3501
3508
|
export class DocumentPasteEdit {
|
|
3502
|
-
constructor(insertText: string | SnippetString) {
|
|
3509
|
+
constructor(insertText: string | SnippetString, id: string, label: string) {
|
|
3503
3510
|
this.insertText = insertText;
|
|
3511
|
+
this.id = id;
|
|
3512
|
+
this.label = label;
|
|
3504
3513
|
}
|
|
3505
3514
|
insertText: string | SnippetString;
|
|
3506
3515
|
additionalEdit?: WorkspaceEdit;
|
|
3516
|
+
id: string;
|
|
3517
|
+
label: string;
|
|
3518
|
+
priority?: number;
|
|
3507
3519
|
}
|
|
3508
3520
|
// #endregion
|
|
3509
3521
|
|
package/src/plugin/workspace.ts
CHANGED
|
@@ -42,6 +42,7 @@ import { toWorkspaceFolder } from './type-converters';
|
|
|
42
42
|
import { MessageRegistryExt } from './message-registry';
|
|
43
43
|
import * as Converter from './type-converters';
|
|
44
44
|
import { FileStat } from '@theia/filesystem/lib/common/files';
|
|
45
|
+
import { isUndefinedOrNull, isUndefined } from '../common/types';
|
|
45
46
|
|
|
46
47
|
export class WorkspaceExtImpl implements WorkspaceExt {
|
|
47
48
|
|
|
@@ -60,6 +61,8 @@ export class WorkspaceExtImpl implements WorkspaceExt {
|
|
|
60
61
|
private didGrantWorkspaceTrustEmitter = new Emitter<void>();
|
|
61
62
|
public readonly onDidGrantWorkspaceTrust: Event<void> = this.didGrantWorkspaceTrustEmitter.event;
|
|
62
63
|
|
|
64
|
+
private canonicalUriProviders = new Map<string, theia.CanonicalUriProvider>();
|
|
65
|
+
|
|
63
66
|
constructor(rpc: RPCProtocol,
|
|
64
67
|
private editorsAndDocuments: EditorsAndDocumentsExtImpl,
|
|
65
68
|
private messageService: MessageRegistryExt) {
|
|
@@ -449,9 +452,44 @@ export class WorkspaceExtImpl implements WorkspaceExt {
|
|
|
449
452
|
}
|
|
450
453
|
}
|
|
451
454
|
|
|
455
|
+
registerCanonicalUriProvider(scheme: string, provider: theia.CanonicalUriProvider): theia.Disposable {
|
|
456
|
+
if (this.canonicalUriProviders.has(scheme)) {
|
|
457
|
+
throw new Error(`Canonical URI provider for scheme: '${scheme}' already exists locally`);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
this.canonicalUriProviders.set(scheme, provider);
|
|
461
|
+
this.proxy.$registerCanonicalUriProvider(scheme).catch(e => {
|
|
462
|
+
console.error(`Canonical URI provider for scheme: '${scheme}' already exists globally`);
|
|
463
|
+
this.canonicalUriProviders.delete(scheme);
|
|
464
|
+
});
|
|
465
|
+
const result = Disposable.create(() => { this.proxy.$unregisterCanonicalUriProvider(scheme); });
|
|
466
|
+
return result;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
$disposeCanonicalUriProvider(scheme: string): void {
|
|
470
|
+
if (!this.canonicalUriProviders.delete(scheme)) {
|
|
471
|
+
console.warn(`No canonical uri provider registered for '${scheme}'`);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
async getCanonicalUri(uri: theia.Uri, options: theia.CanonicalUriRequestOptions, token: theia.CancellationToken): Promise<theia.Uri | undefined> {
|
|
476
|
+
const canonicalUri = await this.proxy.$getCanonicalUri(uri.toString(), options.targetScheme, token);
|
|
477
|
+
return isUndefined(canonicalUri) ? undefined : URI.parse(canonicalUri);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
async $provideCanonicalUri(uri: string, targetScheme: string, token: CancellationToken): Promise<string | undefined> {
|
|
481
|
+
const parsed = URI.parse(uri);
|
|
482
|
+
const provider = this.canonicalUriProviders.get(parsed.scheme);
|
|
483
|
+
if (!provider) {
|
|
484
|
+
console.warn(`No canonical uri provider registered for '${parsed.scheme}'`);
|
|
485
|
+
return undefined;
|
|
486
|
+
}
|
|
487
|
+
const result = await provider.provideCanonicalUri(parsed, { targetScheme: targetScheme }, token);
|
|
488
|
+
return isUndefinedOrNull(result) ? undefined : result.toString();
|
|
489
|
+
}
|
|
490
|
+
|
|
452
491
|
/** @stubbed */
|
|
453
492
|
$registerEditSessionIdentityProvider(scheme: string, provider: theia.EditSessionIdentityProvider): theia.Disposable {
|
|
454
493
|
return Disposable.NULL;
|
|
455
494
|
}
|
|
456
|
-
|
|
457
495
|
}
|