@theia/plugin-ext 1.53.0-next.6 → 1.53.0-next.64
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.d.ts +16 -4
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js +4 -2
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/rpc-protocol.d.ts +14 -13
- package/lib/common/rpc-protocol.d.ts.map +1 -1
- package/lib/common/rpc-protocol.js +56 -53
- package/lib/common/rpc-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +1 -0
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +13 -3
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +13 -1
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/authentication-main.d.ts +6 -5
- package/lib/main/browser/authentication-main.d.ts.map +1 -1
- package/lib/main/browser/authentication-main.js +15 -9
- package/lib/main/browser/authentication-main.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +9 -3
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +120 -31
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +7 -4
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.js +21 -7
- package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts +3 -4
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +5 -55
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +4 -3
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +24 -16
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +14 -2
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +3 -0
- 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 +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts +1 -0
- package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.js +22 -1
- package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
- package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts +2 -2
- package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts.map +1 -1
- package/lib/main/browser/menus/vscode-theia-menu-mappings.js +2 -0
- package/lib/main/browser/menus/vscode-theia-menu-mappings.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +3 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-main.js +22 -3
- package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-editors-main.d.ts +1 -1
- package/lib/main/browser/notebooks/notebook-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-editors-main.js +16 -2
- package/lib/main/browser/notebooks/notebook-editors-main.js.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
- package/lib/main/browser/plugin-ext-frontend-module.js +18 -0
- package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
- package/lib/main/browser/tabs/tabs-main.d.ts +1 -1
- package/lib/main/browser/tabs/tabs-main.d.ts.map +1 -1
- package/lib/main/browser/tabs/tabs-main.js +1 -1
- package/lib/main/browser/tabs/tabs-main.js.map +1 -1
- package/lib/main/browser/text-editor-main.d.ts +6 -3
- package/lib/main/browser/text-editor-main.d.ts.map +1 -1
- package/lib/main/browser/text-editor-main.js +39 -5
- package/lib/main/browser/text-editor-main.js.map +1 -1
- package/lib/main/browser/uri-main.d.ts +16 -0
- package/lib/main/browser/uri-main.d.ts.map +1 -0
- package/lib/main/browser/uri-main.js +64 -0
- package/lib/main/browser/uri-main.js.map +1 -0
- package/lib/main/browser/webview/webview.d.ts +1 -3
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +5 -4
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/browser/webviews-main.d.ts.map +1 -1
- package/lib/main/browser/webviews-main.js +6 -1
- package/lib/main/browser/webviews-main.js.map +1 -1
- package/lib/plugin/authentication-ext.d.ts +3 -2
- package/lib/plugin/authentication-ext.d.ts.map +1 -1
- package/lib/plugin/authentication-ext.js +8 -5
- package/lib/plugin/authentication-ext.js.map +1 -1
- package/lib/plugin/custom-editors.d.ts +2 -4
- package/lib/plugin/custom-editors.d.ts.map +1 -1
- package/lib/plugin/custom-editors.js +5 -7
- package/lib/plugin/custom-editors.js.map +1 -1
- package/lib/plugin/env.d.ts +2 -0
- package/lib/plugin/env.d.ts.map +1 -1
- package/lib/plugin/env.js +4 -1
- package/lib/plugin/env.js.map +1 -1
- package/lib/plugin/known-commands.d.ts.map +1 -1
- package/lib/plugin/known-commands.js +1 -0
- package/lib/plugin/known-commands.js.map +1 -1
- package/lib/plugin/notebook/notebooks.d.ts +1 -0
- package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.js +22 -2
- package/lib/plugin/notebook/notebooks.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +17 -6
- 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 +2 -1
- package/lib/plugin/plugin-manager.js.map +1 -1
- package/lib/plugin/terminal-ext.d.ts +2 -0
- package/lib/plugin/terminal-ext.d.ts.map +1 -1
- package/lib/plugin/terminal-ext.js +2 -0
- package/lib/plugin/terminal-ext.js.map +1 -1
- package/lib/plugin/text-editor.d.ts +1 -1
- package/lib/plugin/text-editor.d.ts.map +1 -1
- package/lib/plugin/text-editor.js.map +1 -1
- package/lib/plugin/type-converters.d.ts +5 -0
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +24 -3
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +5 -0
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +9 -1
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/uri-ext.d.ts +37 -0
- package/lib/plugin/uri-ext.d.ts.map +1 -0
- package/lib/plugin/uri-ext.js +50 -0
- package/lib/plugin/uri-ext.js.map +1 -0
- package/lib/plugin/webviews.js +1 -1
- package/lib/plugin/webviews.js.map +1 -1
- package/package.json +29 -29
- package/src/common/plugin-api-rpc.ts +21 -6
- package/src/common/rpc-protocol.ts +62 -66
- package/src/hosted/browser/hosted-plugin.ts +16 -5
- package/src/hosted/node/scanners/scanner-theia.ts +12 -1
- package/src/main/browser/authentication-main.ts +24 -11
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +125 -25
- package/src/main/browser/custom-editors/custom-editor-widget.ts +20 -11
- package/src/main/browser/custom-editors/custom-editors-main.ts +11 -70
- package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +20 -14
- package/src/main/browser/editors-and-documents-main.ts +25 -2
- package/src/main/browser/main-context.ts +4 -0
- package/src/main/browser/menus/menus-contribution-handler.ts +2 -1
- package/src/main/browser/menus/plugin-menu-command-adapter.ts +22 -1
- package/src/main/browser/menus/vscode-theia-menu-mappings.ts +3 -1
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +5 -2
- package/src/main/browser/notebooks/notebook-documents-main.ts +24 -4
- package/src/main/browser/notebooks/notebook-editors-main.ts +15 -2
- package/src/main/browser/plugin-ext-frontend-module.ts +23 -4
- package/src/main/browser/tabs/tabs-main.ts +6 -2
- package/src/main/browser/text-editor-main.ts +55 -14
- package/src/main/browser/uri-main.ts +72 -0
- package/src/main/browser/webview/pre/service-worker.js +2 -1
- package/src/main/browser/webview/webview.ts +5 -6
- package/src/main/browser/webviews-main.ts +6 -1
- package/src/plugin/authentication-ext.ts +9 -5
- package/src/plugin/custom-editors.ts +8 -10
- package/src/plugin/env.ts +6 -1
- package/src/plugin/known-commands.ts +1 -0
- package/src/plugin/notebook/notebooks.ts +21 -0
- package/src/plugin/plugin-context.ts +19 -8
- package/src/plugin/plugin-manager.ts +2 -1
- package/src/plugin/terminal-ext.ts +3 -0
- package/src/plugin/text-editor.ts +1 -1
- package/src/plugin/type-converters.ts +20 -0
- package/src/plugin/types-impl.ts +10 -0
- package/src/plugin/uri-ext.ts +60 -0
- package/src/plugin/webviews.ts +1 -1
- package/lib/common/proxy-handler.d.ts +0 -73
- package/lib/common/proxy-handler.d.ts.map +0 -1
- package/lib/common/proxy-handler.js +0 -106
- package/lib/common/proxy-handler.js.map +0 -1
- package/src/common/proxy-handler.ts +0 -143
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin-ext",
|
|
3
|
-
"version": "1.53.0-next.
|
|
3
|
+
"version": "1.53.0-next.64+23b351d26",
|
|
4
4
|
"description": "Theia - Plugin Extension",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@theia/bulk-edit": "1.53.0-next.
|
|
9
|
-
"@theia/callhierarchy": "1.53.0-next.
|
|
10
|
-
"@theia/console": "1.53.0-next.
|
|
11
|
-
"@theia/core": "1.53.0-next.
|
|
12
|
-
"@theia/debug": "1.53.0-next.
|
|
13
|
-
"@theia/editor": "1.53.0-next.
|
|
14
|
-
"@theia/editor-preview": "1.53.0-next.
|
|
15
|
-
"@theia/file-search": "1.53.0-next.
|
|
16
|
-
"@theia/filesystem": "1.53.0-next.
|
|
17
|
-
"@theia/markers": "1.53.0-next.
|
|
18
|
-
"@theia/messages": "1.53.0-next.
|
|
19
|
-
"@theia/monaco": "1.53.0-next.
|
|
8
|
+
"@theia/bulk-edit": "1.53.0-next.64+23b351d26",
|
|
9
|
+
"@theia/callhierarchy": "1.53.0-next.64+23b351d26",
|
|
10
|
+
"@theia/console": "1.53.0-next.64+23b351d26",
|
|
11
|
+
"@theia/core": "1.53.0-next.64+23b351d26",
|
|
12
|
+
"@theia/debug": "1.53.0-next.64+23b351d26",
|
|
13
|
+
"@theia/editor": "1.53.0-next.64+23b351d26",
|
|
14
|
+
"@theia/editor-preview": "1.53.0-next.64+23b351d26",
|
|
15
|
+
"@theia/file-search": "1.53.0-next.64+23b351d26",
|
|
16
|
+
"@theia/filesystem": "1.53.0-next.64+23b351d26",
|
|
17
|
+
"@theia/markers": "1.53.0-next.64+23b351d26",
|
|
18
|
+
"@theia/messages": "1.53.0-next.64+23b351d26",
|
|
19
|
+
"@theia/monaco": "1.53.0-next.64+23b351d26",
|
|
20
20
|
"@theia/monaco-editor-core": "1.83.101",
|
|
21
|
-
"@theia/navigator": "1.53.0-next.
|
|
22
|
-
"@theia/notebook": "1.53.0-next.
|
|
23
|
-
"@theia/output": "1.53.0-next.
|
|
24
|
-
"@theia/plugin": "1.53.0-next.
|
|
25
|
-
"@theia/preferences": "1.53.0-next.
|
|
26
|
-
"@theia/scm": "1.53.0-next.
|
|
27
|
-
"@theia/search-in-workspace": "1.53.0-next.
|
|
28
|
-
"@theia/task": "1.53.0-next.
|
|
29
|
-
"@theia/terminal": "1.53.0-next.
|
|
30
|
-
"@theia/test": "1.53.0-next.
|
|
31
|
-
"@theia/timeline": "1.53.0-next.
|
|
32
|
-
"@theia/typehierarchy": "1.53.0-next.
|
|
33
|
-
"@theia/variable-resolver": "1.53.0-next.
|
|
34
|
-
"@theia/workspace": "1.53.0-next.
|
|
21
|
+
"@theia/navigator": "1.53.0-next.64+23b351d26",
|
|
22
|
+
"@theia/notebook": "1.53.0-next.64+23b351d26",
|
|
23
|
+
"@theia/output": "1.53.0-next.64+23b351d26",
|
|
24
|
+
"@theia/plugin": "1.53.0-next.64+23b351d26",
|
|
25
|
+
"@theia/preferences": "1.53.0-next.64+23b351d26",
|
|
26
|
+
"@theia/scm": "1.53.0-next.64+23b351d26",
|
|
27
|
+
"@theia/search-in-workspace": "1.53.0-next.64+23b351d26",
|
|
28
|
+
"@theia/task": "1.53.0-next.64+23b351d26",
|
|
29
|
+
"@theia/terminal": "1.53.0-next.64+23b351d26",
|
|
30
|
+
"@theia/test": "1.53.0-next.64+23b351d26",
|
|
31
|
+
"@theia/timeline": "1.53.0-next.64+23b351d26",
|
|
32
|
+
"@theia/typehierarchy": "1.53.0-next.64+23b351d26",
|
|
33
|
+
"@theia/variable-resolver": "1.53.0-next.64+23b351d26",
|
|
34
|
+
"@theia/workspace": "1.53.0-next.64+23b351d26",
|
|
35
35
|
"@types/mime": "^2.0.1",
|
|
36
36
|
"@vscode/debugprotocol": "^1.51.0",
|
|
37
37
|
"@vscode/proxy-agent": "^0.13.2",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"watch": "theiaext watch"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@theia/ext-scripts": "1.
|
|
91
|
+
"@theia/ext-scripts": "1.53.0",
|
|
92
92
|
"@types/decompress": "^4.2.2",
|
|
93
93
|
"@types/escape-html": "^0.0.20",
|
|
94
94
|
"@types/lodash.clonedeep": "^4.5.3",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"nyc": {
|
|
98
98
|
"extends": "../../configs/nyc.json"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "23b351d26346a2b5d6aca3ee81fba59c056132f7"
|
|
101
101
|
}
|
|
@@ -181,6 +181,7 @@ export interface EnvInit {
|
|
|
181
181
|
appName: string;
|
|
182
182
|
appHost: string;
|
|
183
183
|
appRoot: string;
|
|
184
|
+
appUriScheme: string;
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
export interface PluginAPI {
|
|
@@ -1882,7 +1883,7 @@ export interface CustomEditorsExt {
|
|
|
1882
1883
|
newWebviewHandle: string,
|
|
1883
1884
|
viewType: string,
|
|
1884
1885
|
title: string,
|
|
1885
|
-
|
|
1886
|
+
position: number,
|
|
1886
1887
|
options: theia.WebviewPanelOptions,
|
|
1887
1888
|
cancellation: CancellationToken): Promise<void>;
|
|
1888
1889
|
$createCustomDocument(resource: UriComponents, viewType: string, openContext: theia.CustomDocumentOpenContext, cancellation: CancellationToken): Promise<{ editable: boolean }>;
|
|
@@ -1905,7 +1906,6 @@ export interface CustomEditorsMain {
|
|
|
1905
1906
|
$registerTextEditorProvider(viewType: string, options: theia.WebviewPanelOptions, capabilities: CustomTextEditorCapabilities): void;
|
|
1906
1907
|
$registerCustomEditorProvider(viewType: string, options: theia.WebviewPanelOptions, supportsMultipleEditorsPerDocument: boolean): void;
|
|
1907
1908
|
$unregisterEditorProvider(viewType: string): void;
|
|
1908
|
-
$createCustomEditorPanel(handle: string, title: string, widgetOpenerOptions: object | undefined, options: theia.WebviewPanelOptions & theia.WebviewOptions): Promise<void>;
|
|
1909
1909
|
$onDidEdit(resource: UriComponents, viewType: string, editId: number, label: string | undefined): void;
|
|
1910
1910
|
$onContentChange(resource: UriComponents, viewType: string): void;
|
|
1911
1911
|
}
|
|
@@ -2242,6 +2242,17 @@ export interface TestingExt {
|
|
|
2242
2242
|
$onResolveChildren(controllerId: string, path: string[]): void;
|
|
2243
2243
|
}
|
|
2244
2244
|
|
|
2245
|
+
// based from https://github.com/microsoft/vscode/blob/1.85.1/src/vs/workbench/api/common/extHostUrls.ts
|
|
2246
|
+
export interface UriExt {
|
|
2247
|
+
registerUriHandler(handler: theia.UriHandler, plugin: PluginInfo): theia.Disposable;
|
|
2248
|
+
$handleExternalUri(uri: UriComponents): Promise<void>;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
export interface UriMain {
|
|
2252
|
+
$registerUriHandler(extensionId: string, extensionName: string): void;
|
|
2253
|
+
$unregisterUriHandler(extensionId: string): void;
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2245
2256
|
export interface TestControllerUpdate {
|
|
2246
2257
|
label: string;
|
|
2247
2258
|
canRefresh: boolean;
|
|
@@ -2319,7 +2330,8 @@ export const PLUGIN_RPC_CONTEXT = {
|
|
|
2319
2330
|
TABS_MAIN: <ProxyIdentifier<TabsMain>>createProxyIdentifier<TabsMain>('TabsMain'),
|
|
2320
2331
|
TELEMETRY_MAIN: <ProxyIdentifier<TelemetryMain>>createProxyIdentifier<TelemetryMain>('TelemetryMain'),
|
|
2321
2332
|
LOCALIZATION_MAIN: <ProxyIdentifier<LocalizationMain>>createProxyIdentifier<LocalizationMain>('LocalizationMain'),
|
|
2322
|
-
TESTING_MAIN: createProxyIdentifier<TestingMain>('TestingMain')
|
|
2333
|
+
TESTING_MAIN: createProxyIdentifier<TestingMain>('TestingMain'),
|
|
2334
|
+
URI_MAIN: createProxyIdentifier<UriMain>('UriMain')
|
|
2323
2335
|
};
|
|
2324
2336
|
|
|
2325
2337
|
export const MAIN_RPC_CONTEXT = {
|
|
@@ -2361,7 +2373,8 @@ export const MAIN_RPC_CONTEXT = {
|
|
|
2361
2373
|
COMMENTS_EXT: createProxyIdentifier<CommentsExt>('CommentsExt'),
|
|
2362
2374
|
TABS_EXT: createProxyIdentifier<TabsExt>('TabsExt'),
|
|
2363
2375
|
TELEMETRY_EXT: createProxyIdentifier<TelemetryExt>('TelemetryExt)'),
|
|
2364
|
-
TESTING_EXT: createProxyIdentifier<TestingExt>('TestingExt')
|
|
2376
|
+
TESTING_EXT: createProxyIdentifier<TestingExt>('TestingExt'),
|
|
2377
|
+
URI_EXT: createProxyIdentifier<UriExt>('UriExt')
|
|
2365
2378
|
};
|
|
2366
2379
|
|
|
2367
2380
|
export interface TasksExt {
|
|
@@ -2385,13 +2398,14 @@ export interface TasksMain {
|
|
|
2385
2398
|
}
|
|
2386
2399
|
|
|
2387
2400
|
export interface AuthenticationExt {
|
|
2388
|
-
$getSessions(
|
|
2389
|
-
$createSession(id: string, scopes: string[]): Promise<theia.AuthenticationSession>;
|
|
2401
|
+
$getSessions(providerId: string, scopes: string[] | undefined, options: theia.AuthenticationProviderSessionOptions): Promise<ReadonlyArray<theia.AuthenticationSession>>;
|
|
2402
|
+
$createSession(id: string, scopes: string[], options: theia.AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession>;
|
|
2390
2403
|
$removeSession(id: string, sessionId: string): Promise<void>;
|
|
2391
2404
|
$onDidChangeAuthenticationSessions(provider: theia.AuthenticationProviderInformation): Promise<void>;
|
|
2392
2405
|
}
|
|
2393
2406
|
|
|
2394
2407
|
export interface AuthenticationMain {
|
|
2408
|
+
$getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]>;
|
|
2395
2409
|
$registerAuthenticationProvider(id: string, label: string, supportsMultipleAccounts: boolean): void;
|
|
2396
2410
|
$unregisterAuthenticationProvider(id: string): void;
|
|
2397
2411
|
$onDidChangeSessions(providerId: string, event: AuthenticationProviderAuthenticationSessionsChangeEvent): void;
|
|
@@ -2659,6 +2673,7 @@ export interface NotebookDocumentsExt {
|
|
|
2659
2673
|
|
|
2660
2674
|
export interface NotebookDocumentsAndEditorsExt {
|
|
2661
2675
|
$acceptDocumentsAndEditorsDelta(delta: NotebookDocumentsAndEditorsDelta): Promise<void>;
|
|
2676
|
+
$acceptActiveCellEditorChange(newActiveEditor: string | null): void;
|
|
2662
2677
|
}
|
|
2663
2678
|
|
|
2664
2679
|
export interface NotebookDocumentsAndEditorsMain extends Disposable {
|
|
@@ -22,17 +22,14 @@
|
|
|
22
22
|
|
|
23
23
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
24
24
|
|
|
25
|
-
import { Channel, Disposable, DisposableCollection, isObject, ReadBuffer, URI, WriteBuffer } from '@theia/core';
|
|
25
|
+
import { Channel, Disposable, DisposableCollection, isObject, ReadBuffer, RpcProtocol, URI, WriteBuffer } from '@theia/core';
|
|
26
26
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
27
|
-
import {
|
|
28
|
-
import { MsgPackMessageDecoder, MsgPackMessageEncoder } from '@theia/core/lib/common/message-rpc/rpc-message-encoder';
|
|
27
|
+
import { MessageProvider } from '@theia/core/lib/common/message-rpc/channel';
|
|
29
28
|
import { Uint8ArrayReadBuffer, Uint8ArrayWriteBuffer } from '@theia/core/lib/common/message-rpc/uint8-array-message-buffer';
|
|
30
|
-
import { ClientProxyHandler, ProxySynchronizer, RpcInvocationHandler } from './proxy-handler';
|
|
31
29
|
import { MsgPackExtensionManager } from '@theia/core/lib/common/message-rpc/msg-pack-extension-manager';
|
|
32
30
|
import { URI as VSCodeURI } from '@theia/core/shared/vscode-uri';
|
|
33
31
|
import { BinaryBuffer } from '@theia/core/lib/common/buffer';
|
|
34
32
|
import { Range, Position } from '../plugin/types-impl';
|
|
35
|
-
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
36
33
|
|
|
37
34
|
export interface MessageConnection {
|
|
38
35
|
send(msg: string): void;
|
|
@@ -79,21 +76,36 @@ export namespace ConnectionClosedError {
|
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
export class RPCProtocolImpl implements RPCProtocol {
|
|
82
|
-
private readonly locals = new Map<string,
|
|
79
|
+
private readonly locals = new Map<string, any>();
|
|
83
80
|
private readonly proxies = new Map<string, any>();
|
|
84
|
-
private readonly
|
|
85
|
-
private readonly encoder = new MsgPackMessageEncoder();
|
|
86
|
-
private readonly decoder = new MsgPackMessageDecoder();
|
|
87
|
-
private readonly initCallback: ProxySynchronizer;
|
|
81
|
+
private readonly rpc: RpcProtocol;
|
|
88
82
|
|
|
89
83
|
private readonly toDispose = new DisposableCollection(
|
|
90
84
|
Disposable.create(() => { /* mark as no disposed */ })
|
|
91
85
|
);
|
|
92
86
|
|
|
93
87
|
constructor(channel: Channel) {
|
|
94
|
-
this.
|
|
88
|
+
this.rpc = new RpcProtocol(new BatchingChannel(channel), (method, args) => this.handleRequest(method, args));
|
|
89
|
+
this.rpc.onNotification((evt: { method: string; args: any[]; }) => this.handleNotification(evt.method, evt.args));
|
|
95
90
|
this.toDispose.push(Disposable.create(() => this.proxies.clear()));
|
|
96
|
-
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
handleNotification(method: any, args: any[]): void {
|
|
94
|
+
const serviceId = args[0] as string;
|
|
95
|
+
const handler: any = this.locals.get(serviceId);
|
|
96
|
+
if (!handler) {
|
|
97
|
+
throw new Error(`no local service handler with id ${serviceId}`);
|
|
98
|
+
}
|
|
99
|
+
handler[method](...(args.slice(1)));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
handleRequest(method: string, args: any[]): Promise<any> {
|
|
103
|
+
const serviceId = args[0] as string;
|
|
104
|
+
const handler: any = this.locals.get(serviceId);
|
|
105
|
+
if (!handler) {
|
|
106
|
+
throw new Error(`no local service handler with id ${serviceId}`);
|
|
107
|
+
}
|
|
108
|
+
return handler[method](...(args.slice(1)));
|
|
97
109
|
}
|
|
98
110
|
|
|
99
111
|
dispose(): void {
|
|
@@ -117,76 +129,60 @@ export class RPCProtocolImpl implements RPCProtocol {
|
|
|
117
129
|
}
|
|
118
130
|
|
|
119
131
|
protected createProxy<T>(proxyId: string): T {
|
|
120
|
-
const handler =
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
const handler = {
|
|
133
|
+
get: (target: any, name: string, receiver: any): any => {
|
|
134
|
+
if (target[name] || name.charCodeAt(0) !== 36 /* CharCode.DollarSign */) {
|
|
135
|
+
// not a remote property
|
|
136
|
+
return target[name];
|
|
137
|
+
}
|
|
138
|
+
const isNotify = this.isNotification(name);
|
|
139
|
+
return async (...args: any[]) => {
|
|
140
|
+
const method = name.toString();
|
|
141
|
+
if (isNotify) {
|
|
142
|
+
this.rpc.sendNotification(method, [proxyId, ...args]);
|
|
143
|
+
} else {
|
|
144
|
+
return await this.rpc.sendRequest(method, [proxyId, ...args]) as Promise<any>;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
};
|
|
123
150
|
return new Proxy(Object.create(null), handler);
|
|
124
151
|
}
|
|
125
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Return whether the given property represents a notification. If true,
|
|
155
|
+
* the promise returned from the invocation will resolve immediately to `undefined`
|
|
156
|
+
*
|
|
157
|
+
* A property leads to a notification rather than a method call if its name
|
|
158
|
+
* begins with `notify` or `on`.
|
|
159
|
+
*
|
|
160
|
+
* @param p - The property being called on the proxy.
|
|
161
|
+
* @return Whether `p` represents a notification.
|
|
162
|
+
*/
|
|
163
|
+
protected isNotification(p: PropertyKey): boolean {
|
|
164
|
+
let propertyString = p.toString();
|
|
165
|
+
if (propertyString.charCodeAt(0) === 36/* CharCode.DollarSign */) {
|
|
166
|
+
propertyString = propertyString.substring(1);
|
|
167
|
+
}
|
|
168
|
+
return propertyString.startsWith('notify') || propertyString.startsWith('on');
|
|
169
|
+
}
|
|
170
|
+
|
|
126
171
|
set<T, R extends T>(identifier: ProxyIdentifier<T>, instance: R): R {
|
|
127
172
|
if (this.isDisposed) {
|
|
128
173
|
throw ConnectionClosedError.create();
|
|
129
174
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const handler = new RpcInvocationHandler({ id: identifier.id, target: instance, encoder: this.encoder, decoder: this.decoder });
|
|
133
|
-
|
|
134
|
-
const channel = this.multiplexer.getOpenChannel(identifier.id);
|
|
135
|
-
if (channel) {
|
|
136
|
-
handler.listen(channel);
|
|
137
|
-
} else {
|
|
138
|
-
const channelOpenListener = this.multiplexer.onDidOpenChannel(event => {
|
|
139
|
-
if (event.id === identifier.id) {
|
|
140
|
-
handler.listen(event.channel);
|
|
141
|
-
channelOpenListener.dispose();
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
this.locals.set(identifier.id, handler);
|
|
175
|
+
if (!this.locals.has(identifier.id)) {
|
|
176
|
+
this.locals.set(identifier.id, instance);
|
|
147
177
|
if (Disposable.is(instance)) {
|
|
148
178
|
this.toDispose.push(instance);
|
|
149
179
|
}
|
|
150
180
|
this.toDispose.push(Disposable.create(() => this.locals.delete(identifier.id)));
|
|
151
|
-
|
|
152
181
|
}
|
|
153
182
|
return instance;
|
|
154
183
|
}
|
|
155
184
|
}
|
|
156
185
|
|
|
157
|
-
export class ProxySynchronizerImpl implements ProxySynchronizer {
|
|
158
|
-
|
|
159
|
-
private readonly runningInitializations = new Set<string>();
|
|
160
|
-
|
|
161
|
-
private _pendingProxyInitializations: Deferred<void>;
|
|
162
|
-
|
|
163
|
-
constructor() {
|
|
164
|
-
this._pendingProxyInitializations = new Deferred();
|
|
165
|
-
/* after creation no init is active */
|
|
166
|
-
this._pendingProxyInitializations.resolve();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
startProxyInitialization(id: string, init: Promise<void>): void {
|
|
170
|
-
if (this.runningInitializations.size === 0) {
|
|
171
|
-
this._pendingProxyInitializations = new Deferred();
|
|
172
|
-
}
|
|
173
|
-
init.then(() => this.finishedProxyInitialization(id));
|
|
174
|
-
this.runningInitializations.add(id);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
protected finishedProxyInitialization(id: string): void {
|
|
178
|
-
this.runningInitializations.delete(id);
|
|
179
|
-
if (this.runningInitializations.size === 0) {
|
|
180
|
-
this._pendingProxyInitializations.resolve();
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
pendingProxyInitializations(): Promise<void> {
|
|
185
|
-
return this._pendingProxyInitializations.promise;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
186
|
/**
|
|
191
187
|
* Wraps and underlying channel to send/receive multiple messages in one go:
|
|
192
188
|
* - multiple messages to be sent from one stack get sent in bulk at `process.nextTick`.
|
|
@@ -40,10 +40,10 @@ import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
|
40
40
|
import { PluginContributionHandler } from '../../main/browser/plugin-contribution-handler';
|
|
41
41
|
import { getQueryParameters } from '../../main/browser/env-main';
|
|
42
42
|
import { getPreferences } from '../../main/browser/preference-registry-main';
|
|
43
|
-
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
43
|
+
import { Deferred, waitForEvent } from '@theia/core/lib/common/promise-util';
|
|
44
44
|
import { DebugSessionManager } from '@theia/debug/lib/browser/debug-session-manager';
|
|
45
45
|
import { DebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager';
|
|
46
|
-
import { WaitUntilEvent } from '@theia/core/lib/common/event';
|
|
46
|
+
import { Event, WaitUntilEvent } from '@theia/core/lib/common/event';
|
|
47
47
|
import { FileSearchService } from '@theia/file-search/lib/common/file-search-service';
|
|
48
48
|
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
|
49
49
|
import { PluginViewRegistry } from '../../main/browser/view/plugin-view-registry';
|
|
@@ -209,7 +209,8 @@ export class HostedPluginSupport extends AbstractHostedPluginSupport<PluginManag
|
|
|
209
209
|
this.notebookRendererMessagingService.onWillActivateRenderer(rendererId => this.activateByNotebookRenderer(rendererId));
|
|
210
210
|
|
|
211
211
|
this.widgets.onDidCreateWidget(({ factoryId, widget }) => {
|
|
212
|
-
|
|
212
|
+
// note: state restoration of custom editors is handled in `PluginCustomEditorRegistry.init`
|
|
213
|
+
if (factoryId === WebviewWidget.FACTORY_ID && widget instanceof WebviewWidget) {
|
|
213
214
|
const storeState = widget.storeState.bind(widget);
|
|
214
215
|
const restoreState = widget.restoreState.bind(widget);
|
|
215
216
|
|
|
@@ -327,7 +328,8 @@ export class HostedPluginSupport extends AbstractHostedPluginSupport<PluginManag
|
|
|
327
328
|
uiKind: isElectron ? UIKind.Desktop : UIKind.Web,
|
|
328
329
|
appName: FrontendApplicationConfigProvider.get().applicationName,
|
|
329
330
|
appHost: isElectron ? 'desktop' : 'web', // TODO: 'web' could be the embedder's name, e.g. 'github.dev'
|
|
330
|
-
appRoot
|
|
331
|
+
appRoot,
|
|
332
|
+
appUriScheme: FrontendApplicationConfigProvider.get().electron.uriScheme
|
|
331
333
|
},
|
|
332
334
|
extApi,
|
|
333
335
|
webview: {
|
|
@@ -415,6 +417,10 @@ export class HostedPluginSupport extends AbstractHostedPluginSupport<PluginManag
|
|
|
415
417
|
await this.activateByEvent(`onLanguage:${languageId}`);
|
|
416
418
|
}
|
|
417
419
|
|
|
420
|
+
async activateByUri(scheme: string, authority: string): Promise<void> {
|
|
421
|
+
await this.activateByEvent(`onUri:${scheme}://${authority}`);
|
|
422
|
+
}
|
|
423
|
+
|
|
418
424
|
async activateByCommand(commandId: string): Promise<void> {
|
|
419
425
|
await this.activateByEvent(`onCommand:${commandId}`);
|
|
420
426
|
}
|
|
@@ -448,7 +454,12 @@ export class HostedPluginSupport extends AbstractHostedPluginSupport<PluginManag
|
|
|
448
454
|
}
|
|
449
455
|
|
|
450
456
|
protected ensureFileSystemActivation(event: FileSystemProviderActivationEvent): void {
|
|
451
|
-
event.waitUntil(this.activateByFileSystem(event))
|
|
457
|
+
event.waitUntil(this.activateByFileSystem(event).then(() => {
|
|
458
|
+
if (!this.fileService.hasProvider(event.scheme)) {
|
|
459
|
+
return waitForEvent(Event.filter(this.fileService.onDidChangeFileSystemProviderRegistrations,
|
|
460
|
+
({ added, scheme }) => added && scheme === event.scheme), 3000);
|
|
461
|
+
}
|
|
462
|
+
}));
|
|
452
463
|
}
|
|
453
464
|
|
|
454
465
|
protected ensureCommandHandlerRegistration(event: WillExecuteCommandEvent): void {
|
|
@@ -192,11 +192,22 @@ export class TheiaPluginScanner extends AbstractPluginScanner {
|
|
|
192
192
|
try {
|
|
193
193
|
if (rawPlugin.contributes.configuration) {
|
|
194
194
|
const configurations = Array.isArray(rawPlugin.contributes.configuration) ? rawPlugin.contributes.configuration : [rawPlugin.contributes.configuration];
|
|
195
|
+
const hasMultipleConfigs = configurations.length > 1;
|
|
195
196
|
contributions.configuration = [];
|
|
196
197
|
for (const c of configurations) {
|
|
197
198
|
const config = this.readConfiguration(c, rawPlugin.packagePath);
|
|
198
199
|
if (config) {
|
|
199
|
-
Object.values(config.properties).forEach(property =>
|
|
200
|
+
Object.values(config.properties).forEach(property => {
|
|
201
|
+
if (hasMultipleConfigs) {
|
|
202
|
+
// If there are multiple configuration contributions, we need to distinguish them by their title in the settings UI.
|
|
203
|
+
// They are placed directly under the plugin's name in the settings UI.
|
|
204
|
+
property.owner = rawPlugin.displayName;
|
|
205
|
+
property.group = config.title;
|
|
206
|
+
} else {
|
|
207
|
+
// If there's only one configuration contribution, we display the title in the settings UI.
|
|
208
|
+
property.owner = config.title;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
200
211
|
contributions.configuration.push(config);
|
|
201
212
|
}
|
|
202
213
|
}
|
|
@@ -27,7 +27,10 @@ import { MessageService } from '@theia/core/lib/common/message-service';
|
|
|
27
27
|
import { ConfirmDialog, Dialog, StorageService } from '@theia/core/lib/browser';
|
|
28
28
|
import {
|
|
29
29
|
AuthenticationProvider,
|
|
30
|
+
AuthenticationProviderSessionOptions,
|
|
30
31
|
AuthenticationService,
|
|
32
|
+
AuthenticationSession,
|
|
33
|
+
AuthenticationSessionAccountInformation,
|
|
31
34
|
readAllowedExtensions
|
|
32
35
|
} from '@theia/core/lib/browser/authentication-service';
|
|
33
36
|
import { QuickPickService } from '@theia/core/lib/common/quick-pick-service';
|
|
@@ -77,9 +80,13 @@ export class AuthenticationMainImpl implements AuthenticationMain {
|
|
|
77
80
|
return this.authenticationService.requestNewSession(providerId, scopes, extensionId, extensionName);
|
|
78
81
|
}
|
|
79
82
|
|
|
83
|
+
$getAccounts(providerId: string): Thenable<readonly theia.AuthenticationSessionAccountInformation[]> {
|
|
84
|
+
return this.authenticationService.getSessions(providerId).then(sessions => sessions.map(session => session.account));
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
async $getSession(providerId: string, scopes: string[], extensionId: string, extensionName: string,
|
|
81
88
|
options: theia.AuthenticationGetSessionOptions): Promise<theia.AuthenticationSession | undefined> {
|
|
82
|
-
const sessions = await this.authenticationService.getSessions(providerId, scopes);
|
|
89
|
+
const sessions = await this.authenticationService.getSessions(providerId, scopes, options?.account);
|
|
83
90
|
|
|
84
91
|
// Error cases
|
|
85
92
|
if (options.forceNewSession && !sessions.length) {
|
|
@@ -140,26 +147,32 @@ export class AuthenticationMainImpl implements AuthenticationMain {
|
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
protected async selectSession(providerId: string, providerName: string, extensionId: string, extensionName: string,
|
|
143
|
-
potentialSessions: Readonly<
|
|
150
|
+
potentialSessions: Readonly<AuthenticationSession[]>, scopes: string[], clearSessionPreference: boolean): Promise<theia.AuthenticationSession> {
|
|
151
|
+
|
|
144
152
|
if (!potentialSessions.length) {
|
|
145
153
|
throw new Error('No potential sessions found');
|
|
146
154
|
}
|
|
147
155
|
|
|
148
156
|
return new Promise(async (resolve, reject) => {
|
|
149
|
-
const items: QuickPickValue<{ session?:
|
|
157
|
+
const items: QuickPickValue<{ session?: AuthenticationSession, account?: AuthenticationSessionAccountInformation }>[] = potentialSessions.map(session => ({
|
|
150
158
|
label: session.account.label,
|
|
151
159
|
value: { session }
|
|
152
160
|
}));
|
|
153
161
|
items.push({
|
|
154
162
|
label: nls.localizeByDefault('Sign in to another account'),
|
|
155
|
-
value: {
|
|
163
|
+
value: {}
|
|
156
164
|
});
|
|
165
|
+
|
|
166
|
+
// VS Code has code here that pushes accounts that have no active sessions. However, since we do not store
|
|
167
|
+
// any accounts that don't have sessions, we dont' do this.
|
|
157
168
|
const selected = await this.quickPickService.show(items,
|
|
158
169
|
{
|
|
159
170
|
title: nls.localizeByDefault("The extension '{0}' wants to access a {1} account", extensionName, providerName),
|
|
160
171
|
ignoreFocusOut: true
|
|
161
172
|
});
|
|
162
173
|
if (selected) {
|
|
174
|
+
|
|
175
|
+
// if we ever have accounts without sessions, pass the account to the login call
|
|
163
176
|
const session = selected.value?.session ?? await this.authenticationService.login(providerId, scopes);
|
|
164
177
|
const accountName = session.account.label;
|
|
165
178
|
|
|
@@ -318,13 +331,13 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
|
318
331
|
}
|
|
319
332
|
}
|
|
320
333
|
|
|
321
|
-
async getSessions(scopes?: string[]): Promise<ReadonlyArray<theia.AuthenticationSession>> {
|
|
322
|
-
return this.proxy.$getSessions(this.id, scopes);
|
|
334
|
+
async getSessions(scopes?: string[], account?: AuthenticationSessionAccountInformation): Promise<ReadonlyArray<theia.AuthenticationSession>> {
|
|
335
|
+
return this.proxy.$getSessions(this.id, scopes, { account: account });
|
|
323
336
|
}
|
|
324
337
|
|
|
325
338
|
async updateSessionItems(event: theia.AuthenticationProviderAuthenticationSessionsChangeEvent): Promise<void> {
|
|
326
339
|
const { added, removed } = event;
|
|
327
|
-
const session = await this.proxy.$getSessions(this.id);
|
|
340
|
+
const session = await this.proxy.$getSessions(this.id, undefined, {});
|
|
328
341
|
const addedSessions = added ? session.filter(s => added.some(addedSession => addedSession.id === s.id)) : [];
|
|
329
342
|
|
|
330
343
|
removed?.forEach(removedSession => {
|
|
@@ -347,16 +360,16 @@ export class AuthenticationProviderImpl implements AuthenticationProvider {
|
|
|
347
360
|
addedSessions.forEach(s => this.registerSession(s));
|
|
348
361
|
}
|
|
349
362
|
|
|
350
|
-
async login(scopes: string[]): Promise<theia.AuthenticationSession> {
|
|
351
|
-
return this.createSession(scopes);
|
|
363
|
+
async login(scopes: string[], options: AuthenticationProviderSessionOptions): Promise<theia.AuthenticationSession> {
|
|
364
|
+
return this.createSession(scopes, options);
|
|
352
365
|
}
|
|
353
366
|
|
|
354
367
|
async logout(sessionId: string): Promise<void> {
|
|
355
368
|
return this.removeSession(sessionId);
|
|
356
369
|
}
|
|
357
370
|
|
|
358
|
-
createSession(scopes: string[]): Thenable<theia.AuthenticationSession> {
|
|
359
|
-
return this.proxy.$createSession(this.id, scopes);
|
|
371
|
+
createSession(scopes: string[], options: AuthenticationProviderSessionOptions): Thenable<theia.AuthenticationSession> {
|
|
372
|
+
return this.proxy.$createSession(this.id, scopes, options);
|
|
360
373
|
}
|
|
361
374
|
|
|
362
375
|
removeSession(sessionId: string): Thenable<void> {
|