@theia/plugin 1.46.0-next.181 → 1.46.0-next.196
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.46.0-next.
|
|
3
|
+
"version": "1.46.0-next.196+cb2bd96b3",
|
|
4
4
|
"description": "Theia - Plugin API",
|
|
5
5
|
"types": "./src/theia.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"nyc": {
|
|
33
33
|
"extends": "../../configs/nyc.json"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "cb2bd96b362408c90179005a5b415ddbd452ce41"
|
|
36
36
|
}
|
package/src/theia.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ import './theia.proposed.dropMetadata';
|
|
|
30
30
|
import './theia.proposed.editSessionIdentityProvider';
|
|
31
31
|
import './theia.proposed.extensionsAny';
|
|
32
32
|
import './theia.proposed.externalUriOpener';
|
|
33
|
+
import './theia.proposed.mappedEditsProvider';
|
|
33
34
|
import './theia.proposed.notebookCellExecutionState';
|
|
34
35
|
import './theia.proposed.notebookKernelSource';
|
|
35
36
|
import './theia.proposed.notebookMessaging';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 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
|
+
|
|
22
|
+
export module '@theia/plugin' {
|
|
23
|
+
|
|
24
|
+
export interface DocumentContextItem {
|
|
25
|
+
readonly uri: Uri;
|
|
26
|
+
readonly version: number;
|
|
27
|
+
readonly ranges: Range[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface MappedEditsContext {
|
|
31
|
+
documents: DocumentContextItem[][];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Interface for providing mapped edits for a given document.
|
|
36
|
+
*/
|
|
37
|
+
export interface MappedEditsProvider {
|
|
38
|
+
/**
|
|
39
|
+
* Provide mapped edits for a given document.
|
|
40
|
+
* @param document The document to provide mapped edits for.
|
|
41
|
+
* @param codeBlocks Code blocks that come from an LLM's reply.
|
|
42
|
+
* "Insert at cursor" in the panel chat only sends one edit that the user clicks on, but inline chat can send multiple blocks
|
|
43
|
+
* and let the lang server decide what to do with them.
|
|
44
|
+
* @param context The context for providing mapped edits.
|
|
45
|
+
* @param token A cancellation token.
|
|
46
|
+
* @returns A provider result of text edits.
|
|
47
|
+
*/
|
|
48
|
+
provideMappedEdits(
|
|
49
|
+
document: TextDocument,
|
|
50
|
+
codeBlocks: string[],
|
|
51
|
+
context: MappedEditsContext,
|
|
52
|
+
token: CancellationToken
|
|
53
|
+
): ProviderResult<WorkspaceEdit | null>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export namespace chat {
|
|
57
|
+
export function registerMappedEditsProvider(documentSelector: DocumentSelector, provider: MappedEditsProvider): Disposable;
|
|
58
|
+
}
|
|
59
|
+
}
|