mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
308
src/vs/vscode.proposed.d.ts
vendored
308
src/vs/vscode.proposed.d.ts
vendored
@@ -7,29 +7,128 @@
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
export interface OpenDialogOptions {
|
||||
uri?: Uri;
|
||||
openFiles?: boolean;
|
||||
openFolders?: boolean;
|
||||
openMany?: boolean;
|
||||
// export enum FileErrorCodes {
|
||||
// /**
|
||||
// * Not owner.
|
||||
// */
|
||||
// EPERM = 1,
|
||||
// /**
|
||||
// * No such file or directory.
|
||||
// */
|
||||
// ENOENT = 2,
|
||||
// /**
|
||||
// * I/O error.
|
||||
// */
|
||||
// EIO = 5,
|
||||
// /**
|
||||
// * Permission denied.
|
||||
// */
|
||||
// EACCES = 13,
|
||||
// /**
|
||||
// * File exists.
|
||||
// */
|
||||
// EEXIST = 17,
|
||||
// /**
|
||||
// * Not a directory.
|
||||
// */
|
||||
// ENOTDIR = 20,
|
||||
// /**
|
||||
// * Is a directory.
|
||||
// */
|
||||
// EISDIR = 21,
|
||||
// /**
|
||||
// * File too large.
|
||||
// */
|
||||
// EFBIG = 27,
|
||||
// /**
|
||||
// * No space left on device.
|
||||
// */
|
||||
// ENOSPC = 28,
|
||||
// /**
|
||||
// * Directory is not empty.
|
||||
// */
|
||||
// ENOTEMPTY = 66,
|
||||
// /**
|
||||
// * Invalid file handle.
|
||||
// */
|
||||
// ESTALE = 70,
|
||||
// /**
|
||||
// * Illegal NFS file handle.
|
||||
// */
|
||||
// EBADHANDLE = 10001,
|
||||
// }
|
||||
|
||||
export enum FileChangeType {
|
||||
Updated = 0,
|
||||
Added = 1,
|
||||
Deleted = 2
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
export interface FileChange {
|
||||
type: FileChangeType;
|
||||
resource: Uri;
|
||||
}
|
||||
|
||||
export function showOpenDialog(options: OpenDialogOptions): Thenable<Uri[]>;
|
||||
export enum FileType {
|
||||
File = 0,
|
||||
Dir = 1,
|
||||
Symlink = 2
|
||||
}
|
||||
|
||||
export interface FileStat {
|
||||
id: number | string;
|
||||
mtime: number;
|
||||
// atime: number;
|
||||
size: number;
|
||||
type: FileType;
|
||||
}
|
||||
|
||||
// todo@joh discover files etc
|
||||
export interface FileSystemProvider {
|
||||
// todo@joh -> added, deleted, renamed, changed
|
||||
onDidChange: Event<Uri>;
|
||||
|
||||
resolveContents(resource: Uri): string | Thenable<string>;
|
||||
writeContents(resource: Uri, contents: string): void | Thenable<void>;
|
||||
onDidChange?: Event<FileChange[]>;
|
||||
|
||||
// -- search
|
||||
// todo@joh - extract into its own provider?
|
||||
findFiles(query: string, progress: Progress<Uri>, token?: CancellationToken): Thenable<void>;
|
||||
root: Uri;
|
||||
|
||||
// more...
|
||||
//
|
||||
utimes(resource: Uri, mtime: number, atime: number): Thenable<FileStat>;
|
||||
|
||||
stat(resource: Uri): Thenable<FileStat>;
|
||||
|
||||
read(resource: Uri, offset: number, length: number, progress: Progress<Uint8Array>): Thenable<number>;
|
||||
|
||||
// todo@remote
|
||||
// offset - byte offset to start
|
||||
// count - number of bytes to write
|
||||
// Thenable<number> - number of bytes actually written
|
||||
write(resource: Uri, content: Uint8Array): Thenable<void>;
|
||||
|
||||
// todo@remote
|
||||
// Thenable<FileStat>
|
||||
move(resource: Uri, target: Uri): Thenable<FileStat>;
|
||||
|
||||
// todo@remote
|
||||
// helps with performance bigly
|
||||
// copy?(from: Uri, to: Uri): Thenable<void>;
|
||||
|
||||
// todo@remote
|
||||
// Thenable<FileStat>
|
||||
mkdir(resource: Uri): Thenable<FileStat>;
|
||||
|
||||
readdir(resource: Uri): Thenable<[Uri, FileStat][]>;
|
||||
|
||||
// todo@remote
|
||||
// ? merge both
|
||||
// ? recursive del
|
||||
rmdir(resource: Uri): Thenable<void>;
|
||||
unlink(resource: Uri): Thenable<void>;
|
||||
|
||||
// todo@remote
|
||||
// create(resource: Uri): Thenable<FileStat>;
|
||||
|
||||
// find files by names
|
||||
findFiles?(query: string, progress: Progress<Uri>, token: CancellationToken): Thenable<void>;
|
||||
}
|
||||
|
||||
export namespace workspace {
|
||||
@@ -70,177 +169,52 @@ declare module 'vscode' {
|
||||
export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a color in RGBA space.
|
||||
*/
|
||||
export class Color {
|
||||
//#region decorations
|
||||
|
||||
/**
|
||||
* The red component of this color in the range [0-1].
|
||||
*/
|
||||
readonly red: number;
|
||||
|
||||
/**
|
||||
* The green component of this color in the range [0-1].
|
||||
*/
|
||||
readonly green: number;
|
||||
|
||||
/**
|
||||
* The blue component of this color in the range [0-1].
|
||||
*/
|
||||
readonly blue: number;
|
||||
|
||||
/**
|
||||
* The alpha component of this color in the range [0-1].
|
||||
*/
|
||||
readonly alpha: number;
|
||||
|
||||
constructor(red: number, green: number, blue: number, alpha: number);
|
||||
|
||||
/**
|
||||
* Creates a color from the HSLA space.
|
||||
*
|
||||
* @param hue The hue component in the range [0-1].
|
||||
* @param saturation The saturation component in the range [0-1].
|
||||
* @param luminance The luminance component in the range [0-1].
|
||||
* @param alpha The alpha component in the range [0-1].
|
||||
*/
|
||||
static fromHSLA(hue: number, saturation: number, luminance: number, alpha: number): Color;
|
||||
|
||||
/**
|
||||
* Creates a color by from a hex string. Supported formats are: #RRGGBB, #RRGGBBAA, #RGB, #RGBA.
|
||||
* <code>null</code> is returned if the string does not match one of the supported formats.
|
||||
* @param hex a string to parse
|
||||
*/
|
||||
static fromHex(hex: string): Color | null;
|
||||
//todo@joh -> make class
|
||||
export interface DecorationData {
|
||||
priority?: number;
|
||||
title?: string;
|
||||
bubble?: boolean;
|
||||
abbreviation?: string;
|
||||
color?: ThemeColor;
|
||||
source?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A color format is either a single format or a combination of two
|
||||
* formats: an opaque one and a transparent one. The format itself
|
||||
* is a string representation of how the color can be formatted. It
|
||||
* supports the use of placeholders, similar to how snippets work.
|
||||
* Each placeholder, surrounded by curly braces `{}`, requires a
|
||||
* variable name and can optionally specify a number format and range
|
||||
* for that variable's value.
|
||||
*
|
||||
* Supported variables:
|
||||
* - `red`
|
||||
* - `green`
|
||||
* - `blue`
|
||||
* - `hue`
|
||||
* - `saturation`
|
||||
* - `luminance`
|
||||
* - `alpha`
|
||||
*
|
||||
* Supported number formats:
|
||||
* - `f`, float with 2 decimal points. This is the default format. Default range is `[0-1]`.
|
||||
* - `Xf`, float with `X` decimal points. Default range is `[0-1]`.
|
||||
* - `d`, decimal. Default range is `[0-255]`.
|
||||
* - `x`, `X`, hexadecimal. Default range is `[00-FF]`.
|
||||
*
|
||||
* The default number format is float. The default number range is `[0-1]`.
|
||||
*
|
||||
* As an example, take the color `Color(1, 0.5, 0, 1)`. Here's how
|
||||
* different formats would format it:
|
||||
*
|
||||
* - CSS RGB
|
||||
* - Format: `rgb({red:d[0-255]}, {green:d[0-255]}, {blue:d[0-255]})`
|
||||
* - Output: `rgb(255, 127, 0)`
|
||||
*
|
||||
* - CSS RGBA
|
||||
* - Format: `rgba({red:d[0-255]}, {green:d[0-255]}, {blue:d[0-255]}, {alpha})`
|
||||
* - Output: `rgba(255, 127, 0, 1)`
|
||||
*
|
||||
* - CSS Hexadecimal
|
||||
* - Format: `#{red:X}{green:X}{blue:X}`
|
||||
* - Output: `#FF7F00`
|
||||
*
|
||||
* - CSS HSLA
|
||||
* - Format: `hsla({hue:d[0-360]}, {saturation:d[0-100]}%, {luminance:d[0-100]}%, {alpha})`
|
||||
* - Output: `hsla(30, 100%, 50%, 1)`
|
||||
*/
|
||||
export type ColorFormat = string | { opaque: string, transparent: string };
|
||||
|
||||
/**
|
||||
* Represents a color range from a document.
|
||||
*/
|
||||
export class ColorRange {
|
||||
|
||||
/**
|
||||
* The range in the document where this color appers.
|
||||
*/
|
||||
range: Range;
|
||||
|
||||
/**
|
||||
* The actual color value for this color range.
|
||||
*/
|
||||
color: Color;
|
||||
|
||||
/**
|
||||
* The other formats this color range supports the color to be formatted in.
|
||||
*/
|
||||
availableFormats: ColorFormat[];
|
||||
|
||||
/**
|
||||
* Creates a new color range.
|
||||
*
|
||||
* @param range The range the color appears in. Must not be empty.
|
||||
* @param color The value of the color.
|
||||
* @param format The format in which this color is currently formatted.
|
||||
*/
|
||||
constructor(range: Range, color: Color, availableFormats: ColorFormat[]);
|
||||
export interface SourceControlResourceDecorations {
|
||||
source?: string;
|
||||
letter?: string;
|
||||
color?: ThemeColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* The document color provider defines the contract between extensions and feature of
|
||||
* picking and modifying colors in the editor.
|
||||
*/
|
||||
export interface DocumentColorProvider {
|
||||
/**
|
||||
* Provide colors for the given document.
|
||||
*
|
||||
* @param document The document in which the command was invoked.
|
||||
* @param token A cancellation token.
|
||||
* @return An array of [color ranges](#ColorRange) or a thenable that resolves to such. The lack of a result
|
||||
* can be signaled by returning `undefined`, `null`, or an empty array.
|
||||
*/
|
||||
provideDocumentColors(document: TextDocument, token: CancellationToken): ProviderResult<ColorRange[]>;
|
||||
export interface DecorationProvider {
|
||||
onDidChangeDecorations: Event<undefined | Uri | Uri[]>;
|
||||
provideDecoration(uri: Uri, token: CancellationToken): ProviderResult<DecorationData>;
|
||||
}
|
||||
|
||||
export namespace languages {
|
||||
export function registerColorProvider(selector: DocumentSelector, provider: DocumentColorProvider): Disposable;
|
||||
export namespace window {
|
||||
export function registerDecorationProvider(provider: DecorationProvider): Disposable;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// remove debug namespace
|
||||
//#endregion
|
||||
|
||||
/**
|
||||
* A debug configuration provider allows to add the initial debug configurations to a newly created launch.json
|
||||
* and allows to resolve a launch configuration before it is used to start a new debug session.
|
||||
* A debug configuration provider is registered via #workspace.registerDebugConfigurationProvider.
|
||||
* Represents the debug console.
|
||||
*/
|
||||
export interface DebugConfigurationProvider {
|
||||
export interface DebugConsole {
|
||||
/**
|
||||
* Provides initial [debug configuration](#DebugConfiguration). If more than one debug configuration provider is
|
||||
* registered for the same type, debug configurations are concatenated in arbitrary order.
|
||||
* Append the given value to the debug console.
|
||||
*
|
||||
* @param folder The workspace folder for which the configurations are used or undefined for a folderless setup.
|
||||
* @param token A cancellation token.
|
||||
* @return An array of [debug configurations](#DebugConfiguration).
|
||||
* @param value A string, falsy values will not be printed.
|
||||
*/
|
||||
provideDebugConfigurations?(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult<DebugConfiguration[]>;
|
||||
append(value: string): void;
|
||||
|
||||
/**
|
||||
* Resolves a [debug configuration](#DebugConfiguration) by filling in missing values or by adding/changing/removing attributes.
|
||||
* If more than one debug configuration provider is registered for the same type, the resolveDebugConfiguration calls are chained
|
||||
* in arbitrary order and the initial debug configuration is piped through the chain.
|
||||
* Append the given value and a line feed character
|
||||
* to the debug console.
|
||||
*
|
||||
* @param folder The workspace folder from which the configuration originates from or undefined for a folderless setup.
|
||||
* @param debugConfiguration The [debug configuration](#DebugConfiguration) to resolve.
|
||||
* @param token A cancellation token.
|
||||
* @return The resolved debug configuration.
|
||||
* @param value A string, falsy values will be printed.
|
||||
*/
|
||||
resolveDebugConfiguration?(folder: WorkspaceFolder | undefined, debugConfiguration: DebugConfiguration, token?: CancellationToken): ProviderResult<DebugConfiguration>;
|
||||
appendLine(value: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user