@theia/plugin 1.39.0-next.9 → 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/package.json +4 -4
- package/src/package.spec.ts +1 -1
- package/src/theia-extra.d.ts +87 -1
- package/src/theia.d.ts +109 -4
- package/src/theia.proposed.canonicalUriProvider.d.ts +64 -0
- package/src/theia.proposed.customEditorMove.d.ts +41 -0
- package/src/theia.proposed.diffCommand.d.ts +55 -0
- package/src/theia.proposed.documentPaste.d.ts +122 -0
- package/src/theia.proposed.dropMetadata.d.ts +66 -0
- package/src/{vscode.proposed.editSessionIdentityProvider.d.ts → theia.proposed.editSessionIdentityProvider.d.ts} +2 -4
- package/src/theia.proposed.extensionsAny.d.ts +57 -0
- package/src/theia.proposed.externalUriOpener.d.ts +2 -2
- package/src/theia.proposed.findTextInFiles.d.ts +178 -0
- package/src/theia.proposed.fsChunks.d.ts +32 -0
- package/src/theia.proposed.profileContentHandlers.d.ts +35 -0
- package/src/theia.proposed.resolvers.d.ts +44 -0
- package/src/theia.proposed.scmValidation.d.ts +70 -0
- package/src/theia.proposed.shareProvider.d.ts +92 -0
- package/src/theia.proposed.terminalQuickFixProvider.d.ts +90 -0
- package/src/theia.proposed.textSearchProvider.d.ts +145 -0
- package/src/theia.proposed.timeline.d.ts +177 -0
- package/src/theia-proposed.d.ts +0 -758
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "Theia - Plugin API",
|
|
5
5
|
"types": "./src/theia.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
|
-
"license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
|
|
9
|
+
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/eclipse-theia/theia.git"
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"watch": "theiaext watch"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@theia/ext-scripts": "1.
|
|
30
|
+
"@theia/ext-scripts": "1.40.0"
|
|
31
31
|
},
|
|
32
32
|
"nyc": {
|
|
33
33
|
"extends": "../../configs/nyc.json"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b2c84f963c24bde22dbdecd8c506eccc0768f400"
|
|
36
36
|
}
|
package/src/package.spec.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// with the GNU Classpath Exception which is available at
|
|
12
12
|
// https://www.gnu.org/software/classpath/license.html.
|
|
13
13
|
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
/* note: this bogus test file is required so that
|
package/src/theia-extra.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// with the GNU Classpath Exception which is available at
|
|
12
12
|
// https://www.gnu.org/software/classpath/license.html.
|
|
13
13
|
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -293,5 +293,91 @@ export module '@theia/plugin' {
|
|
|
293
293
|
readonly logUri: Uri;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
export namespace commands {
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Get the keybindings associated to commandId.
|
|
300
|
+
* @param commandId The ID of the command for which we are looking for keybindings.
|
|
301
|
+
*/
|
|
302
|
+
export function getKeyBinding(commandId: string): Thenable<CommandKeyBinding[] | undefined>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Key Binding of a command
|
|
307
|
+
*/
|
|
308
|
+
export interface CommandKeyBinding {
|
|
309
|
+
/**
|
|
310
|
+
* Identifier of the command.
|
|
311
|
+
*/
|
|
312
|
+
id: string;
|
|
313
|
+
/**
|
|
314
|
+
* Value of the keyBinding
|
|
315
|
+
*/
|
|
316
|
+
value: string;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Enumeration of the supported operating systems.
|
|
321
|
+
*/
|
|
322
|
+
export enum OperatingSystem {
|
|
323
|
+
Windows = 'Windows',
|
|
324
|
+
Linux = 'Linux',
|
|
325
|
+
OSX = 'OSX'
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export namespace env {
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Returns the type of the operating system on the client side (like browser'OS if using browser mode). If it is neither [Windows](isWindows) nor [OS X](isOSX), then
|
|
332
|
+
* it always return with the `Linux` OS type.
|
|
333
|
+
*/
|
|
334
|
+
export function getClientOperatingSystem(): Thenable<OperatingSystem>;
|
|
335
|
+
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface DecorationData {
|
|
339
|
+
letter?: string;
|
|
340
|
+
title?: string;
|
|
341
|
+
color?: ThemeColor;
|
|
342
|
+
priority?: number;
|
|
343
|
+
bubble?: boolean;
|
|
344
|
+
source?: string;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export interface SourceControl {
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Whether the source control is selected.
|
|
351
|
+
*/
|
|
352
|
+
readonly selected: boolean;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* An event signaling when the selection state changes.
|
|
356
|
+
*/
|
|
357
|
+
readonly onDidChangeSelection: Event<boolean>;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface SourceControlResourceDecorations {
|
|
361
|
+
source?: string;
|
|
362
|
+
letter?: string;
|
|
363
|
+
color?: ThemeColor;
|
|
364
|
+
}
|
|
365
|
+
|
|
296
366
|
}
|
|
297
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
|
|
370
|
+
* and others. This API makes no assumption about what promise library is being used which
|
|
371
|
+
* enables reusing existing code without migrating to a specific promise implementation. Still,
|
|
372
|
+
* we recommend the use of native promises which are available in this editor.
|
|
373
|
+
*/
|
|
374
|
+
interface Thenable<T> {
|
|
375
|
+
/**
|
|
376
|
+
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
377
|
+
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
378
|
+
* @param onrejected The callback to execute when the Promise is rejected.
|
|
379
|
+
* @returns A Promise for the completion of which ever callback is executed.
|
|
380
|
+
*/
|
|
381
|
+
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
|
|
382
|
+
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
|
|
383
|
+
}
|
package/src/theia.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// with the GNU Classpath Exception which is available at
|
|
12
12
|
// https://www.gnu.org/software/classpath/license.html.
|
|
13
13
|
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
// This file is heavily inspired by VSCode 'vscode.d.ts' - https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.d.ts
|
|
@@ -20,10 +20,25 @@
|
|
|
20
20
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
21
21
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
22
22
|
*--------------------------------------------------------------------------------------------*/
|
|
23
|
+
|
|
23
24
|
import './theia-extra';
|
|
24
|
-
import './theia
|
|
25
|
+
import './theia.proposed.canonicalUriProvider';
|
|
26
|
+
import './theia.proposed.customEditorMove';
|
|
27
|
+
import './theia.proposed.diffCommand';
|
|
28
|
+
import './theia.proposed.documentPaste';
|
|
29
|
+
import './theia.proposed.dropMetadata';
|
|
30
|
+
import './theia.proposed.editSessionIdentityProvider';
|
|
31
|
+
import './theia.proposed.extensionsAny';
|
|
25
32
|
import './theia.proposed.externalUriOpener';
|
|
26
|
-
import './
|
|
33
|
+
import './theia.proposed.findTextInFiles';
|
|
34
|
+
import './theia.proposed.fsChunks';
|
|
35
|
+
import './theia.proposed.profileContentHandlers';
|
|
36
|
+
import './theia.proposed.resolvers';
|
|
37
|
+
import './theia.proposed.scmValidation';
|
|
38
|
+
import './theia.proposed.shareProvider';
|
|
39
|
+
import './theia.proposed.terminalQuickFixProvider';
|
|
40
|
+
import './theia.proposed.textSearchProvider';
|
|
41
|
+
import './theia.proposed.timeline';
|
|
27
42
|
|
|
28
43
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
29
44
|
/* eslint-disable max-len */
|
|
@@ -7167,6 +7182,22 @@ export module '@theia/plugin' {
|
|
|
7167
7182
|
*/
|
|
7168
7183
|
export const onDidChangeNotebookDocument: Event<NotebookDocumentChangeEvent>;
|
|
7169
7184
|
|
|
7185
|
+
/**
|
|
7186
|
+
* An event that is emitted when a {@link NotebookDocument notebook document} will be saved to disk.
|
|
7187
|
+
*
|
|
7188
|
+
* *Note 1:* Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor
|
|
7189
|
+
* might save without firing this event. For instance when shutting down with dirty files.
|
|
7190
|
+
*
|
|
7191
|
+
* *Note 2:* Subscribers are called sequentially and they can {@link NotebookDocumentWillSaveEvent.waitUntil delay} saving
|
|
7192
|
+
* by registering asynchronous work. Protection against misbehaving listeners is implemented as such:
|
|
7193
|
+
* * there is an overall time budget that all listeners share and if that is exhausted no further listener is called
|
|
7194
|
+
* * listeners that take a long time or produce errors frequently will not be called anymore
|
|
7195
|
+
*
|
|
7196
|
+
* The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.
|
|
7197
|
+
* @stubbed
|
|
7198
|
+
*/
|
|
7199
|
+
export const onWillSaveNotebookDocument: Event<NotebookDocumentWillSaveEvent>;
|
|
7200
|
+
|
|
7170
7201
|
/**
|
|
7171
7202
|
* An event that is emitted when files are being created.
|
|
7172
7203
|
*
|
|
@@ -12599,6 +12630,9 @@ export module '@theia/plugin' {
|
|
|
12599
12630
|
|
|
12600
12631
|
/** Controls whether the terminal is cleared before executing the task. */
|
|
12601
12632
|
clear?: boolean;
|
|
12633
|
+
|
|
12634
|
+
/** Controls whether the terminal is closed after executing the task. */
|
|
12635
|
+
close?: boolean;
|
|
12602
12636
|
}
|
|
12603
12637
|
|
|
12604
12638
|
/**
|
|
@@ -13637,6 +13671,17 @@ export module '@theia/plugin' {
|
|
|
13637
13671
|
readonly label: string;
|
|
13638
13672
|
}
|
|
13639
13673
|
|
|
13674
|
+
/**
|
|
13675
|
+
* Optional options to be used when calling {@link authentication.getSession} with the flag `forceNewSession`.
|
|
13676
|
+
*/
|
|
13677
|
+
export interface AuthenticationForceNewSessionOptions {
|
|
13678
|
+
/**
|
|
13679
|
+
* An optional message that will be displayed to the user when we ask to re-authenticate. Providing additional context
|
|
13680
|
+
* as to why you are asking a user to re-authenticate can help increase the odds that they will accept.
|
|
13681
|
+
*/
|
|
13682
|
+
detail?: string;
|
|
13683
|
+
}
|
|
13684
|
+
|
|
13640
13685
|
/**
|
|
13641
13686
|
* Options to be used when getting an {@link AuthenticationSession AuthenticationSession} from an {@link AuthenticationProvider AuthenticationProvider}.
|
|
13642
13687
|
*/
|
|
@@ -13671,7 +13716,7 @@ export module '@theia/plugin' {
|
|
|
13671
13716
|
*
|
|
13672
13717
|
* Defaults to false.
|
|
13673
13718
|
*/
|
|
13674
|
-
forceNewSession?: boolean |
|
|
13719
|
+
forceNewSession?: boolean | AuthenticationForceNewSessionOptions;
|
|
13675
13720
|
|
|
13676
13721
|
/**
|
|
13677
13722
|
* Whether we should show the indication to sign in in the Accounts menu.
|
|
@@ -14714,6 +14759,66 @@ export module '@theia/plugin' {
|
|
|
14714
14759
|
readonly cellChanges: readonly NotebookDocumentCellChange[];
|
|
14715
14760
|
}
|
|
14716
14761
|
|
|
14762
|
+
/**
|
|
14763
|
+
* An event that is fired when a {@link NotebookDocument notebook document} will be saved.
|
|
14764
|
+
*
|
|
14765
|
+
* To make modifications to the document before it is being saved, call the
|
|
14766
|
+
* {@linkcode NotebookDocumentWillSaveEvent.waitUntil waitUntil}-function with a thenable
|
|
14767
|
+
* that resolves to a {@link WorkspaceEdit workspace edit}.
|
|
14768
|
+
*/
|
|
14769
|
+
export interface NotebookDocumentWillSaveEvent {
|
|
14770
|
+
/**
|
|
14771
|
+
* A cancellation token.
|
|
14772
|
+
* @stubbed
|
|
14773
|
+
*/
|
|
14774
|
+
readonly token: CancellationToken;
|
|
14775
|
+
|
|
14776
|
+
/**
|
|
14777
|
+
* The {@link NotebookDocument notebook document} that will be saved.
|
|
14778
|
+
* @stubbed
|
|
14779
|
+
*/
|
|
14780
|
+
readonly notebook: NotebookDocument;
|
|
14781
|
+
|
|
14782
|
+
/**
|
|
14783
|
+
* The reason why save was triggered.
|
|
14784
|
+
* @stubbed
|
|
14785
|
+
*/
|
|
14786
|
+
readonly reason: TextDocumentSaveReason;
|
|
14787
|
+
|
|
14788
|
+
/**
|
|
14789
|
+
* Allows to pause the event loop and to apply {@link WorkspaceEdit workspace edit}.
|
|
14790
|
+
* Edits of subsequent calls to this function will be applied in order. The
|
|
14791
|
+
* edits will be *ignored* if concurrent modifications of the notebook document happened.
|
|
14792
|
+
*
|
|
14793
|
+
* *Note:* This function can only be called during event dispatch and not
|
|
14794
|
+
* in an asynchronous manner:
|
|
14795
|
+
*
|
|
14796
|
+
* ```ts
|
|
14797
|
+
* workspace.onWillSaveNotebookDocument(event => {
|
|
14798
|
+
* // async, will *throw* an error
|
|
14799
|
+
* setTimeout(() => event.waitUntil(promise));
|
|
14800
|
+
*
|
|
14801
|
+
* // sync, OK
|
|
14802
|
+
* event.waitUntil(promise);
|
|
14803
|
+
* })
|
|
14804
|
+
* ```
|
|
14805
|
+
*
|
|
14806
|
+
* @param thenable A thenable that resolves to {@link WorkspaceEdit workspace edit}.
|
|
14807
|
+
* @stubbed
|
|
14808
|
+
*/
|
|
14809
|
+
waitUntil(thenable: Thenable<WorkspaceEdit>): void;
|
|
14810
|
+
|
|
14811
|
+
/**
|
|
14812
|
+
* Allows to pause the event loop until the provided thenable resolved.
|
|
14813
|
+
*
|
|
14814
|
+
* *Note:* This function can only be called during event dispatch.
|
|
14815
|
+
*
|
|
14816
|
+
* @param thenable A thenable that delays saving.
|
|
14817
|
+
* @stubbed
|
|
14818
|
+
*/
|
|
14819
|
+
waitUntil(thenable: Thenable<any>): void;
|
|
14820
|
+
}
|
|
14821
|
+
|
|
14717
14822
|
/**
|
|
14718
14823
|
* The summary of a notebook cell execution.
|
|
14719
14824
|
*/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 STMicroelectronics and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
/*---------------------------------------------------------------------------------------------
|
|
17
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
19
|
+
*--------------------------------------------------------------------------------------------*/
|
|
20
|
+
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.79.0/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts
|
|
22
|
+
|
|
23
|
+
export module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
// https://github.com/microsoft/vscode/issues/180582
|
|
26
|
+
|
|
27
|
+
export namespace workspace {
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param scheme The URI scheme that this provider can provide canonical URIs for.
|
|
31
|
+
* A canonical URI represents the conversion of a resource's alias into a source of truth URI.
|
|
32
|
+
* Multiple aliases may convert to the same source of truth URI.
|
|
33
|
+
* @param provider A provider which can convert URIs of scheme @param scheme to
|
|
34
|
+
* a canonical URI which is stable across machines.
|
|
35
|
+
*/
|
|
36
|
+
export function registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): Disposable;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param uri The URI to provide a canonical URI for.
|
|
41
|
+
* @param token A cancellation token for the request.
|
|
42
|
+
*/
|
|
43
|
+
export function getCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CanonicalUriProvider {
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param uri The URI to provide a canonical URI for.
|
|
50
|
+
* @param options Options that the provider should honor in the URI it returns.
|
|
51
|
+
* @param token A cancellation token for the request.
|
|
52
|
+
* @returns The canonical URI for the requested URI or undefined if no canonical URI can be provided.
|
|
53
|
+
*/
|
|
54
|
+
provideCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface CanonicalUriRequestOptions {
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* The desired scheme of the canonical URI.
|
|
61
|
+
*/
|
|
62
|
+
targetScheme: string;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.customEditorMove.d.ts
|
|
22
|
+
|
|
23
|
+
export module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
export interface CustomTextEditorProvider {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Handle when the underlying resource for a custom editor is renamed.
|
|
29
|
+
*
|
|
30
|
+
* This allows the webview for the editor be preserved throughout the rename. If this method is not implemented,
|
|
31
|
+
* the editor will destroy the previous custom editor and create a replacement one.
|
|
32
|
+
*
|
|
33
|
+
* @param newDocument New text document to use for the custom editor.
|
|
34
|
+
* @param existingWebviewPanel Webview panel for the custom editor.
|
|
35
|
+
* @param token A cancellation token that indicates the result is no longer needed.
|
|
36
|
+
*
|
|
37
|
+
* @return Thenable indicating that the webview editor has been moved.
|
|
38
|
+
*/
|
|
39
|
+
moveCustomTextEditor?(newDocument: TextDocument, existingWebviewPanel: WebviewPanel, token: CancellationToken): Thenable<void>;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.diffCommand.d.ts
|
|
22
|
+
|
|
23
|
+
export module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The contiguous set of modified lines in a diff.
|
|
27
|
+
*/
|
|
28
|
+
export interface LineChange {
|
|
29
|
+
readonly originalStartLineNumber: number;
|
|
30
|
+
readonly originalEndLineNumber: number;
|
|
31
|
+
readonly modifiedStartLineNumber: number;
|
|
32
|
+
readonly modifiedEndLineNumber: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export namespace commands {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Registers a diff information command that can be invoked via a keyboard shortcut,
|
|
39
|
+
* a menu item, an action, or directly.
|
|
40
|
+
*
|
|
41
|
+
* Diff information commands are different from ordinary {@link commands.registerCommand commands} as
|
|
42
|
+
* they only execute when there is an active diff editor when the command is called, and the diff
|
|
43
|
+
* information has been computed. Also, the command handler of an editor command has access to
|
|
44
|
+
* the diff information.
|
|
45
|
+
*
|
|
46
|
+
* @param command A unique identifier for the command.
|
|
47
|
+
* @param callback A command handler function with access to the {@link LineChange diff information}.
|
|
48
|
+
* @param thisArg The `this` context used when invoking the handler function.
|
|
49
|
+
* @return Disposable which unregisters this command on disposal.
|
|
50
|
+
*/
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.79.0/src/vscode-dts/vscode.proposed.documentPaste.d.ts
|
|
22
|
+
|
|
23
|
+
export module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Provider invoked when the user copies and pastes code.
|
|
27
|
+
*/
|
|
28
|
+
export interface DocumentPasteEditProvider {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Optional method invoked after the user copies text in a file.
|
|
32
|
+
*
|
|
33
|
+
* During {@link prepareDocumentPaste}, an extension can compute metadata that is attached to
|
|
34
|
+
* a {@link DataTransfer} and is passed back to the provider in {@link provideDocumentPasteEdits}.
|
|
35
|
+
*
|
|
36
|
+
* @param document Document where the copy took place.
|
|
37
|
+
* @param ranges Ranges being copied in the `document`.
|
|
38
|
+
* @param dataTransfer The data transfer associated with the copy. You can store additional values on this for later use in {@link provideDocumentPasteEdits}.
|
|
39
|
+
* @param token A cancellation token.
|
|
40
|
+
*/
|
|
41
|
+
prepareDocumentPaste?(document: TextDocument, ranges: readonly Range[], dataTransfer: DataTransfer, token: CancellationToken): void | Thenable<void>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Invoked before the user pastes into a document.
|
|
45
|
+
*
|
|
46
|
+
* In this method, extensions can return a workspace edit that replaces the standard pasting behavior.
|
|
47
|
+
*
|
|
48
|
+
* @param document Document being pasted into
|
|
49
|
+
* @param ranges Currently selected ranges in the document.
|
|
50
|
+
* @param dataTransfer The data transfer associated with the paste.
|
|
51
|
+
* @param token A cancellation token.
|
|
52
|
+
*
|
|
53
|
+
* @return Optional workspace edit that applies the paste. Return undefined to use standard pasting.
|
|
54
|
+
*/
|
|
55
|
+
provideDocumentPasteEdits?(document: TextDocument, ranges: readonly Range[], dataTransfer: DataTransfer, token: CancellationToken): ProviderResult<DocumentPasteEdit>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* An operation applied on paste
|
|
60
|
+
*/
|
|
61
|
+
class DocumentPasteEdit {
|
|
62
|
+
/**
|
|
63
|
+
* Identifies the type of edit.
|
|
64
|
+
*
|
|
65
|
+
* This id should be unique within the extension but does not need to be unique across extensions.
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Human readable label that describes the edit.
|
|
71
|
+
*/
|
|
72
|
+
label: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The relative priority of this edit. Higher priority items are shown first in the UI.
|
|
76
|
+
*
|
|
77
|
+
* Defaults to `0`.
|
|
78
|
+
*/
|
|
79
|
+
priority?: number;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The text or snippet to insert at the pasted locations.
|
|
83
|
+
*/
|
|
84
|
+
insertText: string | SnippetString;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* An optional additional edit to apply on paste.
|
|
88
|
+
*/
|
|
89
|
+
additionalEdit?: WorkspaceEdit;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param insertText The text or snippet to insert at the pasted locations.
|
|
93
|
+
*
|
|
94
|
+
* TODO: Reverse args, but this will break existing consumers :(
|
|
95
|
+
*/
|
|
96
|
+
constructor(insertText: string | SnippetString, id: string, label: string);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface DocumentPasteProviderMetadata {
|
|
100
|
+
/**
|
|
101
|
+
* Mime types that {@link DocumentPasteEditProvider.prepareDocumentPaste provideDocumentPasteEdits} may add on copy.
|
|
102
|
+
*/
|
|
103
|
+
readonly copyMimeTypes?: readonly string[];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Mime types that {@link DocumentPasteEditProvider.provideDocumentPasteEdits provideDocumentPasteEdits} should be invoked for.
|
|
107
|
+
*
|
|
108
|
+
* This can either be an exact mime type such as `image/png`, or a wildcard pattern such as `image/*`.
|
|
109
|
+
*
|
|
110
|
+
* Use `text/uri-list` for resources dropped from the explorer or other tree views in the workbench.
|
|
111
|
+
*
|
|
112
|
+
* Use `files` to indicate that the provider should be invoked if any {@link DataTransferFile files} are present in the {@link DataTransfer}.
|
|
113
|
+
* Note that {@link DataTransferFile} entries are only created when dropping content from outside the editor, such as
|
|
114
|
+
* from the operating system.
|
|
115
|
+
*/
|
|
116
|
+
readonly pasteMimeTypes?: readonly string[];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
namespace languages {
|
|
120
|
+
export function registerDocumentPasteEditProvider(selector: DocumentSelector, provider: DocumentPasteEditProvider, metadata: DocumentPasteProviderMetadata): Disposable;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
19
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.79.0/src/vscode-dts/vscode.proposed.dropMetadata.d.ts
|
|
22
|
+
|
|
23
|
+
export module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
// https://github.com/microsoft/vscode/issues/179430
|
|
26
|
+
|
|
27
|
+
export interface DocumentDropEdit {
|
|
28
|
+
/**
|
|
29
|
+
* Identifies the type of edit.
|
|
30
|
+
*
|
|
31
|
+
* This id should be unique within the extension but does not need to be unique across extensions.
|
|
32
|
+
*/
|
|
33
|
+
id?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The relative priority of this edit. Higher priority items are shown first in the UI.
|
|
37
|
+
*
|
|
38
|
+
* Defaults to `0`.
|
|
39
|
+
*/
|
|
40
|
+
priority?: number;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Human readable label that describes the edit.
|
|
44
|
+
*/
|
|
45
|
+
label?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DocumentDropEditProviderMetadata {
|
|
49
|
+
/**
|
|
50
|
+
* List of data transfer types that the provider supports.
|
|
51
|
+
*
|
|
52
|
+
* This can either be an exact mime type such as `image/png`, or a wildcard pattern such as `image/*`.
|
|
53
|
+
*
|
|
54
|
+
* Use `text/uri-list` for resources dropped from the explorer or other tree views in the workbench.
|
|
55
|
+
*
|
|
56
|
+
* Use `files` to indicate that the provider should be invoked if any {@link DataTransferFile files} are present in the {@link DataTransfer}.
|
|
57
|
+
* Note that {@link DataTransferFile} entries are only created when dropping content from outside the editor, such as
|
|
58
|
+
* from the operating system.
|
|
59
|
+
*/
|
|
60
|
+
readonly dropMimeTypes: readonly string[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export namespace languages {
|
|
64
|
+
export function registerDocumentDropEditProvider(selector: DocumentSelector, provider: DocumentDropEditProvider, metadata?: DocumentDropEditProviderMetadata): Disposable;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -11,16 +11,14 @@
|
|
|
11
11
|
// with the GNU Classpath Exception which is available at
|
|
12
12
|
// https://www.gnu.org/software/classpath/license.html.
|
|
13
13
|
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
// Copied from: https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts
|
|
18
|
-
// and slightly adapted to work in Theia
|
|
19
|
-
|
|
20
17
|
/*---------------------------------------------------------------------------------------------
|
|
21
18
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
22
19
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
23
20
|
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts
|
|
24
22
|
|
|
25
23
|
export module '@theia/plugin' {
|
|
26
24
|
|