@theia/plugin 1.56.0 → 1.57.0-next.136
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.
|
@@ -28,6 +28,20 @@ export module '@theia/plugin' {
|
|
|
28
28
|
class DocumentDropOrPasteEditKind {
|
|
29
29
|
static readonly Empty: DocumentDropOrPasteEditKind;
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* The root kind for basic text edits.
|
|
33
|
+
*
|
|
34
|
+
* This kind should be used for edits that insert basic text into the document. A good example of this is
|
|
35
|
+
* an edit that pastes the clipboard text while also updating imports in the file based on the pasted text.
|
|
36
|
+
* For this we could use a kind such as `text.updateImports.someLanguageId`.
|
|
37
|
+
*
|
|
38
|
+
* Even though most drop/paste edits ultimately insert text, you should not use {@linkcode Text} as the base kind
|
|
39
|
+
* for every edit as this is redundant. Instead a more specific kind that describes the type of content being
|
|
40
|
+
* inserted should be used instead For example, if the edit adds a Markdown link, use `markdown.link` since even
|
|
41
|
+
* though the content being inserted is text, it's more important to know that the edit inserts Markdown syntax.
|
|
42
|
+
*/
|
|
43
|
+
static readonly Text: DocumentDropOrPasteEditKind;
|
|
44
|
+
|
|
31
45
|
private constructor(value: string);
|
|
32
46
|
|
|
33
47
|
/**
|
|
@@ -45,7 +45,7 @@ export module '@theia/plugin' {
|
|
|
45
45
|
* The conversation that led to the current code block(s).
|
|
46
46
|
* The last conversation part contains the code block(s) for which the code mapper should provide edits.
|
|
47
47
|
*/
|
|
48
|
-
readonly conversation?:
|
|
48
|
+
readonly conversation?: Array<ConversationRequest | ConversationResponse>;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -72,7 +72,7 @@ export module '@theia/plugin' {
|
|
|
72
72
|
export interface MappedEditsRequest {
|
|
73
73
|
readonly codeBlocks: { code: string; resource: Uri; markdownBeforeBlock?: string }[];
|
|
74
74
|
// for every prior response that contains codeblocks, make sure we pass the code as well as the resources based on the reported codemapper URIs
|
|
75
|
-
readonly conversation:
|
|
75
|
+
readonly conversation: Array<ConversationRequest | ConversationResponse>;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
export interface MappedEditsResponseStream {
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2025 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.96.2/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts
|
|
22
|
+
|
|
23
|
+
declare module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
// https://github.com/microsoft/vscode/issues/226562
|
|
26
|
+
|
|
27
|
+
export interface TerminalCompletionProvider<T extends TerminalCompletionItem> {
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* Provide completions for the given position and document.
|
|
31
|
+
* @param terminal The terminal for which completions are being provided.
|
|
32
|
+
* @param context Information about the terminal's current state.
|
|
33
|
+
* @param token A cancellation token.
|
|
34
|
+
* @return A list of completions.
|
|
35
|
+
*/
|
|
36
|
+
provideTerminalCompletions(terminal: Terminal, context: TerminalCompletionContext, token: CancellationToken): ProviderResult<T[] | TerminalCompletionList<T>>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface TerminalCompletionItem {
|
|
40
|
+
/**
|
|
41
|
+
* The label of the completion.
|
|
42
|
+
*/
|
|
43
|
+
label: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The index of the start of the range to replace.
|
|
47
|
+
*/
|
|
48
|
+
replacementIndex: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The length of the range to replace.
|
|
52
|
+
*/
|
|
53
|
+
replacementLength: number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The completion's detail which appears on the right of the list.
|
|
57
|
+
*/
|
|
58
|
+
detail?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The completion's kind. Note that this will map to an icon.
|
|
62
|
+
*/
|
|
63
|
+
kind?: TerminalCompletionItemKind;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Terminal item kinds.
|
|
68
|
+
*/
|
|
69
|
+
export enum TerminalCompletionItemKind {
|
|
70
|
+
File = 0,
|
|
71
|
+
Folder = 1,
|
|
72
|
+
Flag = 2,
|
|
73
|
+
Method = 3,
|
|
74
|
+
Argument = 4
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface TerminalCompletionContext {
|
|
78
|
+
/**
|
|
79
|
+
* The complete terminal command line.
|
|
80
|
+
*/
|
|
81
|
+
commandLine: string;
|
|
82
|
+
/**
|
|
83
|
+
* The index of the
|
|
84
|
+
* cursor in the command line.
|
|
85
|
+
*/
|
|
86
|
+
cursorPosition: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export namespace window {
|
|
90
|
+
/**
|
|
91
|
+
* Register a completion provider for a certain type of terminal.
|
|
92
|
+
*
|
|
93
|
+
* @param provider The completion provider.
|
|
94
|
+
* @returns A {@link Disposable} that unregisters this provider when being disposed.
|
|
95
|
+
* @stubbed
|
|
96
|
+
*/
|
|
97
|
+
export function registerTerminalCompletionProvider<T extends TerminalCompletionItem>(provider: TerminalCompletionProvider<T>, ...triggerCharacters: string[]): Disposable;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Represents a collection of {@link TerminalCompletionItem completion items} to be presented
|
|
102
|
+
* in the terminal.
|
|
103
|
+
*/
|
|
104
|
+
export class TerminalCompletionList<T extends TerminalCompletionItem = TerminalCompletionItem> {
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Resources that should be shown in the completions list for the cwd of the terminal.
|
|
108
|
+
*/
|
|
109
|
+
resourceRequestConfig?: TerminalResourceRequestConfig;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The completion items.
|
|
113
|
+
*/
|
|
114
|
+
items: T[];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Creates a new completion list.
|
|
118
|
+
*
|
|
119
|
+
* @param items The completion items.
|
|
120
|
+
* @param resourceRequestConfig Indicates which resources should be shown as completions for the cwd of the terminal.
|
|
121
|
+
*/
|
|
122
|
+
constructor(items?: T[], resourceRequestConfig?: TerminalResourceRequestConfig);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface TerminalResourceRequestConfig {
|
|
126
|
+
/**
|
|
127
|
+
* Show files as completion items.
|
|
128
|
+
*/
|
|
129
|
+
filesRequested?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Show folders as completion items.
|
|
132
|
+
*/
|
|
133
|
+
foldersRequested?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* If no cwd is provided, no resources will be shown as completions.
|
|
136
|
+
*/
|
|
137
|
+
cwd?: Uri;
|
|
138
|
+
/**
|
|
139
|
+
* The path separator to use when constructing paths.
|
|
140
|
+
*/
|
|
141
|
+
pathSeparator: string;
|
|
142
|
+
}
|
|
143
|
+
}
|