deploy: current vibn theia state
Made-with: Cursor
This commit is contained in:
28
packages/plugin/src/package.spec.ts
Normal file
28
packages/plugin/src/package.spec.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2018 Red Hat, Inc. and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/* note: this bogus test file is required so that
|
||||
we are able to run mocha unit tests on this
|
||||
package, without having any actual unit tests in it.
|
||||
This way a coverage report will be generated,
|
||||
showing 0% coverage, instead of no report.
|
||||
This file can be removed once we have real unit
|
||||
tests in place. */
|
||||
|
||||
describe('plugin package', () => {
|
||||
|
||||
it('support code coverage statistics', () => true);
|
||||
});
|
||||
417
packages/plugin/src/theia-extra.d.ts
vendored
Normal file
417
packages/plugin/src/theia-extra.d.ts
vendored
Normal file
@@ -0,0 +1,417 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2022 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
/**
|
||||
* This is the place for extra APIs Theia supports compared to VS Code.
|
||||
*/
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export interface WebviewPanel {
|
||||
/**
|
||||
* Show the webview panel according to a given options.
|
||||
*
|
||||
* A webview panel may only show in a single column at a time. If it is already showing, this
|
||||
* method moves it to a new column.
|
||||
*
|
||||
* @param area target area where webview panel will be resided. Shows in the 'WebviewPanelTargetArea.Main' area if undefined.
|
||||
* @param viewColumn View column to show the panel in. Shows in the current `viewColumn` if undefined.
|
||||
* @param preserveFocus When `true`, the webview will not take focus.
|
||||
*/
|
||||
reveal(area?: WebviewPanelTargetArea, viewColumn?: ViewColumn, preserveFocus?: boolean): void;
|
||||
}
|
||||
|
||||
export type PluginType = 'frontend' | 'backend';
|
||||
|
||||
/**
|
||||
* Namespace for dealing with installed plug-ins. Plug-ins are represented
|
||||
* by an [plug-in](#Plugin)-interface which enables reflection on them.
|
||||
*
|
||||
* Plug-in writers can provide APIs to other plug-ins by returning their API public
|
||||
* surface from the `start`-call.
|
||||
*
|
||||
* ```javascript
|
||||
* export function start() {
|
||||
* let api = {
|
||||
* sum(a, b) {
|
||||
* return a + b;
|
||||
* },
|
||||
* mul(a, b) {
|
||||
* return a * b;
|
||||
* }
|
||||
* };
|
||||
* // 'export' public api-surface
|
||||
* return api;
|
||||
* }
|
||||
* ```
|
||||
* ```javascript
|
||||
* let mathExt = plugins.getPlugin('genius.math');
|
||||
* let importedApi = mathExt.exports;
|
||||
*
|
||||
* console.log(importedApi.mul(42, 1));
|
||||
* ```
|
||||
*/
|
||||
export namespace plugins {
|
||||
/**
|
||||
* Get an plug-in by its full identifier in the form of: `publisher.name`.
|
||||
*
|
||||
* @param pluginId An plug-in identifier.
|
||||
* @return An plug-in or `undefined`.
|
||||
*/
|
||||
export function getPlugin(pluginId: string): Plugin<any> | undefined;
|
||||
|
||||
/**
|
||||
* Get an plug-in its full identifier in the form of: `publisher.name`.
|
||||
*
|
||||
* @param pluginId An plug-in identifier.
|
||||
* @return An plug-in or `undefined`.
|
||||
*/
|
||||
export function getPlugin<T>(pluginId: string): Plugin<T> | undefined;
|
||||
|
||||
/**
|
||||
* All plug-ins currently known to the system.
|
||||
*/
|
||||
export let all: Plugin<any>[];
|
||||
|
||||
/**
|
||||
* An event which fires when `plugins.all` changes. This can happen when extensions are
|
||||
* installed, uninstalled, enabled or disabled.
|
||||
*/
|
||||
export let onDidChange: Event<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an plugin.
|
||||
*
|
||||
* To get an instance of an `Plugin` use {@link plugins.getPlugin getPlugin}.
|
||||
*/
|
||||
export interface Plugin<T> {
|
||||
|
||||
/**
|
||||
* The canonical plug-in identifier in the form of: `publisher.name`.
|
||||
*/
|
||||
readonly id: string;
|
||||
|
||||
/**
|
||||
* The absolute file path of the directory containing this plug-in.
|
||||
*/
|
||||
readonly pluginPath: string;
|
||||
|
||||
/**
|
||||
* The uri of the directory containing this plug-in.
|
||||
*/
|
||||
readonly pluginUri: Uri;
|
||||
|
||||
/**
|
||||
* `true` if the plug-in has been activated.
|
||||
*/
|
||||
readonly isActive: boolean;
|
||||
|
||||
/**
|
||||
* The parsed contents of the plug-in's package.json.
|
||||
*/
|
||||
readonly packageJSON: any;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
readonly pluginType: PluginType;
|
||||
|
||||
/**
|
||||
* The public API exported by this plug-in. It is an invalid action
|
||||
* to access this field before this plug-in has been activated.
|
||||
*/
|
||||
readonly exports: T;
|
||||
|
||||
/**
|
||||
* Activates this plug-in and returns its public API.
|
||||
*
|
||||
* @return A promise that will resolve when this plug-in has been activated.
|
||||
*/
|
||||
activate(): Thenable<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* A plug-in context is a collection of utilities private to a
|
||||
* plug-in.
|
||||
*
|
||||
* An instance of a `PluginContext` is provided as the first
|
||||
* parameter to the `start` of a plug-in.
|
||||
*/
|
||||
export interface PluginContext {
|
||||
|
||||
/**
|
||||
* An array to which disposables can be added. When this
|
||||
* extension is deactivated the disposables will be disposed.
|
||||
*/
|
||||
subscriptions: { dispose(): any }[];
|
||||
|
||||
/**
|
||||
* A memento object that stores state in the context
|
||||
* of the currently opened {@link workspace.workspaceFolders workspace}.
|
||||
*/
|
||||
workspaceState: Memento;
|
||||
|
||||
/**
|
||||
* A memento object that stores state independent
|
||||
* of the current opened {@link workspace.workspaceFolders workspace}.
|
||||
*/
|
||||
globalState: Memento & {
|
||||
/**
|
||||
* Set the keys whose values should be synchronized across devices when synchronizing user-data
|
||||
* like configuration, extensions, and mementos.
|
||||
*
|
||||
* Note that this function defines the whole set of keys whose values are synchronized:
|
||||
* - calling it with an empty array stops synchronization for this memento
|
||||
* - calling it with a non-empty array replaces all keys whose values are synchronized
|
||||
*
|
||||
* For any given set of keys this function needs to be called only once but there is no harm in
|
||||
* repeatedly calling it.
|
||||
*
|
||||
* @param keys The set of keys whose values are synced.
|
||||
*/
|
||||
setKeysForSync(keys: readonly string[]): void;
|
||||
};
|
||||
|
||||
/**
|
||||
* A storage utility for secrets.
|
||||
*/
|
||||
readonly secrets: SecretStorage;
|
||||
|
||||
/**
|
||||
* The absolute file path of the directory containing the extension.
|
||||
*/
|
||||
extensionPath: string;
|
||||
|
||||
/**
|
||||
* The uri of the directory containing the extension.
|
||||
*/
|
||||
readonly extensionUri: Uri;
|
||||
|
||||
/**
|
||||
* Gets the extension's environment variable collection for this workspace, enabling changes
|
||||
* to be applied to terminal environment variables.
|
||||
*/
|
||||
readonly environmentVariableCollection: EnvironmentVariableCollection;
|
||||
|
||||
/**
|
||||
* Get the absolute path of a resource contained in the extension.
|
||||
*
|
||||
* @param relativePath A relative path to a resource contained in the extension.
|
||||
* @return The absolute path of the resource.
|
||||
*/
|
||||
asAbsolutePath(relativePath: string): string;
|
||||
|
||||
/**
|
||||
* An absolute file path of a workspace specific directory in which the extension
|
||||
* can store private state. The directory might not exist on disk and creation is
|
||||
* up to the extension. However, the parent directory is guaranteed to be existent.
|
||||
*
|
||||
* Use [`workspaceState`](#PluginContext.workspaceState) or
|
||||
* [`globalState`](#PluginContext.globalState) to store key value data.
|
||||
*
|
||||
* @deprecated Use {@link PluginContext.storageUri storageUri} instead.
|
||||
*/
|
||||
storagePath: string | undefined;
|
||||
|
||||
/**
|
||||
* The uri of a workspace specific directory in which the extension
|
||||
* can store private state. The directory might not exist and creation is
|
||||
* up to the extension. However, the parent directory is guaranteed to be existent.
|
||||
* The value is `undefined` when no workspace nor folder has been opened.
|
||||
*
|
||||
* Use [`workspaceState`](#PluginContext.workspaceState) or
|
||||
* [`globalState`](#PluginContext.globalState) to store key value data.
|
||||
*
|
||||
* @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from
|
||||
* an uri.
|
||||
*/
|
||||
readonly storageUri: Uri | undefined;
|
||||
|
||||
/**
|
||||
* An absolute file path in which the extension can store global state.
|
||||
* The directory might not exist on disk and creation is
|
||||
* up to the extension. However, the parent directory is guaranteed to be existent.
|
||||
*
|
||||
* Use [`globalState`](#PluginContext.globalState) to store key value data.
|
||||
*
|
||||
* @deprecated Use {@link PluginContext.globalStorageUri globalStorageUri} instead.
|
||||
*/
|
||||
readonly globalStoragePath: string;
|
||||
|
||||
/**
|
||||
* The uri of a directory in which the extension can store global state.
|
||||
* The directory might not exist on disk and creation is
|
||||
* up to the extension. However, the parent directory is guaranteed to be existent.
|
||||
*
|
||||
* Use [`globalState`](#PluginContext.globalState) to store key value data.
|
||||
*
|
||||
* @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from
|
||||
* an uri.
|
||||
*/
|
||||
readonly globalStorageUri: Uri;
|
||||
|
||||
/**
|
||||
* An absolute file path of a directory in which the extension can create log files.
|
||||
* The directory might not exist on disk and creation is up to the extension. However,
|
||||
* the parent directory is guaranteed to be existent.
|
||||
*/
|
||||
readonly logPath: string;
|
||||
|
||||
/**
|
||||
* The mode the extension is running in. This is specific to the current
|
||||
* extension. One extension may be in `ExtensionMode.Development` while
|
||||
* other extensions in the host run in `ExtensionMode.Release`.
|
||||
*/
|
||||
readonly extensionMode: ExtensionMode;
|
||||
|
||||
/**
|
||||
* The current extension instance.
|
||||
*/
|
||||
readonly extension: Plugin<any> | undefined;
|
||||
|
||||
/**
|
||||
* The uri of a directory in which the extension can create log files. The directory might
|
||||
* not exist on disk and creation is up to the extension. However, the parent directory is
|
||||
* guaranteed to be existent.
|
||||
* see - workspace.fs for how to read and write files and folders from an uri.
|
||||
*/
|
||||
readonly logUri: Uri;
|
||||
|
||||
/**
|
||||
* An object that keeps information about how this extension can use language models.
|
||||
*
|
||||
* @see {@link LanguageModelChat.sendRequest}
|
||||
*/
|
||||
readonly languageModelAccessInformation: LanguageModelAccessInformation;
|
||||
}
|
||||
|
||||
export namespace commands {
|
||||
|
||||
/**
|
||||
* Get the keybindings associated to commandId.
|
||||
* @param commandId The ID of the command for which we are looking for keybindings.
|
||||
*/
|
||||
export function getKeyBinding(commandId: string): Thenable<CommandKeyBinding[] | undefined>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Key Binding of a command
|
||||
*/
|
||||
export interface CommandKeyBinding {
|
||||
/**
|
||||
* Identifier of the command.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Value of the keyBinding
|
||||
*/
|
||||
value: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enumeration of the supported operating systems.
|
||||
*/
|
||||
export enum OperatingSystem {
|
||||
Windows = 'Windows',
|
||||
Linux = 'Linux',
|
||||
OSX = 'OSX'
|
||||
}
|
||||
|
||||
export namespace env {
|
||||
|
||||
/**
|
||||
* 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
|
||||
* it always return with the `Linux` OS type.
|
||||
*/
|
||||
export function getClientOperatingSystem(): Thenable<OperatingSystem>;
|
||||
|
||||
}
|
||||
|
||||
export interface DecorationData {
|
||||
letter?: string;
|
||||
title?: string;
|
||||
color?: ThemeColor;
|
||||
priority?: number;
|
||||
bubble?: boolean;
|
||||
source?: string;
|
||||
}
|
||||
|
||||
export interface SourceControl {
|
||||
|
||||
/**
|
||||
* Whether the source control is selected.
|
||||
*/
|
||||
readonly selected: boolean;
|
||||
|
||||
/**
|
||||
* An event signaling when the selection state changes.
|
||||
*/
|
||||
readonly onDidChangeSelection: Event<boolean>;
|
||||
}
|
||||
|
||||
export interface SourceControlResourceDecorations {
|
||||
source?: string;
|
||||
letter?: string;
|
||||
color?: ThemeColor;
|
||||
}
|
||||
|
||||
export interface TerminalObserver {
|
||||
|
||||
/**
|
||||
* A regex to match against the latest terminal output.
|
||||
*/
|
||||
readonly outputMatcherRegex: string;
|
||||
/**
|
||||
* The maximum number of lines to match the regex against. Maximum is 40 lines.
|
||||
*/
|
||||
readonly nrOfLinesToMatch: number;
|
||||
/**
|
||||
* Invoked when the regex matched against the terminal contents.
|
||||
* @param groups The matched groups
|
||||
*/
|
||||
matchOccurred(groups: string[]): void;
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
export function registerTerminalObserver(observer: TerminalObserver): Disposable;
|
||||
}
|
||||
|
||||
export interface Diagnostic {
|
||||
/**
|
||||
* A data entry field that is preserved between diagnostics and code actions.
|
||||
*/
|
||||
data?: any;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
|
||||
* and others. This API makes no assumption about what promise library is being used which
|
||||
* enables reusing existing code without migrating to a specific promise implementation. Still,
|
||||
* we recommend the use of native promises which are available in this editor.
|
||||
*/
|
||||
interface Thenable<T> {
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
* @param onrejected The callback to execute when the Promise is rejected.
|
||||
* @returns A Promise for the completion of which ever callback is executed.
|
||||
*/
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
|
||||
}
|
||||
19963
packages/plugin/src/theia.d.ts
vendored
Normal file
19963
packages/plugin/src/theia.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
64
packages/plugin/src/theia.proposed.canonicalUriProvider.d.ts
vendored
Normal file
64
packages/plugin/src/theia.proposed.canonicalUriProvider.d.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 STMicroelectronics and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.79.0/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/180582
|
||||
|
||||
export namespace workspace {
|
||||
/**
|
||||
*
|
||||
* @param scheme The URI scheme that this provider can provide canonical URIs for.
|
||||
* A canonical URI represents the conversion of a resource's alias into a source of truth URI.
|
||||
* Multiple aliases may convert to the same source of truth URI.
|
||||
* @param provider A provider which can convert URIs of scheme @param scheme to
|
||||
* a canonical URI which is stable across machines.
|
||||
*/
|
||||
export function registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): Disposable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uri The URI to provide a canonical URI for.
|
||||
* @param token A cancellation token for the request.
|
||||
*/
|
||||
export function getCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
|
||||
}
|
||||
|
||||
export interface CanonicalUriProvider {
|
||||
/**
|
||||
*
|
||||
* @param uri The URI to provide a canonical URI for.
|
||||
* @param options Options that the provider should honor in the URI it returns.
|
||||
* @param token A cancellation token for the request.
|
||||
* @returns The canonical URI for the requested URI or undefined if no canonical URI can be provided.
|
||||
*/
|
||||
provideCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
|
||||
}
|
||||
|
||||
export interface CanonicalUriRequestOptions {
|
||||
/**
|
||||
*
|
||||
* The desired scheme of the canonical URI.
|
||||
*/
|
||||
targetScheme: string;
|
||||
}
|
||||
}
|
||||
41
packages/plugin/src/theia.proposed.customEditorMove.d.ts
vendored
Normal file
41
packages/plugin/src/theia.proposed.customEditorMove.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.customEditorMove.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export interface CustomTextEditorProvider {
|
||||
|
||||
/**
|
||||
* Handle when the underlying resource for a custom editor is renamed.
|
||||
*
|
||||
* This allows the webview for the editor be preserved throughout the rename. If this method is not implemented,
|
||||
* the editor will destroy the previous custom editor and create a replacement one.
|
||||
*
|
||||
* @param newDocument New text document to use for the custom editor.
|
||||
* @param existingWebviewPanel Webview panel for the custom editor.
|
||||
* @param token A cancellation token that indicates the result is no longer needed.
|
||||
*
|
||||
* @return Thenable indicating that the webview editor has been moved.
|
||||
*/
|
||||
moveCustomTextEditor?(newDocument: TextDocument, existingWebviewPanel: WebviewPanel, token: CancellationToken): Thenable<void>;
|
||||
}
|
||||
}
|
||||
189
packages/plugin/src/theia.proposed.debugVisualization.d.ts
vendored
Normal file
189
packages/plugin/src/theia.proposed.debugVisualization.d.ts
vendored
Normal file
@@ -0,0 +1,189 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2024 Typefox and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export module '@theia/plugin' {
|
||||
export namespace debug {
|
||||
/**
|
||||
* Registers a custom data visualization for variables when debugging.
|
||||
*
|
||||
* @param id The corresponding ID in the package.json `debugVisualizers` contribution point.
|
||||
* @param provider The {@link DebugVisualizationProvider} to register
|
||||
* @stubbed
|
||||
*/
|
||||
export function registerDebugVisualizationProvider<T extends DebugVisualization>(
|
||||
id: string,
|
||||
provider: DebugVisualizationProvider<T>
|
||||
): Disposable;
|
||||
|
||||
/**
|
||||
* Registers a tree that can be referenced by {@link DebugVisualization.visualization}.
|
||||
* @param id
|
||||
* @param provider
|
||||
* @stubbed
|
||||
*/
|
||||
export function registerDebugVisualizationTreeProvider<T extends DebugTreeItem>(
|
||||
id: string,
|
||||
provider: DebugVisualizationTree<T>
|
||||
): Disposable;
|
||||
}
|
||||
|
||||
/**
|
||||
* An item from the {@link DebugVisualizationTree}
|
||||
*/
|
||||
export interface DebugTreeItem {
|
||||
/**
|
||||
* A human-readable string describing this item.
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* A human-readable string which is rendered less prominent.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* {@link TreeItemCollapsibleState} of the tree item.
|
||||
*/
|
||||
collapsibleState?: TreeItemCollapsibleState;
|
||||
|
||||
/**
|
||||
* Context value of the tree item. This can be used to contribute item specific actions in the tree.
|
||||
* For example, a tree item is given a context value as `folder`. When contributing actions to `view/item/context`
|
||||
* using `menus` extension point, you can specify context value for key `viewItem` in `when` expression like `viewItem == folder`.
|
||||
* ```json
|
||||
* "contributes": {
|
||||
* "menus": {
|
||||
* "view/item/context": [
|
||||
* {
|
||||
* "command": "extension.deleteFolder",
|
||||
* "when": "viewItem == folder"
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* This will show action `extension.deleteFolder` only for items with `contextValue` is `folder`.
|
||||
*/
|
||||
contextValue?: string;
|
||||
|
||||
/**
|
||||
* Whether this item can be edited by the user.
|
||||
*/
|
||||
canEdit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a tree that can be referenced in debug visualizations.
|
||||
*/
|
||||
export interface DebugVisualizationTree<T extends DebugTreeItem = DebugTreeItem> {
|
||||
/**
|
||||
* Gets the tree item for an element or the base context item.
|
||||
*/
|
||||
getTreeItem(context: DebugVisualizationContext): ProviderResult<T>;
|
||||
/**
|
||||
* Gets children for the tree item or the best context item.
|
||||
*/
|
||||
getChildren(element: T): ProviderResult<T[]>;
|
||||
/**
|
||||
* Handles the user editing an item.
|
||||
*/
|
||||
editItem?(item: T, value: string): ProviderResult<T>;
|
||||
}
|
||||
|
||||
export class DebugVisualization {
|
||||
/**
|
||||
* The name of the visualization to show to the user.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* An icon for the view when it's show in inline actions.
|
||||
*/
|
||||
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
|
||||
|
||||
/**
|
||||
* Visualization to use for the variable. This may be either:
|
||||
* - A command to run when the visualization is selected for a variable.
|
||||
* - A reference to a previously-registered {@link DebugVisualizationTree}
|
||||
*/
|
||||
visualization?: Command | { treeId: string };
|
||||
|
||||
/**
|
||||
* Creates a new debug visualization object.
|
||||
* @param name Name of the visualization to show to the user.
|
||||
*/
|
||||
constructor(name: string);
|
||||
}
|
||||
|
||||
export interface DebugVisualizationProvider<T extends DebugVisualization = DebugVisualization> {
|
||||
/**
|
||||
* Called for each variable when the debug session stops. It should return
|
||||
* any visualizations the extension wishes to show to the user.
|
||||
*
|
||||
* Note that this is only called when its `when` clause defined under the
|
||||
* `debugVisualizers` contribution point in the `package.json` evaluates
|
||||
* to true.
|
||||
*/
|
||||
provideDebugVisualization(context: DebugVisualizationContext, token: CancellationToken): ProviderResult<T[]>;
|
||||
|
||||
/**
|
||||
* Invoked for a variable when a user picks the visualizer.
|
||||
*
|
||||
* It may return a {@link TreeView} that's shown in the Debug Console or
|
||||
* inline in a hover. A visualizer may choose to return `undefined` from
|
||||
* this function and instead trigger other actions in the UI, such as opening
|
||||
* a custom {@link WebviewView}.
|
||||
*/
|
||||
resolveDebugVisualization?(visualization: T, token: CancellationToken): ProviderResult<T>;
|
||||
}
|
||||
|
||||
export interface DebugVisualizationContext {
|
||||
/**
|
||||
* The Debug Adapter Protocol Variable to be visualized.
|
||||
* @see https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
|
||||
*/
|
||||
variable: any;
|
||||
/**
|
||||
* The Debug Adapter Protocol variable reference the type (such as a scope
|
||||
* or another variable) that contained this one. Empty for variables
|
||||
* that came from user evaluations in the Debug Console.
|
||||
* @see https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
|
||||
*/
|
||||
containerId?: number;
|
||||
/**
|
||||
* The ID of the Debug Adapter Protocol StackFrame in which the variable was found,
|
||||
* for variables that came from scopes in a stack frame.
|
||||
* @see https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
|
||||
*/
|
||||
frameId?: number;
|
||||
/**
|
||||
* The ID of the Debug Adapter Protocol Thread in which the variable was found.
|
||||
* @see https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
|
||||
*/
|
||||
threadId: number;
|
||||
/**
|
||||
* The debug session the variable belongs to.
|
||||
*/
|
||||
session: DebugSession;
|
||||
}
|
||||
}
|
||||
55
packages/plugin/src/theia.proposed.diffCommand.d.ts
vendored
Normal file
55
packages/plugin/src/theia.proposed.diffCommand.d.ts
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.diffCommand.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* The contiguous set of modified lines in a diff.
|
||||
*/
|
||||
export interface LineChange {
|
||||
readonly originalStartLineNumber: number;
|
||||
readonly originalEndLineNumber: number;
|
||||
readonly modifiedStartLineNumber: number;
|
||||
readonly modifiedEndLineNumber: number;
|
||||
}
|
||||
|
||||
export namespace commands {
|
||||
|
||||
/**
|
||||
* Registers a diff information command that can be invoked via a keyboard shortcut,
|
||||
* a menu item, an action, or directly.
|
||||
*
|
||||
* Diff information commands are different from ordinary {@link commands.registerCommand commands} as
|
||||
* they only execute when there is an active diff editor when the command is called, and the diff
|
||||
* information has been computed. Also, the command handler of an editor command has access to
|
||||
* the diff information.
|
||||
*
|
||||
* @param command A unique identifier for the command.
|
||||
* @param callback A command handler function with access to the {@link LineChange diff information}.
|
||||
* @param thisArg The `this` context used when invoking the handler function.
|
||||
* @return Disposable which unregisters this command on disposal.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable;
|
||||
}
|
||||
|
||||
}
|
||||
89
packages/plugin/src/theia.proposed.editSessionIdentityProvider.d.ts
vendored
Normal file
89
packages/plugin/src/theia.proposed.editSessionIdentityProvider.d.ts
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/157734
|
||||
|
||||
export namespace workspace {
|
||||
/**
|
||||
* An event that is emitted when an edit session identity is about to be requested.
|
||||
*/
|
||||
export const onWillCreateEditSessionIdentity: Event<EditSessionIdentityWillCreateEvent>;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param scheme The URI scheme that this provider can provide edit session identities for.
|
||||
* @param provider A provider which can convert URIs for workspace folders of scheme @param scheme to
|
||||
* an edit session identifier which is stable across machines. This enables edit sessions to be resolved.
|
||||
*/
|
||||
export function registerEditSessionIdentityProvider(scheme: string, provider: EditSessionIdentityProvider): Disposable;
|
||||
}
|
||||
|
||||
export interface EditSessionIdentityProvider {
|
||||
/**
|
||||
*
|
||||
* @param workspaceFolder The workspace folder to provide an edit session identity for.
|
||||
* @param token A cancellation token for the request.
|
||||
* @returns A string representing the edit session identity for the requested workspace folder.
|
||||
*/
|
||||
provideEditSessionIdentity(workspaceFolder: WorkspaceFolder, token: CancellationToken): ProviderResult<string>;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param identity1 An edit session identity.
|
||||
* @param identity2 A second edit session identity to compare to @param identity1.
|
||||
* @param token A cancellation token for the request.
|
||||
* @returns An {@link EditSessionIdentityMatch} representing the edit session identity match confidence for the provided identities.
|
||||
*/
|
||||
provideEditSessionIdentityMatch(identity1: string, identity2: string, token: CancellationToken): ProviderResult<EditSessionIdentityMatch>;
|
||||
}
|
||||
|
||||
export enum EditSessionIdentityMatch {
|
||||
Complete = 100,
|
||||
Partial = 50,
|
||||
None = 0
|
||||
}
|
||||
|
||||
export interface EditSessionIdentityWillCreateEvent {
|
||||
|
||||
/**
|
||||
* A cancellation token.
|
||||
*/
|
||||
readonly token: CancellationToken;
|
||||
|
||||
/**
|
||||
* The workspace folder to create an edit session identity for.
|
||||
*/
|
||||
readonly workspaceFolder: WorkspaceFolder;
|
||||
|
||||
/**
|
||||
* Allows to pause the event until the provided thenable resolves.
|
||||
*
|
||||
* *Note:* This function can only be called during event dispatch.
|
||||
*
|
||||
* @param thenable A thenable that delays saving.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
waitUntil(thenable: Thenable<any>): void;
|
||||
}
|
||||
}
|
||||
94
packages/plugin/src/theia.proposed.editorHoverVerbosityLevel.d.ts
vendored
Normal file
94
packages/plugin/src/theia.proposed.editorHoverVerbosityLevel.d.ts
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2025 EclipseSource GmbH and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// Copied from https://github.com/microsoft/vscode/blob/1.104.0/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* A hover represents additional information for a symbol or word. Hovers are
|
||||
* rendered in a tooltip-like widget.
|
||||
*/
|
||||
export class VerboseHover extends Hover {
|
||||
|
||||
/**
|
||||
* Can increase the verbosity of the hover
|
||||
*/
|
||||
canIncreaseVerbosity?: boolean;
|
||||
|
||||
/**
|
||||
* Can decrease the verbosity of the hover
|
||||
*/
|
||||
canDecreaseVerbosity?: boolean;
|
||||
|
||||
/**
|
||||
* Creates a new hover object.
|
||||
*
|
||||
* @param contents The contents of the hover.
|
||||
* @param range The range to which the hover applies.
|
||||
*/
|
||||
constructor(contents: MarkdownString | MarkedString | Array<MarkdownString | MarkedString>, range?: Range, canIncreaseVerbosity?: boolean, canDecreaseVerbosity?: boolean);
|
||||
}
|
||||
|
||||
export interface HoverContext {
|
||||
|
||||
/**
|
||||
* The delta by which to increase/decrease the hover verbosity level
|
||||
*/
|
||||
readonly verbosityDelta?: number;
|
||||
|
||||
/**
|
||||
* The previous hover sent for the same position
|
||||
*/
|
||||
readonly previousHover?: Hover;
|
||||
}
|
||||
|
||||
export enum HoverVerbosityAction {
|
||||
/**
|
||||
* Increase the hover verbosity
|
||||
*/
|
||||
Increase = 0,
|
||||
/**
|
||||
* Decrease the hover verbosity
|
||||
*/
|
||||
Decrease = 1
|
||||
}
|
||||
|
||||
/**
|
||||
* The hover provider class
|
||||
*/
|
||||
export interface HoverProvider {
|
||||
|
||||
/**
|
||||
* Provide a hover for the given position and document. Multiple hovers at the same
|
||||
* position will be merged by the editor. A hover can have a range which defaults
|
||||
* to the word range at the position when omitted.
|
||||
*
|
||||
* @param document The document in which the command was invoked.
|
||||
* @param position The position at which the command was invoked.
|
||||
* @param token A cancellation token.
|
||||
* @oaram context A hover context.
|
||||
* @returns A hover or a thenable that resolves to such. The lack of a result can be
|
||||
* signaled by returning `undefined` or `null`.
|
||||
*/
|
||||
provideHover(document: TextDocument, position: Position, token: CancellationToken, context?: HoverContext): ProviderResult<VerboseHover>;
|
||||
}
|
||||
}
|
||||
61
packages/plugin/src/theia.proposed.extensionsAny.d.ts
vendored
Normal file
61
packages/plugin/src/theia.proposed.extensionsAny.d.ts
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.extensionsAny.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export interface Extension<T> {
|
||||
|
||||
/**
|
||||
* `true` when the extension is associated to another extension host.
|
||||
*
|
||||
* *Note* that an extension from another extension host cannot export
|
||||
* API, e.g {@link Extension.exports its exports} are always `undefined`.
|
||||
*/
|
||||
readonly isFromDifferentExtensionHost: boolean;
|
||||
}
|
||||
|
||||
export namespace extensions {
|
||||
|
||||
/**
|
||||
* Get an extension by its full identifier in the form of: `publisher.name`.
|
||||
*
|
||||
* @param extensionId An extension identifier.
|
||||
* @param includeDifferentExtensionHosts Include extensions from different extension host
|
||||
* @return An extension or `undefined`.
|
||||
*
|
||||
* *Note* In Theia, includeDifferentExtensionHosts will always be set to false, as we only support one host currently.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function getExtension<T = any>(extensionId: string, includeDifferentExtensionHosts: boolean): Extension<T> | undefined;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function getExtension<T = any>(extensionId: string, includeDifferentExtensionHosts: true): Extension<T | undefined> | undefined;
|
||||
|
||||
/**
|
||||
* All extensions across all extension hosts.
|
||||
*
|
||||
* @see {@link Extension.isFromDifferentExtensionHost}
|
||||
*/
|
||||
export const allAcrossExtensionHosts: readonly Extension<void>[];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
158
packages/plugin/src/theia.proposed.externalUriOpener.d.ts
vendored
Normal file
158
packages/plugin/src/theia.proposed.externalUriOpener.d.ts
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
/**
|
||||
* Details if an `ExternalUriOpener` can open a uri.
|
||||
*
|
||||
* The priority is also used to rank multiple openers against each other and determine
|
||||
* if an opener should be selected automatically or if the user should be prompted to
|
||||
* select an opener.
|
||||
*
|
||||
* The editor will try to use the best available opener, as sorted by `ExternalUriOpenerPriority`.
|
||||
* If there are multiple potential "best" openers for a URI, then the user will be prompted
|
||||
* to select an opener.
|
||||
*/
|
||||
export enum ExternalUriOpenerPriority {
|
||||
/**
|
||||
* The opener is disabled and will never be shown to users.
|
||||
*
|
||||
* Note that the opener can still be used if the user specifically
|
||||
* configures it in their settings.
|
||||
*/
|
||||
None = 0,
|
||||
|
||||
/**
|
||||
* The opener can open the uri but will not cause a prompt on its own
|
||||
* since the editor always contributes a built-in `Default` opener.
|
||||
*/
|
||||
Option = 1,
|
||||
|
||||
/**
|
||||
* The opener can open the uri.
|
||||
*
|
||||
* The editor's built-in opener has `Default` priority. This means that any additional `Default`
|
||||
* openers will cause the user to be prompted to select from a list of all potential openers.
|
||||
*/
|
||||
Default = 2,
|
||||
|
||||
/**
|
||||
* The opener can open the uri and should be automatically selected over any
|
||||
* default openers, include the built-in one from the editor.
|
||||
*
|
||||
* A preferred opener will be automatically selected if no other preferred openers
|
||||
* are available. If multiple preferred openers are available, then the user
|
||||
* is shown a prompt with all potential openers (not just preferred openers).
|
||||
*/
|
||||
Preferred = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles opening uris to external resources, such as http(s) links.
|
||||
*
|
||||
* Extensions can implement an `ExternalUriOpener` to open `http` links to a webserver
|
||||
* inside of the editor instead of having the link be opened by the web browser.
|
||||
*
|
||||
* Currently openers may only be registered for `http` and `https` uris.
|
||||
*/
|
||||
export interface ExternalUriOpener {
|
||||
|
||||
/**
|
||||
* Check if the opener can open a uri.
|
||||
*
|
||||
* @param uri The uri being opened. This is the uri that the user clicked on. It has
|
||||
* not yet gone through port forwarding.
|
||||
* @param token Cancellation token indicating that the result is no longer needed.
|
||||
*
|
||||
* @return Priority indicating if the opener can open the external uri.
|
||||
*/
|
||||
canOpenExternalUri(uri: Uri, token: CancellationToken): ExternalUriOpenerPriority | Thenable<ExternalUriOpenerPriority>;
|
||||
|
||||
/**
|
||||
* Open a uri.
|
||||
*
|
||||
* This is invoked when:
|
||||
*
|
||||
* - The user clicks a link which does not have an assigned opener. In this case, first `canOpenExternalUri`
|
||||
* is called and if the user selects this opener, then `openExternalUri` is called.
|
||||
* - The user sets the default opener for a link in their settings and then visits a link.
|
||||
*
|
||||
* @param resolvedUri The uri to open. This uri may have been transformed by port forwarding, so it
|
||||
* may not match the original uri passed to `canOpenExternalUri`. Use `ctx.originalUri` to check the
|
||||
* original uri.
|
||||
* @param ctx Additional information about the uri being opened.
|
||||
* @param token Cancellation token indicating that opening has been canceled.
|
||||
*
|
||||
* @return Thenable indicating that the opening has completed.
|
||||
*/
|
||||
openExternalUri(resolvedUri: Uri, ctx: OpenExternalUriContext, token: CancellationToken): Thenable<void> | void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional information about the uri being opened.
|
||||
*/
|
||||
export interface OpenExternalUriContext {
|
||||
/**
|
||||
* The uri that triggered the open.
|
||||
*
|
||||
* This is the original uri that the user clicked on or that was passed to `openExternal.`
|
||||
* Due to port forwarding, this may not match the `resolvedUri` passed to `openExternalUri`.
|
||||
*/
|
||||
readonly sourceUri: Uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional metadata about a registered `ExternalUriOpener`.
|
||||
*/
|
||||
interface ExternalUriOpenerMetadata {
|
||||
|
||||
/**
|
||||
* List of uri schemes the opener is triggered for.
|
||||
*
|
||||
* Currently only `http` and `https` are supported.
|
||||
*/
|
||||
readonly schemes: readonly string[];
|
||||
|
||||
/**
|
||||
* Text displayed to the user that explains what the opener does.
|
||||
*
|
||||
* For example, 'Open in browser preview'
|
||||
*/
|
||||
readonly label: string;
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
/**
|
||||
* Register a new `ExternalUriOpener`.
|
||||
*
|
||||
* When a uri is about to be opened, an `onOpenExternalUri:SCHEME` activation event is fired.
|
||||
*
|
||||
* @param id Unique id of the opener, such as `myExtension.browserPreview`. This is used in settings
|
||||
* and commands to identify the opener.
|
||||
* @param opener Opener to register.
|
||||
* @param metadata Additional information about the opener.
|
||||
*
|
||||
* @returns Disposable that unregisters the opener.
|
||||
*/
|
||||
export function registerExternalUriOpener(id: string, opener: ExternalUriOpener, metadata: ExternalUriOpenerMetadata): Disposable;
|
||||
}
|
||||
}
|
||||
178
packages/plugin/src/theia.proposed.findTextInFiles.d.ts
vendored
Normal file
178
packages/plugin/src/theia.proposed.findTextInFiles.d.ts
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* Options that can be set on a findTextInFiles search.
|
||||
*/
|
||||
export interface FindTextInFilesOptions {
|
||||
/**
|
||||
* A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern
|
||||
* will be matched against the file paths of files relative to their workspace. Use a [relative pattern](#RelativePattern)
|
||||
* to restrict the search results to a [workspace folder](#WorkspaceFolder).
|
||||
*/
|
||||
include?: GlobPattern;
|
||||
|
||||
/**
|
||||
* A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern
|
||||
* will be matched against the file paths of resulting matches relative to their workspace. When `undefined`, default excludes will
|
||||
* apply.
|
||||
*/
|
||||
exclude?: GlobPattern;
|
||||
|
||||
/**
|
||||
* Whether to use the default and user-configured excludes. Defaults to true.
|
||||
*/
|
||||
useDefaultExcludes?: boolean;
|
||||
|
||||
/**
|
||||
* The maximum number of results to search for
|
||||
*/
|
||||
maxResults?: number;
|
||||
|
||||
/**
|
||||
* Whether external files that exclude files, like .gitignore, should be respected.
|
||||
* See the vscode setting `"search.useIgnoreFiles"`.
|
||||
*/
|
||||
useIgnoreFiles?: boolean;
|
||||
|
||||
/**
|
||||
* Whether global files that exclude files, like .gitignore, should be respected.
|
||||
* See the vscode setting `"search.useGlobalIgnoreFiles"`.
|
||||
*/
|
||||
useGlobalIgnoreFiles?: boolean;
|
||||
|
||||
/**
|
||||
* Whether symlinks should be followed while searching.
|
||||
* See the vscode setting `"search.followSymlinks"`.
|
||||
*/
|
||||
followSymlinks?: boolean;
|
||||
|
||||
/**
|
||||
* Interpret files using this encoding.
|
||||
* See the vscode setting `"files.encoding"`
|
||||
*/
|
||||
encoding?: string;
|
||||
|
||||
/**
|
||||
* Options to specify the size of the result text preview.
|
||||
*/
|
||||
previewOptions?: TextSearchPreviewOptions;
|
||||
|
||||
/**
|
||||
* Number of lines of context to include before each match.
|
||||
*/
|
||||
beforeContext?: number;
|
||||
|
||||
/**
|
||||
* Number of lines of context to include after each match.
|
||||
*/
|
||||
afterContext?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A match from a text search
|
||||
*/
|
||||
export interface TextSearchMatch {
|
||||
/**
|
||||
* The uri for the matching document.
|
||||
*/
|
||||
uri: Uri;
|
||||
|
||||
/**
|
||||
* The range of the match within the document, or multiple ranges for multiple matches.
|
||||
*/
|
||||
ranges: Range | Range[];
|
||||
|
||||
/**
|
||||
* A preview of the text match.
|
||||
*/
|
||||
preview: TextSearchMatchPreview;
|
||||
}
|
||||
|
||||
/**
|
||||
* A preview of the text result.
|
||||
*/
|
||||
export interface TextSearchMatchPreview {
|
||||
/**
|
||||
* The matching lines of text, or a portion of the matching line that contains the match.
|
||||
*/
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* The Range within `text` corresponding to the text of the match.
|
||||
* The number of matches must match the TextSearchMatch's range property.
|
||||
*/
|
||||
matches: Range | Range[];
|
||||
}
|
||||
|
||||
/**
|
||||
* A line of context surrounding a TextSearchMatch.
|
||||
*/
|
||||
export interface TextSearchContext {
|
||||
/**
|
||||
* The uri for the matching document.
|
||||
*/
|
||||
uri: Uri;
|
||||
|
||||
/**
|
||||
* One line of text.
|
||||
* previewOptions.charsPerLine applies to this
|
||||
*/
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* The line number of this line of context.
|
||||
*/
|
||||
lineNumber: number;
|
||||
}
|
||||
|
||||
export type TextSearchResult = TextSearchMatch | TextSearchContext;
|
||||
|
||||
/**
|
||||
* Information collected when text search is complete.
|
||||
*/
|
||||
export interface TextSearchComplete {
|
||||
/**
|
||||
* Whether the search hit the limit on the maximum number of search results.
|
||||
* `maxResults` on [`TextSearchOptions`](#TextSearchOptions) specifies the max number of results.
|
||||
* - If exactly that number of matches exist, this should be false.
|
||||
* - If `maxResults` matches are returned and more exist, this should be true.
|
||||
* - If search hits an internal limit which is less than `maxResults`, this should be true.
|
||||
*/
|
||||
limitHit?: boolean;
|
||||
}
|
||||
|
||||
export namespace workspace {
|
||||
/**
|
||||
* Find text in files across all [workspace folders] in the workspace
|
||||
* @param query What to search
|
||||
* @param optionsOrCallback
|
||||
* @param callbackOrToken
|
||||
* @param token
|
||||
*/
|
||||
export function findTextInFiles(query: TextSearchQuery, optionsOrCallback: FindTextInFilesOptions | ((result: TextSearchResult) => void),
|
||||
callbackOrToken?: CancellationToken | ((result: TextSearchResult) => void), token?: CancellationToken): Promise<TextSearchComplete>;
|
||||
}
|
||||
|
||||
}
|
||||
32
packages/plugin/src/theia.proposed.fsChunks.d.ts
vendored
Normal file
32
packages/plugin/src/theia.proposed.fsChunks.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.fsChunks.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export interface FileSystemProvider {
|
||||
open?(resource: Uri, options: { create: boolean }): number | Thenable<number>;
|
||||
close?(fd: number): void | Thenable<void>;
|
||||
read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
|
||||
write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable<number>;
|
||||
}
|
||||
|
||||
}
|
||||
43
packages/plugin/src/theia.proposed.interactiveWindow.d.ts
vendored
Normal file
43
packages/plugin/src/theia.proposed.interactiveWindow.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Typefox and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.103.2/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
/**
|
||||
* The tab represents an interactive window.
|
||||
*/
|
||||
export class TabInputInteractiveWindow {
|
||||
/**
|
||||
* The uri of the history notebook in the interactive window.
|
||||
*/
|
||||
readonly uri: Uri;
|
||||
/**
|
||||
* The uri of the input box in the interactive window.
|
||||
*/
|
||||
readonly inputBoxUri: Uri;
|
||||
private constructor(uri: Uri, inputBoxUri: Uri);
|
||||
}
|
||||
|
||||
export interface Tab {
|
||||
readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook
|
||||
| TabInputNotebookDiff | TabInputTerminal | TabInputInteractiveWindow | unknown;
|
||||
}
|
||||
}
|
||||
101
packages/plugin/src/theia.proposed.mappedEditsProvider.d.ts
vendored
Normal file
101
packages/plugin/src/theia.proposed.mappedEditsProvider.d.ts
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2024 STMicroelectronics and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export interface DocumentContextItem {
|
||||
readonly uri: Uri;
|
||||
readonly version: number;
|
||||
readonly ranges: Range[];
|
||||
}
|
||||
|
||||
export interface ConversationRequest {
|
||||
readonly type: 'request';
|
||||
readonly message: string;
|
||||
}
|
||||
|
||||
export interface ConversationResponse {
|
||||
readonly type: 'response';
|
||||
readonly message: string;
|
||||
readonly result?: ChatResult;
|
||||
readonly references?: DocumentContextItem[];
|
||||
}
|
||||
|
||||
export interface MappedEditsContext {
|
||||
readonly documents: DocumentContextItem[][];
|
||||
/**
|
||||
* The conversation that led to the current code block(s).
|
||||
* The last conversation part contains the code block(s) for which the code mapper should provide edits.
|
||||
*/
|
||||
readonly conversation?: Array<ConversationRequest | ConversationResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for providing mapped edits for a given document.
|
||||
*/
|
||||
export interface MappedEditsProvider {
|
||||
/**
|
||||
* Provide mapped edits for a given document.
|
||||
* @param document The document to provide mapped edits for.
|
||||
* @param codeBlocks Code blocks that come from an LLM's reply. "Apply in Editor" in the panel chat only sends one edit that the user clicks on, but inline chat can send
|
||||
* multiple blocks and let the lang server decide what to do with them.
|
||||
* @param context The context for providing mapped edits.
|
||||
* @param token A cancellation token.
|
||||
* @returns A provider result of text edits.
|
||||
*/
|
||||
provideMappedEdits(
|
||||
document: TextDocument,
|
||||
codeBlocks: string[],
|
||||
context: MappedEditsContext,
|
||||
token: CancellationToken
|
||||
): ProviderResult<WorkspaceEdit | null>;
|
||||
}
|
||||
|
||||
export interface MappedEditsRequest {
|
||||
readonly codeBlocks: { code: string; resource: Uri; markdownBeforeBlock?: string }[];
|
||||
// for every prior response that contains codeblocks, make sure we pass the code as well as the resources based on the reported codemapper URIs
|
||||
readonly conversation: Array<ConversationRequest | ConversationResponse>;
|
||||
}
|
||||
|
||||
export interface MappedEditsResponseStream {
|
||||
textEdit(target: Uri, edits: TextEdit | TextEdit[]): void;
|
||||
}
|
||||
|
||||
export interface MappedEditsResult {
|
||||
readonly errorMessage?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for providing mapped edits for a given document.
|
||||
*/
|
||||
export interface MappedEditsProvider2 {
|
||||
provideMappedEdits(
|
||||
request: MappedEditsRequest,
|
||||
result: MappedEditsResponseStream,
|
||||
token: CancellationToken
|
||||
): ProviderResult<MappedEditsResult>;
|
||||
}
|
||||
|
||||
export namespace chat {
|
||||
export function registerMappedEditsProvider(documentSelector: DocumentSelector, provider: MappedEditsProvider): Disposable;
|
||||
export function registerMappedEditsProvider2(provider: MappedEditsProvider2): Disposable;
|
||||
}
|
||||
}
|
||||
82
packages/plugin/src/theia.proposed.multiDocumentHighlightProvider.d.ts
vendored
Normal file
82
packages/plugin/src/theia.proposed.multiDocumentHighlightProvider.d.ts
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 STMicroelectronics and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.85.1/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* Represents a collection of document highlights from multiple documents.
|
||||
*/
|
||||
export class MultiDocumentHighlight {
|
||||
|
||||
/**
|
||||
* The URI of the document containing the highlights.
|
||||
*/
|
||||
uri: Uri;
|
||||
|
||||
/**
|
||||
* The highlights for the document.
|
||||
*/
|
||||
highlights: DocumentHighlight[];
|
||||
|
||||
/**
|
||||
* Creates a new instance of MultiDocumentHighlight.
|
||||
* @param uri The URI of the document containing the highlights.
|
||||
* @param highlights The highlights for the document.
|
||||
*/
|
||||
constructor(uri: Uri, highlights: DocumentHighlight[]);
|
||||
}
|
||||
|
||||
export interface MultiDocumentHighlightProvider {
|
||||
|
||||
/**
|
||||
* Provide a set of document highlights, like all occurrences of a variable or
|
||||
* all exit-points of a function.
|
||||
*
|
||||
* @param document The document in which the command was invoked.
|
||||
* @param position The position at which the command was invoked.
|
||||
* @param otherDocuments An array of additional valid documents for which highlights should be provided.
|
||||
* @param token A cancellation token.
|
||||
* @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
|
||||
* signaled by returning `undefined`, `null`, or an empty map.
|
||||
*/
|
||||
provideMultiDocumentHighlights(document: TextDocument, position: Position, otherDocuments: TextDocument[], token: CancellationToken):
|
||||
ProviderResult<MultiDocumentHighlight[]>;
|
||||
}
|
||||
|
||||
namespace languages {
|
||||
|
||||
/**
|
||||
* Register a multi document highlight provider.
|
||||
*
|
||||
* Multiple providers can be registered for a language. In that case providers are sorted
|
||||
* by their {@link languages.match score} and groups sequentially asked for document highlights.
|
||||
* The process stops when a provider returns a `non-falsy` or `non-failure` result.
|
||||
*
|
||||
* @param selector A selector that defines the documents this provider is applicable to.
|
||||
* @param provider A multi-document highlight provider.
|
||||
* @returns A {@link Disposable} that unregisters this provider when being disposed.
|
||||
* @stubbed
|
||||
*/
|
||||
export function registerMultiDocumentHighlightProvider(selector: DocumentSelector, provider: MultiDocumentHighlightProvider): Disposable;
|
||||
}
|
||||
|
||||
}
|
||||
68
packages/plugin/src/theia.proposed.notebookCellExecutionState.d.ts
vendored
Normal file
68
packages/plugin/src/theia.proposed.notebookCellExecutionState.d.ts
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Typefox and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/124970
|
||||
|
||||
/**
|
||||
* The execution state of a notebook cell.
|
||||
*/
|
||||
export enum NotebookCellExecutionState {
|
||||
/**
|
||||
* The cell is idle.
|
||||
*/
|
||||
Idle = 1,
|
||||
/**
|
||||
* Execution for the cell is pending.
|
||||
*/
|
||||
Pending = 2,
|
||||
/**
|
||||
* The cell is currently executing.
|
||||
*/
|
||||
Executing = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
* An event describing a cell execution state change.
|
||||
*/
|
||||
export interface NotebookCellExecutionStateChangeEvent {
|
||||
/**
|
||||
* The {@link NotebookCell cell} for which the execution state has changed.
|
||||
*/
|
||||
readonly cell: NotebookCell;
|
||||
|
||||
/**
|
||||
* The new execution state of the cell.
|
||||
*/
|
||||
readonly state: NotebookCellExecutionState;
|
||||
}
|
||||
|
||||
export namespace notebooks {
|
||||
|
||||
/**
|
||||
* An {@link Event} which fires when the execution state of a cell has changed.
|
||||
*/
|
||||
// todo@API this is an event that is fired for a property that cells don't have and that makes me wonder
|
||||
// how a correct consumer works, e.g the consumer could have been late and missed an event?
|
||||
export const onDidChangeNotebookCellExecutionState: Event<NotebookCellExecutionStateChangeEvent>;
|
||||
}
|
||||
}
|
||||
63
packages/plugin/src/theia.proposed.notebookKernelSource.d.ts
vendored
Normal file
63
packages/plugin/src/theia.proposed.notebookKernelSource.d.ts
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Typefox and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.106.1/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
export interface NotebookControllerDetectionTask {
|
||||
/**
|
||||
* Dispose and remove the detection task.
|
||||
*/
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export class NotebookKernelSourceAction {
|
||||
readonly label: string;
|
||||
readonly description?: string;
|
||||
readonly detail?: string;
|
||||
readonly command: string | Command;
|
||||
readonly documentation?: Uri;
|
||||
|
||||
constructor(label: string);
|
||||
}
|
||||
|
||||
export interface NotebookKernelSourceActionProvider {
|
||||
/**
|
||||
* An optional event to signal that the kernel source actions have changed.
|
||||
*/
|
||||
readonly onDidChangeNotebookKernelSourceActions?: Event<void>;
|
||||
/**
|
||||
* Provide kernel source actions
|
||||
*/
|
||||
provideNotebookKernelSourceActions(token: CancellationToken): ProviderResult<NotebookKernelSourceAction[]>;
|
||||
}
|
||||
|
||||
export namespace notebooks {
|
||||
/**
|
||||
* Create notebook controller detection task
|
||||
*/
|
||||
export function createNotebookControllerDetectionTask(notebookType: string): NotebookControllerDetectionTask;
|
||||
|
||||
/**
|
||||
* Register a notebook kernel source action provider
|
||||
*/
|
||||
export function registerKernelSourceActionProvider(notebookType: string, provider: NotebookKernelSourceActionProvider): Disposable;
|
||||
}
|
||||
}
|
||||
84
packages/plugin/src/theia.proposed.notebookMessaging.d.ts
vendored
Normal file
84
packages/plugin/src/theia.proposed.notebookMessaging.d.ts
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Typefox and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/123601
|
||||
|
||||
/**
|
||||
* Represents a script that is loaded into the notebook renderer before rendering output. This allows
|
||||
* to provide and share functionality for notebook markup and notebook output renderers.
|
||||
*/
|
||||
export class NotebookRendererScript {
|
||||
|
||||
/**
|
||||
* APIs that the preload provides to the renderer. These are matched
|
||||
* against the `dependencies` and `optionalDependencies` arrays in the
|
||||
* notebook renderer contribution point.
|
||||
*/
|
||||
provides: readonly string[];
|
||||
|
||||
/**
|
||||
* URI of the JavaScript module to preload.
|
||||
*
|
||||
* This module must export an `activate` function that takes a context object that contains the notebook API.
|
||||
*/
|
||||
uri: Uri;
|
||||
|
||||
/**
|
||||
* @param uri URI of the JavaScript module to preload
|
||||
* @param provides Value for the `provides` property
|
||||
*/
|
||||
constructor(uri: Uri, provides?: string | readonly string[]);
|
||||
}
|
||||
|
||||
export interface NotebookController {
|
||||
|
||||
// todo@API allow add, not remove
|
||||
readonly rendererScripts: NotebookRendererScript[];
|
||||
|
||||
/**
|
||||
* An event that fires when a {@link NotebookController.rendererScripts renderer script} has send a message to
|
||||
* the controller.
|
||||
*/
|
||||
readonly onDidReceiveMessage: Event<{ readonly editor: NotebookEditor; readonly message: unknown }>;
|
||||
|
||||
/**
|
||||
* Send a message to the renderer of notebook editors.
|
||||
*
|
||||
* Note that only editors showing documents that are bound to this controller
|
||||
* are receiving the message.
|
||||
*
|
||||
* @param message The message to send.
|
||||
* @param editor A specific editor to send the message to. When `undefined` all applicable editors are receiving the message.
|
||||
* @returns A promise that resolves to a boolean indicating if the message has been send or not.
|
||||
*/
|
||||
postMessage(message: unknown, editor?: NotebookEditor): Thenable<boolean>;
|
||||
|
||||
asWebviewUri(localResource: Uri): Uri;
|
||||
}
|
||||
|
||||
export namespace notebooks {
|
||||
|
||||
export function createNotebookController(id: string, viewType: string, label: string, handler?: (cells: NotebookCell[], notebook: NotebookDocument,
|
||||
controller: NotebookController) => void | Thenable<void>, rendererScripts?: NotebookRendererScript[]): NotebookController;
|
||||
}
|
||||
}
|
||||
115
packages/plugin/src/theia.proposed.portsAttributes.d.ts
vendored
Normal file
115
packages/plugin/src/theia.proposed.portsAttributes.d.ts
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2024 Typefox and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* The action that should be taken when a port is discovered through automatic port forwarding discovery.
|
||||
*/
|
||||
export enum PortAutoForwardAction {
|
||||
/**
|
||||
* Notify the user that the port is being forwarded. This is the default action.
|
||||
*/
|
||||
Notify = 1,
|
||||
/**
|
||||
* Once the port is forwarded, open the user's web browser to the forwarded port.
|
||||
*/
|
||||
OpenBrowser = 2,
|
||||
/**
|
||||
* Once the port is forwarded, open the preview browser to the forwarded port.
|
||||
*/
|
||||
OpenPreview = 3,
|
||||
/**
|
||||
* Forward the port silently.
|
||||
*/
|
||||
Silent = 4,
|
||||
/**
|
||||
* Do not forward the port.
|
||||
*/
|
||||
Ignore = 5
|
||||
}
|
||||
|
||||
/**
|
||||
* The attributes that a forwarded port can have.
|
||||
*/
|
||||
export class PortAttributes {
|
||||
/**
|
||||
* The action to be taken when this port is detected for auto forwarding.
|
||||
*/
|
||||
autoForwardAction: PortAutoForwardAction;
|
||||
|
||||
/**
|
||||
* Creates a new PortAttributes object
|
||||
* @param port the port number
|
||||
* @param autoForwardAction the action to take when this port is detected
|
||||
*/
|
||||
constructor(autoForwardAction: PortAutoForwardAction);
|
||||
}
|
||||
|
||||
/**
|
||||
* A provider of port attributes. Port attributes are used to determine what action should be taken when a port is discovered.
|
||||
*/
|
||||
export interface PortAttributesProvider {
|
||||
/**
|
||||
* Provides attributes for the given port. For ports that your extension doesn't know about, simply
|
||||
* return undefined. For example, if `providePortAttributes` is called with ports 3000 but your
|
||||
* extension doesn't know anything about 3000 you should return undefined.
|
||||
* @param port The port number of the port that attributes are being requested for.
|
||||
* @param pid The pid of the process that is listening on the port. If the pid is unknown, undefined will be passed.
|
||||
* @param commandLine The command line of the process that is listening on the port. If the command line is unknown, undefined will be passed.
|
||||
* @param token A cancellation token that indicates the result is no longer needed.
|
||||
*/
|
||||
providePortAttributes(attributes: { port: number; pid?: number; commandLine?: string }, token: CancellationToken): ProviderResult<PortAttributes>;
|
||||
}
|
||||
|
||||
/**
|
||||
* A selector that will be used to filter which {@link PortAttributesProvider} should be called for each port.
|
||||
*/
|
||||
export interface PortAttributesSelector {
|
||||
/**
|
||||
* Specifying a port range will cause your provider to only be called for ports within the range.
|
||||
* The start is inclusive and the end is exclusive.
|
||||
*/
|
||||
portRange?: [number, number] | number;
|
||||
|
||||
/**
|
||||
* Specifying a command pattern will cause your provider to only be called for processes whose command line matches the pattern.
|
||||
*/
|
||||
commandPattern?: RegExp;
|
||||
}
|
||||
|
||||
export namespace workspace {
|
||||
/**
|
||||
* If your extension listens on ports, consider registering a PortAttributesProvider to provide information
|
||||
* about the ports. For example, a debug extension may know about debug ports in it's debuggee. By providing
|
||||
* this information with a PortAttributesProvider the extension can tell the editor that these ports should be
|
||||
* ignored, since they don't need to be user facing.
|
||||
*
|
||||
* The results of the PortAttributesProvider are merged with the user setting `remote.portsAttributes`. If the values conflict, the user setting takes precedence.
|
||||
*
|
||||
* @param portSelector It is best practice to specify a port selector to avoid unnecessary calls to your provider.
|
||||
* If you don't specify a port selector your provider will be called for every port, which will result in slower port forwarding for the user.
|
||||
* @param provider The {@link PortAttributesProvider PortAttributesProvider}.
|
||||
* @stubbed
|
||||
*/
|
||||
export function registerPortAttributesProvider(portSelector: PortAttributesSelector, provider: PortAttributesProvider): Disposable;
|
||||
}
|
||||
}
|
||||
35
packages/plugin/src/theia.proposed.profileContentHandlers.d.ts
vendored
Normal file
35
packages/plugin/src/theia.proposed.profileContentHandlers.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export interface ProfileContentHandler {
|
||||
readonly name: string;
|
||||
saveProfile(name: string, content: string, token: CancellationToken): Thenable<Uri | null>;
|
||||
readProfile(uri: Uri, token: CancellationToken): Thenable<string | null>;
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
export function registerProfileContentHandler(id: string, profileContentHandler: ProfileContentHandler): Disposable;
|
||||
}
|
||||
|
||||
}
|
||||
44
packages/plugin/src/theia.proposed.resolvers.d.ts
vendored
Normal file
44
packages/plugin/src/theia.proposed.resolvers.d.ts
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.resolvers.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export interface ResourceLabelFormatter {
|
||||
scheme: string;
|
||||
authority?: string;
|
||||
formatting: ResourceLabelFormatting;
|
||||
}
|
||||
|
||||
export interface ResourceLabelFormatting {
|
||||
label: string; // myLabel:/${path}
|
||||
separator: '/' | '\\' | '';
|
||||
tildify?: boolean;
|
||||
normalizeDriveLetter?: boolean;
|
||||
workspaceSuffix?: string;
|
||||
authorityPrefix?: string;
|
||||
}
|
||||
|
||||
export namespace workspace {
|
||||
export function registerResourceLabelFormatter(formatter: ResourceLabelFormatter): Disposable;
|
||||
}
|
||||
|
||||
}
|
||||
56
packages/plugin/src/theia.proposed.scmProviderOptions.d.ts
vendored
Normal file
56
packages/plugin/src/theia.proposed.scmProviderOptions.d.ts
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2025 STMicroelectronics and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.103.2/src/vscode-dts/vscode.proposed.scmProviderOptions.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
// https://github.com/microsoft/vscode/issues/254910
|
||||
|
||||
export interface SourceControl {
|
||||
/**
|
||||
* Context value of the source control. This can be used to contribute source control specific actions.
|
||||
* For example, if a source control is given a context value of `repository`, when contributing actions to `scm/sourceControl/context`
|
||||
* using `menus` extension point, you can specify context value for key `scmProviderContext` in `when` expressions, like `scmProviderContext == repository`.
|
||||
* ```json
|
||||
* "contributes": {
|
||||
* "menus": {
|
||||
* "scm/sourceControl/context": [
|
||||
* {
|
||||
* "command": "extension.gitAction",
|
||||
* "when": "scmProviderContext == repository"
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* This will show action `extension.gitAction` only for source controls with `contextValue` equal to `repository`.
|
||||
*/
|
||||
contextValue?: string;
|
||||
|
||||
/**
|
||||
* Fired when the parent source control is disposed.
|
||||
*/
|
||||
readonly onDidDisposeParent: Event<void>;
|
||||
}
|
||||
|
||||
export namespace scm {
|
||||
export function createSourceControl(id: string, label: string, rootUri?: Uri, iconPath?: IconPath, parent?: SourceControl): SourceControl;
|
||||
}
|
||||
}
|
||||
70
packages/plugin/src/theia.proposed.scmValidation.d.ts
vendored
Normal file
70
packages/plugin/src/theia.proposed.scmValidation.d.ts
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.scmValidation.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* Represents the validation type of the Source Control input.
|
||||
*/
|
||||
export enum SourceControlInputBoxValidationType {
|
||||
|
||||
/**
|
||||
* Something not allowed by the rules of a language or other means.
|
||||
*/
|
||||
Error = 0,
|
||||
|
||||
/**
|
||||
* Something suspicious but allowed.
|
||||
*/
|
||||
Warning = 1,
|
||||
|
||||
/**
|
||||
* Something to inform about but not a problem.
|
||||
*/
|
||||
Information = 2
|
||||
}
|
||||
|
||||
export interface SourceControlInputBoxValidation {
|
||||
|
||||
/**
|
||||
* The validation message to display.
|
||||
*/
|
||||
readonly message: string;
|
||||
|
||||
/**
|
||||
* The validation type.
|
||||
*/
|
||||
readonly type: SourceControlInputBoxValidationType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the input box in the Source Control viewlet.
|
||||
*/
|
||||
export interface SourceControlInputBox {
|
||||
|
||||
/**
|
||||
* A validation function for the input box. It's possible to change
|
||||
* the validation provider simply by setting this property to a different function.
|
||||
*/
|
||||
validateInput?(value: string, cursorPosition: number): ProviderResult<SourceControlInputBoxValidation | undefined | null>;
|
||||
}
|
||||
}
|
||||
92
packages/plugin/src/theia.proposed.shareProvider.d.ts
vendored
Normal file
92
packages/plugin/src/theia.proposed.shareProvider.d.ts
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 STMicroelectronics and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/release/1.79/src/vscode-dts/vscode.proposed.shareProvider.d.ts
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/176316 @joyceerhl
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* Data about an item which can be shared.
|
||||
*/
|
||||
export interface ShareableItem {
|
||||
/**
|
||||
* A resource in the workspace that can be shared.
|
||||
*/
|
||||
resourceUri: Uri;
|
||||
|
||||
/**
|
||||
* If present, a selection within the `resourceUri`.
|
||||
*/
|
||||
selection?: Range;
|
||||
}
|
||||
|
||||
/**
|
||||
* A provider which generates share links for resources in the editor.
|
||||
*/
|
||||
export interface ShareProvider {
|
||||
|
||||
/**
|
||||
* A unique ID for the provider.
|
||||
* This will be used to activate specific extensions contributing share providers if necessary.
|
||||
*/
|
||||
readonly id: string;
|
||||
|
||||
/**
|
||||
* A label which will be used to present this provider's options in the UI.
|
||||
*/
|
||||
readonly label: string;
|
||||
|
||||
/**
|
||||
* The order in which the provider should be listed in the UI when there are multiple providers.
|
||||
*/
|
||||
readonly priority: number;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param item Data about an item which can be shared.
|
||||
* @param token A cancellation token.
|
||||
* @returns A {@link Uri} representing an external link or sharing text. The provider result
|
||||
* will be copied to the user's clipboard and presented in a confirmation dialog.
|
||||
*/
|
||||
provideShare(item: ShareableItem, token: CancellationToken): ProviderResult<Uri | string>;
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
|
||||
/**
|
||||
* Register a share provider. An extension may register multiple share providers.
|
||||
* There may be multiple share providers for the same {@link ShareableItem}.
|
||||
* @param selector A document selector to filter whether the provider should be shown for a {@link ShareableItem}.
|
||||
* @param provider A share provider.
|
||||
*/
|
||||
export function registerShareProvider(selector: DocumentSelector, provider: ShareProvider): Disposable;
|
||||
}
|
||||
|
||||
export interface TreeItem {
|
||||
|
||||
/**
|
||||
* An optional property which, when set, inlines a `Share` option in the context menu for this tree item.
|
||||
*/
|
||||
shareableItem?: ShareableItem;
|
||||
}
|
||||
}
|
||||
37
packages/plugin/src/theia.proposed.statusBarItemTooltip.d.ts
vendored
Normal file
37
packages/plugin/src/theia.proposed.statusBarItemTooltip.d.ts
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2025 EclipseSource GmbH and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// Copied from https://github.com/microsoft/vscode/blob/85f2ce803d86e9fddeba10874fc2758a75b8e806/src/vscode-dts/vscode.proposed.statusBarItemTooltip.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/234339
|
||||
|
||||
export interface StatusBarItem {
|
||||
|
||||
/**
|
||||
* The tooltip text when you hover over this entry.
|
||||
*
|
||||
* Can optionally return the tooltip in a thenable if the computation is expensive.
|
||||
*/
|
||||
tooltip2: string | MarkdownString | undefined | ((token: CancellationToken) => ProviderResult<string | MarkdownString | undefined>);
|
||||
}
|
||||
}
|
||||
302
packages/plugin/src/theia.proposed.terminalCompletionProvider.d.ts
vendored
Normal file
302
packages/plugin/src/theia.proposed.terminalCompletionProvider.d.ts
vendored
Normal file
@@ -0,0 +1,302 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2025 STMicroelectronics and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.106.1/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/226562
|
||||
|
||||
/**
|
||||
* A provider that supplies terminal completion items.
|
||||
*
|
||||
* Implementations of this interface should return an array of {@link TerminalCompletionItem} or a
|
||||
* {@link TerminalCompletionList} describing completions for the current command line.
|
||||
*
|
||||
* @example <caption>Simple provider returning a single completion</caption>
|
||||
* window.registerTerminalCompletionProvider({
|
||||
* provideTerminalCompletions(terminal, context) {
|
||||
* return [{ label: '--help', replacementRange: [Math.max(0, context.cursorPosition - 2), context.cursorPosition] }];
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
export interface TerminalCompletionProvider<T extends TerminalCompletionItem = TerminalCompletionItem> {
|
||||
/**
|
||||
* Provide completions for the given terminal and context.
|
||||
* @param terminal The terminal for which completions are being provided.
|
||||
* @param context Information about the terminal's current state.
|
||||
* @param token A cancellation token.
|
||||
* @return A list of completions.
|
||||
*/
|
||||
provideTerminalCompletions(terminal: Terminal, context: TerminalCompletionContext, token: CancellationToken): ProviderResult<T[] | TerminalCompletionList<T>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a completion suggestion for a terminal command line.
|
||||
*
|
||||
* @example <caption>Completion item for `ls -|`</caption>
|
||||
* const item = {
|
||||
* label: '-A',
|
||||
* replacementRange: [3, 4], // replace the single character at index 3
|
||||
* detail: 'List all entries except for . and .. (always set for the super-user)',
|
||||
* kind: TerminalCompletionItemKind.Flag
|
||||
* };
|
||||
*
|
||||
* The fields on a completion item describe what text should be shown to the user
|
||||
* and which portion of the command line should be replaced when the item is accepted.
|
||||
*/
|
||||
export class TerminalCompletionItem {
|
||||
/**
|
||||
* The label of the completion.
|
||||
*/
|
||||
label: string | CompletionItemLabel;
|
||||
|
||||
/**
|
||||
* The range in the command line to replace when the completion is accepted. Defined
|
||||
* as a tuple where the first entry is the inclusive start index and the second entry is the
|
||||
* exclusive end index.
|
||||
*/
|
||||
replacementRange: readonly [number, number];
|
||||
|
||||
/**
|
||||
* The completion's detail which appears on the right of the list.
|
||||
*/
|
||||
detail?: string;
|
||||
|
||||
/**
|
||||
* A human-readable string that represents a doc-comment.
|
||||
*/
|
||||
documentation?: string | MarkdownString;
|
||||
|
||||
/**
|
||||
* The completion's kind. Note that this will map to an icon. If no kind is provided, a generic icon representing plaintext will be provided.
|
||||
*/
|
||||
kind?: TerminalCompletionItemKind;
|
||||
|
||||
/**
|
||||
* Creates a new terminal completion item.
|
||||
*
|
||||
* @param label The label of the completion.
|
||||
* @param replacementRange The inclusive start and exclusive end index of the text to replace.
|
||||
* @param kind The completion's kind.
|
||||
*/
|
||||
constructor(
|
||||
label: string | CompletionItemLabel,
|
||||
replacementRange: readonly [number, number],
|
||||
kind?: TerminalCompletionItemKind
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The kind of an individual terminal completion item.
|
||||
*
|
||||
* The kind is used to render an appropriate icon in the suggest list and to convey the semantic
|
||||
* meaning of the suggestion (file, folder, flag, commit, branch, etc.).
|
||||
*/
|
||||
export enum TerminalCompletionItemKind {
|
||||
/**
|
||||
* A file completion item.
|
||||
* Example: `README.md`
|
||||
*/
|
||||
File = 0,
|
||||
/**
|
||||
* A folder completion item.
|
||||
* Example: `src/`
|
||||
*/
|
||||
Folder = 1,
|
||||
/**
|
||||
* A method completion item.
|
||||
* Example: `git commit`
|
||||
*/
|
||||
Method = 2,
|
||||
/**
|
||||
* An alias completion item.
|
||||
* Example: `ll` as an alias for `ls -l`
|
||||
*/
|
||||
Alias = 3,
|
||||
/**
|
||||
* An argument completion item.
|
||||
* Example: `origin` in `git push origin main`
|
||||
*/
|
||||
Argument = 4,
|
||||
/**
|
||||
* An option completion item. An option value is expected to follow.
|
||||
* Example: `--locale` in `code --locale en`
|
||||
*/
|
||||
Option = 5,
|
||||
/**
|
||||
* The value of an option completion item.
|
||||
* Example: `en-US` in `code --locale en-US`
|
||||
*/
|
||||
OptionValue = 6,
|
||||
/**
|
||||
* A flag completion item.
|
||||
* Example: `--amend` in `git commit --amend`
|
||||
*/
|
||||
Flag = 7,
|
||||
/**
|
||||
* A symbolic link file completion item.
|
||||
* Example: `link.txt` (symlink to a file)
|
||||
*/
|
||||
SymbolicLinkFile = 8,
|
||||
/**
|
||||
* A symbolic link folder completion item.
|
||||
* Example: `node_modules/` (symlink to a folder)
|
||||
*/
|
||||
SymbolicLinkFolder = 9,
|
||||
/**
|
||||
* A source control commit completion item.
|
||||
* Example: `abc1234` (commit hash)
|
||||
*/
|
||||
ScmCommit = 10,
|
||||
/**
|
||||
* A source control branch completion item.
|
||||
* Example: `main`
|
||||
*/
|
||||
ScmBranch = 11,
|
||||
/**
|
||||
* A source control tag completion item.
|
||||
* Example: `v1.0.0`
|
||||
*/
|
||||
ScmTag = 12,
|
||||
/**
|
||||
* A source control stash completion item.
|
||||
* Example: `stash@{0}`
|
||||
*/
|
||||
ScmStash = 13,
|
||||
/**
|
||||
* A source control remote completion item.
|
||||
* Example: `origin`
|
||||
*/
|
||||
ScmRemote = 14,
|
||||
/**
|
||||
* A pull request completion item.
|
||||
* Example: `#42 Add new feature`
|
||||
*/
|
||||
PullRequest = 15,
|
||||
/**
|
||||
* A closed pull request completion item.
|
||||
* Example: `#41 Fix bug (closed)`
|
||||
*/
|
||||
PullRequestDone = 16,
|
||||
}
|
||||
|
||||
/**
|
||||
* Context information passed to {@link TerminalCompletionProvider.provideTerminalCompletions}.
|
||||
*
|
||||
* It contains the full command line and the current cursor position.
|
||||
*/
|
||||
export interface TerminalCompletionContext {
|
||||
/**
|
||||
* The complete terminal command line.
|
||||
*/
|
||||
readonly commandLine: string;
|
||||
/**
|
||||
* The index of the cursor in the command line.
|
||||
*/
|
||||
readonly cursorIndex: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a collection of {@link TerminalCompletionItem completion items} to be presented
|
||||
* in the terminal plus {@link TerminalCompletionList.resourceOptions} which indicate
|
||||
* which file and folder resources should be requested for the terminal's cwd.
|
||||
*
|
||||
* @example <caption>Create a completion list that requests files for the terminal cwd</caption>
|
||||
* const list = new TerminalCompletionList([
|
||||
* { label: 'ls', replacementRange: [0, 0], kind: TerminalCompletionItemKind.Method }
|
||||
* ], { showFiles: true, cwd: Uri.file('/home/user') });
|
||||
*/
|
||||
export class TerminalCompletionList<T extends TerminalCompletionItem = TerminalCompletionItem> {
|
||||
|
||||
/**
|
||||
* Resources that should be shown in the completions list for the cwd of the terminal.
|
||||
*/
|
||||
resourceOptions?: TerminalCompletionResourceOptions;
|
||||
|
||||
/**
|
||||
* The completion items.
|
||||
*/
|
||||
items: T[];
|
||||
|
||||
/**
|
||||
* Creates a new completion list.
|
||||
*
|
||||
* @param items The completion items.
|
||||
* @param resourceOptions Indicates which resources should be shown as completions for the cwd of the terminal.
|
||||
*/
|
||||
constructor(items: T[], resourceOptions?: TerminalCompletionResourceOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration for requesting file and folder resources to be shown as completions.
|
||||
*
|
||||
* When a provider indicates that it wants file/folder resources, the terminal will surface completions for files and
|
||||
* folders that match {@link globPattern} from the provided {@link cwd}.
|
||||
*/
|
||||
export interface TerminalCompletionResourceOptions {
|
||||
/**
|
||||
* Show files as completion items.
|
||||
*/
|
||||
showFiles: boolean;
|
||||
/**
|
||||
* Show folders as completion items.
|
||||
*/
|
||||
showDirectories: boolean;
|
||||
/**
|
||||
* A glob pattern string that controls which files suggest should surface. Note that this will only apply if {@param showFiles} or {@param showDirectories} is set to true.
|
||||
*/
|
||||
globPattern?: string;
|
||||
/**
|
||||
* The cwd from which to request resources.
|
||||
*/
|
||||
cwd: Uri;
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
/**
|
||||
* Register a completion provider for terminals.
|
||||
* @param provider The completion provider.
|
||||
* @param triggerCharacters Optional characters that trigger completion. When any of these characters is typed,
|
||||
* the completion provider will be invoked. For example, passing `'-'` would cause the provider to be invoked
|
||||
* whenever the user types a dash character.
|
||||
* @returns A {@link Disposable} that unregisters this provider when being disposed.
|
||||
*
|
||||
* @example <caption>Register a provider for an extension</caption>
|
||||
* window.registerTerminalCompletionProvider({
|
||||
* provideTerminalCompletions(terminal, context) {
|
||||
* return new TerminalCompletionList([
|
||||
* { label: '--version', replacementRange: [Math.max(0, context.cursorPosition - 2), context.cursorPosition] }
|
||||
* ]);
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* @example <caption>Register a provider with trigger characters</caption>
|
||||
* window.registerTerminalCompletionProvider({
|
||||
* provideTerminalCompletions(terminal, context) {
|
||||
* return new TerminalCompletionList([
|
||||
* { label: '--help', replacementRange: [Math.max(0, context.cursorPosition - 2), context.cursorPosition] }
|
||||
* ]);
|
||||
* }
|
||||
* }, '-');
|
||||
*/
|
||||
export function registerTerminalCompletionProvider<T extends TerminalCompletionItem>(provider: TerminalCompletionProvider<T>, ...triggerCharacters: string[]): Disposable;
|
||||
}
|
||||
}
|
||||
103
packages/plugin/src/theia.proposed.terminalQuickFixProvider.d.ts
vendored
Normal file
103
packages/plugin/src/theia.proposed.terminalQuickFixProvider.d.ts
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
export type SingleOrMany<T> = T[] | T;
|
||||
|
||||
export namespace window {
|
||||
/**
|
||||
* @param provider A terminal quick fix provider
|
||||
* @return A {@link Disposable} that un-registers the provider when being disposed
|
||||
*/
|
||||
export function registerTerminalQuickFixProvider(id: string, provider: TerminalQuickFixProvider): Disposable;
|
||||
}
|
||||
|
||||
export interface TerminalQuickFixProvider {
|
||||
/**
|
||||
* Provides terminal quick fixes
|
||||
* @param commandMatchResult The command match result for which to provide quick fixes
|
||||
* @param token A cancellation token indicating the result is no longer needed
|
||||
* @return Terminal quick fix(es) if any
|
||||
*/
|
||||
provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token: CancellationToken):
|
||||
ProviderResult<SingleOrMany<TerminalQuickFixTerminalCommand | TerminalQuickFixOpener | Command>>;
|
||||
}
|
||||
|
||||
export interface TerminalCommandMatchResult {
|
||||
commandLine: string;
|
||||
commandLineMatch: RegExpMatchArray;
|
||||
outputMatch?: {
|
||||
regexMatch: RegExpMatchArray;
|
||||
outputLines?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export class TerminalQuickFixTerminalCommand {
|
||||
/**
|
||||
* The terminal command to insert or run
|
||||
*/
|
||||
terminalCommand: string;
|
||||
/**
|
||||
* Whether the command should be executed or just inserted (default)
|
||||
*/
|
||||
shouldExecute?: boolean;
|
||||
constructor(terminalCommand: string, shouldExecute?: boolean);
|
||||
}
|
||||
export class TerminalQuickFixOpener {
|
||||
/**
|
||||
* The uri to open
|
||||
*/
|
||||
uri: Uri;
|
||||
constructor(uri: Uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* A matcher that runs on a sub-section of a terminal command's output
|
||||
*/
|
||||
interface TerminalOutputMatcher {
|
||||
/**
|
||||
* A string or regex to match against the unwrapped line. If this is a regex with the multiline
|
||||
* flag, it will scan an amount of lines equal to `\n` instances in the regex + 1.
|
||||
*/
|
||||
lineMatcher: string | RegExp;
|
||||
/**
|
||||
* Which side of the output to anchor the {@link offset} and {@link length} against.
|
||||
*/
|
||||
anchor: TerminalOutputAnchor;
|
||||
/**
|
||||
* The number of rows above or below the {@link anchor} to start matching against.
|
||||
*/
|
||||
offset: number;
|
||||
/**
|
||||
* The number of wrapped lines to match against, this should be as small as possible for performance
|
||||
* reasons. This is capped at 40.
|
||||
*/
|
||||
length: number;
|
||||
}
|
||||
|
||||
enum TerminalOutputAnchor {
|
||||
Top = 0,
|
||||
Bottom = 1
|
||||
}
|
||||
|
||||
}
|
||||
64
packages/plugin/src/theia.proposed.textEditorDiffInformation.d.ts
vendored
Normal file
64
packages/plugin/src/theia.proposed.textEditorDiffInformation.d.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2025 STMicroelectronics and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.103.2/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
// https://github.com/microsoft/vscode/issues/84899
|
||||
|
||||
export enum TextEditorChangeKind {
|
||||
Addition = 1,
|
||||
Deletion = 2,
|
||||
Modification = 3
|
||||
}
|
||||
|
||||
export interface TextEditorLineRange {
|
||||
readonly startLineNumber: number;
|
||||
readonly endLineNumberExclusive: number;
|
||||
}
|
||||
|
||||
export interface TextEditorChange {
|
||||
readonly original: TextEditorLineRange;
|
||||
readonly modified: TextEditorLineRange;
|
||||
readonly kind: TextEditorChangeKind;
|
||||
}
|
||||
|
||||
export interface TextEditorDiffInformation {
|
||||
readonly documentVersion: number;
|
||||
readonly original: Uri | undefined;
|
||||
readonly modified: Uri;
|
||||
readonly changes: readonly TextEditorChange[];
|
||||
readonly isStale: boolean;
|
||||
}
|
||||
|
||||
export interface TextEditorDiffInformationChangeEvent {
|
||||
readonly textEditor: TextEditor;
|
||||
readonly diffInformation: TextEditorDiffInformation[] | undefined;
|
||||
}
|
||||
|
||||
export interface TextEditor {
|
||||
readonly diffInformation: TextEditorDiffInformation[] | undefined;
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
export const onDidChangeTextEditorDiffInformation: Event<TextEditorDiffInformationChangeEvent>;
|
||||
}
|
||||
|
||||
}
|
||||
145
packages/plugin/src/theia.proposed.textSearchProvider.d.ts
vendored
Normal file
145
packages/plugin/src/theia.proposed.textSearchProvider.d.ts
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.77.0/src/vscode-dts/vscode.proposed.textSearchQuery.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
/**
|
||||
* The parameters of a query for text search.
|
||||
*/
|
||||
export interface TextSearchQuery {
|
||||
/**
|
||||
* The text pattern to search for.
|
||||
*/
|
||||
pattern: string;
|
||||
|
||||
/**
|
||||
* Whether or not `pattern` should match multiple lines of text.
|
||||
*/
|
||||
isMultiline?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not `pattern` should be interpreted as a regular expression.
|
||||
*/
|
||||
isRegExp?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not the search should be case-sensitive.
|
||||
*/
|
||||
isCaseSensitive?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not to search for whole word matches only.
|
||||
*/
|
||||
isWordMatch?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A match from a text search
|
||||
*/
|
||||
export interface TextSearchMatch {
|
||||
/**
|
||||
* The uri for the matching document.
|
||||
*/
|
||||
uri: Uri;
|
||||
|
||||
/**
|
||||
* The range of the match within the document, or multiple ranges for multiple matches.
|
||||
*/
|
||||
ranges: Range | Range[];
|
||||
|
||||
/**
|
||||
* A preview of the text match.
|
||||
*/
|
||||
preview: TextSearchMatchPreview;
|
||||
}
|
||||
|
||||
/**
|
||||
* A preview of the text result.
|
||||
*/
|
||||
export interface TextSearchMatchPreview {
|
||||
/**
|
||||
* The matching lines of text, or a portion of the matching line that contains the match.
|
||||
*/
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* The Range within `text` corresponding to the text of the match.
|
||||
* The number of matches must match the TextSearchMatch's range property.
|
||||
*/
|
||||
matches: Range | Range[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to specify the size of the result text preview.
|
||||
* These options don't affect the size of the match itself, just the amount of preview text.
|
||||
*/
|
||||
export interface TextSearchPreviewOptions {
|
||||
/**
|
||||
* The maximum number of lines in the preview.
|
||||
* Only search providers that support multiline search will ever return more than one line in the match.
|
||||
*/
|
||||
matchLines: number;
|
||||
|
||||
/**
|
||||
* The maximum number of characters included per line.
|
||||
*/
|
||||
charsPerLine: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A line of context surrounding a TextSearchMatch.
|
||||
*/
|
||||
export interface TextSearchContext {
|
||||
/**
|
||||
* The uri for the matching document.
|
||||
*/
|
||||
uri: Uri;
|
||||
|
||||
/**
|
||||
* One line of text.
|
||||
* previewOptions.charsPerLine applies to this
|
||||
*/
|
||||
text: string;
|
||||
|
||||
/**
|
||||
* The line number of this line of context.
|
||||
*/
|
||||
lineNumber: number;
|
||||
}
|
||||
|
||||
export type TextSearchResult = TextSearchMatch | TextSearchContext;
|
||||
|
||||
/**
|
||||
* Information collected when text search is complete.
|
||||
*/
|
||||
export interface TextSearchComplete {
|
||||
/**
|
||||
* Whether the search hit the limit on the maximum number of search results.
|
||||
* `maxResults` on [`TextSearchOptions`](#TextSearchOptions) specifies the max number of results.
|
||||
* - If exactly that number of matches exist, this should be false.
|
||||
* - If `maxResults` matches are returned and more exist, this should be true.
|
||||
* - If search hits an internal limit which is less than `maxResults`, this should be true.
|
||||
*/
|
||||
limitHit?: boolean;
|
||||
}
|
||||
|
||||
}
|
||||
181
packages/plugin/src/theia.proposed.timeline.d.ts
vendored
Normal file
181
packages/plugin/src/theia.proposed.timeline.d.ts
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
// *****************************************************************************
|
||||
// Copyright (C) 2023 Ericsson and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under the
|
||||
// terms of the Eclipse Public License v. 2.0 which is available at
|
||||
// http://www.eclipse.org/legal/epl-2.0.
|
||||
//
|
||||
// This Source Code may also be made available under the following Secondary
|
||||
// Licenses when the conditions for such availability set forth in the Eclipse
|
||||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
||||
// with the GNU Classpath Exception which is available at
|
||||
// https://www.gnu.org/software/classpath/license.html.
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
||||
// *****************************************************************************
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// code copied and modified from https://github.com/microsoft/vscode/blob/1.106.1/src/vscode-dts/vscode.proposed.timeline.d.ts
|
||||
|
||||
export module '@theia/plugin' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/84297
|
||||
|
||||
export class TimelineItem {
|
||||
/**
|
||||
* A timestamp (in milliseconds since 1 January 1970 00:00:00) for when the timeline item occurred.
|
||||
*/
|
||||
timestamp: number;
|
||||
|
||||
/**
|
||||
* A human-readable string describing the timeline item.
|
||||
*/
|
||||
label: string;
|
||||
|
||||
/**
|
||||
* Optional id for the timeline item. It must be unique across all the timeline items provided by this source.
|
||||
*
|
||||
* If not provided, an id is generated using the timeline item's timestamp.
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* The icon path or {@link ThemeIcon} for the timeline item.
|
||||
*/
|
||||
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
|
||||
|
||||
/**
|
||||
* A human readable string describing less prominent details of the timeline item.
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* The tooltip text when you hover over the timeline item.
|
||||
*/
|
||||
tooltip?: string | MarkdownString | undefined;
|
||||
|
||||
/**
|
||||
* The {@link Command} that should be executed when the timeline item is selected.
|
||||
*/
|
||||
command?: Command;
|
||||
|
||||
/**
|
||||
* Context value of the timeline item. This can be used to contribute specific actions to the item.
|
||||
* For example, a timeline item is given a context value as `commit`. When contributing actions to `timeline/item/context`
|
||||
* using `menus` extension point, you can specify context value for key `timelineItem` in `when` expression like `timelineItem == commit`.
|
||||
* ```
|
||||
* "contributes": {
|
||||
* "menus": {
|
||||
* "timeline/item/context": [
|
||||
* {
|
||||
* "command": "extension.copyCommitId",
|
||||
* "when": "timelineItem == commit"
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* This will show the `extension.copyCommitId` action only for items where `contextValue` is `commit`.
|
||||
*/
|
||||
contextValue?: string;
|
||||
|
||||
/**
|
||||
* Accessibility information used when screen reader interacts with this timeline item.
|
||||
*/
|
||||
accessibilityInformation?: AccessibilityInformation;
|
||||
|
||||
/**
|
||||
* @param label A human-readable string describing the timeline item
|
||||
* @param timestamp A timestamp (in milliseconds since 1 January 1970 00:00:00) for when the timeline item occurred
|
||||
*/
|
||||
constructor(label: string, timestamp: number);
|
||||
}
|
||||
|
||||
export interface TimelineChangeEvent {
|
||||
/**
|
||||
* The {@link Uri} of the resource for which the timeline changed.
|
||||
*/
|
||||
uri: Uri;
|
||||
|
||||
/**
|
||||
* A flag which indicates whether the entire timeline should be reset.
|
||||
*/
|
||||
reset?: boolean;
|
||||
}
|
||||
|
||||
export interface Timeline {
|
||||
readonly paging?: {
|
||||
/**
|
||||
* A provider-defined cursor specifying the starting point of timeline items which are after the ones returned.
|
||||
* Use `undefined` to signal that there are no more items to be returned.
|
||||
*/
|
||||
readonly cursor: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* An array of {@link TimelineItem timeline items}.
|
||||
*/
|
||||
readonly items: readonly TimelineItem[];
|
||||
}
|
||||
|
||||
export interface TimelineOptions {
|
||||
/**
|
||||
* A provider-defined cursor specifying the starting point of the timeline items that should be returned.
|
||||
*/
|
||||
cursor?: string;
|
||||
|
||||
/**
|
||||
* An optional maximum number timeline items or the all timeline items newer (inclusive) than the timestamp or id that should be returned.
|
||||
* If `undefined` all timeline items should be returned.
|
||||
*/
|
||||
limit?: number | { timestamp: number; id?: string };
|
||||
}
|
||||
|
||||
export interface TimelineProvider {
|
||||
/**
|
||||
* An optional event to signal that the timeline for a source has changed.
|
||||
* To signal that the timeline for all resources (uris) has changed, do not pass any argument or pass `undefined`.
|
||||
*/
|
||||
readonly onDidChange?: Event<TimelineChangeEvent | undefined>;
|
||||
|
||||
/**
|
||||
* An identifier of the source of the timeline items. This can be used to filter sources.
|
||||
*/
|
||||
readonly id: string;
|
||||
|
||||
/**
|
||||
* A human-readable string describing the source of the timeline items. This can be used as the display label when filtering sources.
|
||||
*/
|
||||
readonly label: string;
|
||||
|
||||
/**
|
||||
* Provide {@link TimelineItem timeline items} for a {@link Uri}.
|
||||
*
|
||||
* @param uri The {@link Uri} of the file to provide the timeline for.
|
||||
* @param options A set of options to determine how results should be returned.
|
||||
* @param token A cancellation token.
|
||||
* @return The {@link TimelineResult timeline result} or a thenable that resolves to such. The lack of a result
|
||||
* can be signaled by returning `undefined`, `null`, or an empty array.
|
||||
*/
|
||||
provideTimeline(uri: Uri, options: TimelineOptions, token: CancellationToken): ProviderResult<Timeline>;
|
||||
}
|
||||
|
||||
export namespace workspace {
|
||||
/**
|
||||
* Register a timeline provider.
|
||||
*
|
||||
* Multiple providers can be registered. In that case, providers are asked in
|
||||
* parallel and the results are merged. A failing provider (rejected promise or exception) will
|
||||
* not cause a failure of the whole operation.
|
||||
*
|
||||
* @param scheme A scheme or schemes that defines which documents this provider is applicable to. Can be `*` to target all documents.
|
||||
* @param provider A timeline provider.
|
||||
* @return A {@link Disposable} that unregisters this provider when being disposed.
|
||||
*/
|
||||
export function registerTimelineProvider(scheme: string | string[], provider: TimelineProvider): Disposable;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user