Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

108
src/vs/monaco.d.ts vendored
View File

@@ -21,7 +21,7 @@ declare namespace monaco {
export class Emitter<T> {
constructor();
readonly event: IEvent<T>;
fire(event?: T): void;
fire(event: T): void;
dispose(): void;
}
@@ -37,29 +37,6 @@ declare namespace monaco {
Error = 8
}
export class Promise<T = any> {
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason: any) => void) => void);
public then<TResult1 = T, TResult2 = never>(
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
public static as(value: null): Promise<null>;
public static as(value: undefined): Promise<undefined>;
public static as<T>(value: PromiseLike<T>): PromiseLike<T>;
public static as<T, SomePromise extends PromiseLike<T>>(value: SomePromise): SomePromise;
public static as<T>(value: T): Promise<T>;
public static join<T1, T2>(promises: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
public static join<T>(promises: (T | PromiseLike<T>)[]): Promise<T[]>;
public static wrap<T>(value: T | PromiseLike<T>): Promise<T>;
public static wrapError<T = never>(error: Error): Promise<T>;
}
export class CancellationTokenSource {
readonly token: CancellationToken;
cancel(): void;
@@ -385,6 +362,7 @@ declare namespace monaco {
*/
MAX_VALUE = 112
}
export class KeyMod {
static readonly CtrlCmd: number;
static readonly Shift: number;
@@ -490,7 +468,7 @@ declare namespace monaco {
/**
* Test if position `a` equals position `b`
*/
static equals(a: IPosition, b: IPosition): boolean;
static equals(a: IPosition | null, b: IPosition | null): boolean;
/**
* Test if this position is before other position.
* If the two positions are equal, the result will be false.
@@ -868,8 +846,8 @@ declare namespace monaco.editor {
/**
* Get markers for owner and/or resource
* @returns {IMarker[]} list of markers
* @param filter
*
* @returns list of markers
*/
export function getModelMarkers(filter: {
owner?: string;
@@ -1093,13 +1071,13 @@ declare namespace monaco.editor {
}
export interface IStandaloneCodeEditor extends ICodeEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null;
addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
}
export interface IStandaloneDiffEditor extends IDiffEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null;
addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
getOriginalEditor(): IStandaloneCodeEditor;
@@ -1993,8 +1971,8 @@ declare namespace monaco.editor {
* (Serializable) View state for the diff editor.
*/
export interface IDiffEditorViewState {
original: ICodeEditorViewState;
modified: ICodeEditorViewState;
original: ICodeEditorViewState | null;
modified: ICodeEditorViewState | null;
}
/**
@@ -2285,6 +2263,7 @@ declare namespace monaco.editor {
* An event describing that some ranges of lines have been tokenized (their tokens have changed).
*/
export interface IModelTokensChangedEvent {
readonly tokenizationSupportChanged: boolean;
readonly ranges: {
/**
* The start of the range (inclusive)
@@ -2561,7 +2540,7 @@ declare namespace monaco.editor {
/**
* Enable using global storage for remembering suggestions.
*/
useGlobalStorageForSuggestions?: boolean;
shareSuggestSelections?: boolean;
}
/**
@@ -2809,6 +2788,11 @@ declare namespace monaco.editor {
* Defaults to 1.
*/
mouseWheelScrollSensitivity?: number;
/**
* FastScrolling mulitplier speed when pressing `Alt`
* Defaults to 5.
*/
fastScrollSensitivity?: number;
/**
* The modifier to be used to add multiple cursors with the mouse.
* Defaults to 'alt'
@@ -3171,6 +3155,7 @@ declare namespace monaco.editor {
readonly verticalScrollbarSize: number;
readonly verticalSliderSize: number;
readonly mouseWheelScrollSensitivity: number;
readonly fastScrollSensitivity: number;
}
export interface InternalEditorMinimapOptions {
@@ -4058,7 +4043,7 @@ declare namespace monaco.editor {
/**
* Force an editor render now.
*/
render(): void;
render(forceRedraw?: boolean): void;
/**
* Get the hit test target at coordinates `clientX` and `clientY`.
* The coordinates are relative to the top-left of the viewport.
@@ -4390,8 +4375,6 @@ declare namespace monaco.languages {
export interface CodeActionContext {
/**
* An array of diagnostics.
*
* @readonly
*/
readonly markers: editor.IMarkerData[];
/**
@@ -4408,7 +4391,7 @@ declare namespace monaco.languages {
/**
* Provide commands for the given document and range.
*/
provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): (Command | CodeAction)[] | Thenable<(Command | CodeAction)[]>;
provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): (Command | CodeAction)[] | Promise<(Command | CodeAction)[]>;
}
/**
@@ -4783,7 +4766,7 @@ declare namespace monaco.languages {
* *Note:* The range must be a [single line](#Range.isSingleLine) and it must
* [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems).
*/
range?: IRange;
range: IRange;
/**
* An optional set of characters that when pressed while this completion is active will accept it first and
* then type that character. *Note* that all commit characters should have `length=1` and that superfluous
@@ -4866,6 +4849,7 @@ declare namespace monaco.languages {
edit?: WorkspaceEdit;
diagnostics?: editor.IMarkerData[];
kind?: string;
isPreferred?: boolean;
}
/**
@@ -4937,6 +4921,7 @@ declare namespace monaco.languages {
readonly triggerKind: SignatureHelpTriggerKind;
readonly triggerCharacter?: string;
readonly isRetrigger: boolean;
readonly activeSignatureHelp?: SignatureHelp;
}
/**
@@ -5035,20 +5020,28 @@ declare namespace monaco.languages {
range: IRange;
}
/**
* The definition of a symbol represented as one or many [locations](#Location).
* For most programming languages there is only one location at which a symbol is
* defined.
*/
export type Definition = Location | Location[];
export interface DefinitionLink {
origin?: IRange;
export interface LocationLink {
/**
* A range to select where this link originates from.
*/
originSelectionRange?: IRange;
/**
* The target uri this link points to.
*/
uri: Uri;
/**
* The full range this link points to.
*/
range: IRange;
selectionRange?: IRange;
/**
* A range to select this link points to. Must be contained
* in `LocationLink.range`.
*/
targetSelectionRange?: IRange;
}
export type Definition = Location | Location[] | LocationLink[];
/**
* The definition provider interface defines the contract between extensions and
* the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)
@@ -5058,7 +5051,7 @@ declare namespace monaco.languages {
/**
* Provide the definition of the symbol at the given position and document.
*/
provideDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
provideDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
@@ -5070,7 +5063,7 @@ declare namespace monaco.languages {
/**
* Provide the declaration of the symbol at the given position and document.
*/
provideDeclaration(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
provideDeclaration(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
@@ -5081,7 +5074,7 @@ declare namespace monaco.languages {
/**
* Provide the implementation of the symbol at the given position and document.
*/
provideImplementation(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
provideImplementation(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
@@ -5092,7 +5085,7 @@ declare namespace monaco.languages {
/**
* Provide the type definition of the symbol at the given position and document.
*/
provideTypeDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
provideTypeDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
@@ -5174,6 +5167,7 @@ declare namespace monaco.languages {
* the formatting-feature.
*/
export interface DocumentFormattingEditProvider {
displayName?: string;
/**
* Provide formatting edits for a whole document.
*/
@@ -5185,6 +5179,7 @@ declare namespace monaco.languages {
* the formatting-feature.
*/
export interface DocumentRangeFormattingEditProvider {
displayName?: string;
/**
* Provide formatting edits for a range in a document.
*
@@ -5299,11 +5294,16 @@ declare namespace monaco.languages {
provideColorPresentations(model: editor.ITextModel, colorInfo: IColorInformation, token: CancellationToken): ProviderResult<IColorPresentation[]>;
}
export interface SelectionRange {
kind: string;
range: IRange;
}
export interface SelectionRangeProvider {
/**
* Provide ranges that should be selected from the given position.
*/
provideSelectionRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<IRange[]>;
provideSelectionRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<SelectionRange[]>;
}
export interface FoldingContext {
@@ -5378,7 +5378,7 @@ declare namespace monaco.languages {
}
export interface WorkspaceEdit {
edits?: Array<ResourceTextEdit | ResourceFileEdit>;
edits: Array<ResourceTextEdit | ResourceFileEdit>;
}
export interface Rejection {
@@ -5568,4 +5568,4 @@ declare namespace monaco.worker {
}
//dtsv=2
//dtsv=2