@theia/plugin 1.39.0-next.13 → 1.39.0-next.16

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 CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.39.0-next.13+6d8affb92",
3
+ "version": "1.39.0-next.16+fbb02df76",
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"
@@ -32,5 +32,5 @@
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "6d8affb9233b49efbd099ea11315b407a452e4f6"
35
+ "gitHead": "fbb02df763b115c12e2d68babf33aac3a781b449"
36
36
  }
@@ -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
@@ -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 */
@@ -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 */
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
@@ -7167,6 +7167,22 @@ export module '@theia/plugin' {
7167
7167
  */
7168
7168
  export const onDidChangeNotebookDocument: Event<NotebookDocumentChangeEvent>;
7169
7169
 
7170
+ /**
7171
+ * An event that is emitted when a {@link NotebookDocument notebook document} will be saved to disk.
7172
+ *
7173
+ * *Note 1:* Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor
7174
+ * might save without firing this event. For instance when shutting down with dirty files.
7175
+ *
7176
+ * *Note 2:* Subscribers are called sequentially and they can {@link NotebookDocumentWillSaveEvent.waitUntil delay} saving
7177
+ * by registering asynchronous work. Protection against misbehaving listeners is implemented as such:
7178
+ * * there is an overall time budget that all listeners share and if that is exhausted no further listener is called
7179
+ * * listeners that take a long time or produce errors frequently will not be called anymore
7180
+ *
7181
+ * The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.
7182
+ * @stubbed
7183
+ */
7184
+ export const onWillSaveNotebookDocument: Event<NotebookDocumentWillSaveEvent>;
7185
+
7170
7186
  /**
7171
7187
  * An event that is emitted when files are being created.
7172
7188
  *
@@ -14714,6 +14730,66 @@ export module '@theia/plugin' {
14714
14730
  readonly cellChanges: readonly NotebookDocumentCellChange[];
14715
14731
  }
14716
14732
 
14733
+ /**
14734
+ * An event that is fired when a {@link NotebookDocument notebook document} will be saved.
14735
+ *
14736
+ * To make modifications to the document before it is being saved, call the
14737
+ * {@linkcode NotebookDocumentWillSaveEvent.waitUntil waitUntil}-function with a thenable
14738
+ * that resolves to a {@link WorkspaceEdit workspace edit}.
14739
+ */
14740
+ export interface NotebookDocumentWillSaveEvent {
14741
+ /**
14742
+ * A cancellation token.
14743
+ * @stubbed
14744
+ */
14745
+ readonly token: CancellationToken;
14746
+
14747
+ /**
14748
+ * The {@link NotebookDocument notebook document} that will be saved.
14749
+ * @stubbed
14750
+ */
14751
+ readonly notebook: NotebookDocument;
14752
+
14753
+ /**
14754
+ * The reason why save was triggered.
14755
+ * @stubbed
14756
+ */
14757
+ readonly reason: TextDocumentSaveReason;
14758
+
14759
+ /**
14760
+ * Allows to pause the event loop and to apply {@link WorkspaceEdit workspace edit}.
14761
+ * Edits of subsequent calls to this function will be applied in order. The
14762
+ * edits will be *ignored* if concurrent modifications of the notebook document happened.
14763
+ *
14764
+ * *Note:* This function can only be called during event dispatch and not
14765
+ * in an asynchronous manner:
14766
+ *
14767
+ * ```ts
14768
+ * workspace.onWillSaveNotebookDocument(event => {
14769
+ * // async, will *throw* an error
14770
+ * setTimeout(() => event.waitUntil(promise));
14771
+ *
14772
+ * // sync, OK
14773
+ * event.waitUntil(promise);
14774
+ * })
14775
+ * ```
14776
+ *
14777
+ * @param thenable A thenable that resolves to {@link WorkspaceEdit workspace edit}.
14778
+ * @stubbed
14779
+ */
14780
+ waitUntil(thenable: Thenable<WorkspaceEdit>): void;
14781
+
14782
+ /**
14783
+ * Allows to pause the event loop until the provided thenable resolved.
14784
+ *
14785
+ * *Note:* This function can only be called during event dispatch.
14786
+ *
14787
+ * @param thenable A thenable that delays saving.
14788
+ * @stubbed
14789
+ */
14790
+ waitUntil(thenable: Thenable<any>): void;
14791
+ }
14792
+
14717
14793
  /**
14718
14794
  * The summary of a notebook cell execution.
14719
14795
  */
@@ -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
  /*---------------------------------------------------------------------------------------------
@@ -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
  // Copied from: https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts