@theia/plugin 1.45.1 → 1.46.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.45.1",
3
+ "version": "1.46.0",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -27,10 +27,10 @@
27
27
  "watch": "theiaext watch"
28
28
  },
29
29
  "devDependencies": {
30
- "@theia/ext-scripts": "1.45.1"
30
+ "@theia/ext-scripts": "1.46.0"
31
31
  },
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "3837c50544190b80d0ad8e87aa9fa9f286c70fcc"
35
+ "gitHead": "90ba9de68f5912773ae9e26fcffeb671c0ab43d2"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -35,6 +35,7 @@ import './theia.proposed.notebookKernelSource';
35
35
  import './theia.proposed.notebookMessaging';
36
36
  import './theia.proposed.findTextInFiles';
37
37
  import './theia.proposed.fsChunks';
38
+ import './theia.proposed.multiDocumentHighlightProvider';
38
39
  import './theia.proposed.profileContentHandlers';
39
40
  import './theia.proposed.resolvers';
40
41
  import './theia.proposed.scmValidation';
@@ -3042,10 +3043,11 @@ export module '@theia/plugin' {
3042
3043
 
3043
3044
  /**
3044
3045
  * Send text to the terminal.
3045
- * @param text - text content.
3046
- * @param addNewLine - in case true - apply new line after the text, otherwise don't apply new line. This defaults to `true`.
3046
+ * @param text - The text to send.
3047
+ * @param shouldExecute - Indicates that the text being sent should be executed rather than just inserted in the terminal.
3048
+ * The character added is \r, independent from the platform (compared to platform specific in vscode). This defaults to `true`.
3047
3049
  */
3048
- sendText(text: string, addNewLine?: boolean): void;
3050
+ sendText(text: string, shouldExecute?: boolean): void;
3049
3051
 
3050
3052
  /**
3051
3053
  * Show created terminal on the UI.
@@ -0,0 +1,82 @@
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
+ /*---------------------------------------------------------------------------------------------
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.85.1/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts
22
+
23
+ declare module '@theia/plugin' {
24
+
25
+ /**
26
+ * Represents a collection of document highlights from multiple documents.
27
+ */
28
+ export class MultiDocumentHighlight {
29
+
30
+ /**
31
+ * The URI of the document containing the highlights.
32
+ */
33
+ uri: Uri;
34
+
35
+ /**
36
+ * The highlights for the document.
37
+ */
38
+ highlights: DocumentHighlight[];
39
+
40
+ /**
41
+ * Creates a new instance of MultiDocumentHighlight.
42
+ * @param uri The URI of the document containing the highlights.
43
+ * @param highlights The highlights for the document.
44
+ */
45
+ constructor(uri: Uri, highlights: DocumentHighlight[]);
46
+ }
47
+
48
+ export interface MultiDocumentHighlightProvider {
49
+
50
+ /**
51
+ * Provide a set of document highlights, like all occurrences of a variable or
52
+ * all exit-points of a function.
53
+ *
54
+ * @param document The document in which the command was invoked.
55
+ * @param position The position at which the command was invoked.
56
+ * @param otherDocuments An array of additional valid documents for which highlights should be provided.
57
+ * @param token A cancellation token.
58
+ * @returns A Map containing a mapping of the Uri of a document to the document highlights or a thenable that resolves to such. The lack of a result can be
59
+ * signaled by returning `undefined`, `null`, or an empty map.
60
+ */
61
+ provideMultiDocumentHighlights(document: TextDocument, position: Position, otherDocuments: TextDocument[], token: CancellationToken):
62
+ ProviderResult<MultiDocumentHighlight[]>;
63
+ }
64
+
65
+ namespace languages {
66
+
67
+ /**
68
+ * Register a multi document highlight provider.
69
+ *
70
+ * Multiple providers can be registered for a language. In that case providers are sorted
71
+ * by their {@link languages.match score} and groups sequentially asked for document highlights.
72
+ * The process stops when a provider returns a `non-falsy` or `non-failure` result.
73
+ *
74
+ * @param selector A selector that defines the documents this provider is applicable to.
75
+ * @param provider A multi-document highlight provider.
76
+ * @returns A {@link Disposable} that unregisters this provider when being disposed.
77
+ * @stubbed
78
+ */
79
+ export function registerMultiDocumentHighlightProvider(selector: DocumentSelector, provider: MultiDocumentHighlightProvider): Disposable;
80
+ }
81
+
82
+ }
@@ -40,7 +40,7 @@ export module '@theia/plugin' {
40
40
  * @return Terminal quick fix(es) if any
41
41
  */
42
42
  provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token: CancellationToken):
43
- ProviderResult<SingleOrMany<TerminalQuickFixExecuteTerminalCommand | TerminalQuickFixOpener | Command>>;
43
+ ProviderResult<SingleOrMany<TerminalQuickFixTerminalCommand | TerminalQuickFixOpener | Command>>;
44
44
  }
45
45
 
46
46
  export interface TerminalCommandMatchResult {
@@ -52,12 +52,16 @@ export module '@theia/plugin' {
52
52
  };
53
53
  }
54
54
 
55
- export class TerminalQuickFixExecuteTerminalCommand {
55
+ export class TerminalQuickFixTerminalCommand {
56
56
  /**
57
- * The terminal command to run
57
+ * The terminal command to insert or run
58
58
  */
59
59
  terminalCommand: string;
60
- constructor(terminalCommand: string);
60
+ /**
61
+ * Whether the command should be executed or just inserted (default)
62
+ */
63
+ shouldExecute?: boolean;
64
+ constructor(terminalCommand: string, shouldExecute?: boolean);
61
65
  }
62
66
  export class TerminalQuickFixOpener {
63
67
  /**