Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

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

@@ -25,32 +25,19 @@ declare namespace monaco {
dispose(): void;
}
export enum Severity {
Ignore = 0,
Info = 1,
Warning = 2,
Error = 3,
}
export enum MarkerTag {
Unnecessary = 1,
export const enum MarkerTag {
Unnecessary = 1
}
export enum MarkerSeverity {
Hint = 1,
Info = 2,
Warning = 4,
Error = 8,
Error = 8
}
export type TValueCallback<T = any> = (value: T | PromiseLike<T>) => void;
export type ProgressCallback<TProgress = any> = (progress: TProgress) => void;
export class Promise<T = any, TProgress = any> {
constructor(
executor: (
@@ -184,188 +171,6 @@ declare namespace monaco {
query: string;
fragment: string;
}
/**
* Virtual Key Codes, the value does not hold any inherent meaning.
* Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
* But these are "more general", as they should work across browsers & OS`s.
*/
export enum KeyCode {
/**
* Placed first to cover the 0 value of the enum.
*/
Unknown = 0,
Backspace = 1,
Tab = 2,
Enter = 3,
Shift = 4,
Ctrl = 5,
Alt = 6,
PauseBreak = 7,
CapsLock = 8,
Escape = 9,
Space = 10,
PageUp = 11,
PageDown = 12,
End = 13,
Home = 14,
LeftArrow = 15,
UpArrow = 16,
RightArrow = 17,
DownArrow = 18,
Insert = 19,
Delete = 20,
KEY_0 = 21,
KEY_1 = 22,
KEY_2 = 23,
KEY_3 = 24,
KEY_4 = 25,
KEY_5 = 26,
KEY_6 = 27,
KEY_7 = 28,
KEY_8 = 29,
KEY_9 = 30,
KEY_A = 31,
KEY_B = 32,
KEY_C = 33,
KEY_D = 34,
KEY_E = 35,
KEY_F = 36,
KEY_G = 37,
KEY_H = 38,
KEY_I = 39,
KEY_J = 40,
KEY_K = 41,
KEY_L = 42,
KEY_M = 43,
KEY_N = 44,
KEY_O = 45,
KEY_P = 46,
KEY_Q = 47,
KEY_R = 48,
KEY_S = 49,
KEY_T = 50,
KEY_U = 51,
KEY_V = 52,
KEY_W = 53,
KEY_X = 54,
KEY_Y = 55,
KEY_Z = 56,
Meta = 57,
ContextMenu = 58,
F1 = 59,
F2 = 60,
F3 = 61,
F4 = 62,
F5 = 63,
F6 = 64,
F7 = 65,
F8 = 66,
F9 = 67,
F10 = 68,
F11 = 69,
F12 = 70,
F13 = 71,
F14 = 72,
F15 = 73,
F16 = 74,
F17 = 75,
F18 = 76,
F19 = 77,
NumLock = 78,
ScrollLock = 79,
/**
* Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ';:' key
*/
US_SEMICOLON = 80,
/**
* For any country/region, the '+' key
* For the US standard keyboard, the '=+' key
*/
US_EQUAL = 81,
/**
* For any country/region, the ',' key
* For the US standard keyboard, the ',<' key
*/
US_COMMA = 82,
/**
* For any country/region, the '-' key
* For the US standard keyboard, the '-_' key
*/
US_MINUS = 83,
/**
* For any country/region, the '.' key
* For the US standard keyboard, the '.>' key
*/
US_DOT = 84,
/**
* Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '/?' key
*/
US_SLASH = 85,
/**
* Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '`~' key
*/
US_BACKTICK = 86,
/**
* Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '[{' key
*/
US_OPEN_SQUARE_BRACKET = 87,
/**
* Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the '\|' key
*/
US_BACKSLASH = 88,
/**
* Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ']}' key
*/
US_CLOSE_SQUARE_BRACKET = 89,
/**
* Used for miscellaneous characters; it can vary by keyboard.
* For the US standard keyboard, the ''"' key
*/
US_QUOTE = 90,
/**
* Used for miscellaneous characters; it can vary by keyboard.
*/
OEM_8 = 91,
/**
* Either the angle bracket key or the backslash key on the RT 102-key keyboard.
*/
OEM_102 = 92,
NUMPAD_0 = 93,
NUMPAD_1 = 94,
NUMPAD_2 = 95,
NUMPAD_3 = 96,
NUMPAD_4 = 97,
NUMPAD_5 = 98,
NUMPAD_6 = 99,
NUMPAD_7 = 100,
NUMPAD_8 = 101,
NUMPAD_9 = 102,
NUMPAD_MULTIPLY = 103,
NUMPAD_ADD = 104,
NUMPAD_SEPARATOR = 105,
NUMPAD_SUBTRACT = 106,
NUMPAD_DECIMAL = 107,
NUMPAD_DIVIDE = 108,
/**
* Cover all key codes when IME is processing input.
*/
KEY_IN_COMPOSITION = 109,
ABNT_C1 = 110,
ABNT_C2 = 111,
/**
* Placed last to cover the length of the enum.
* Please do not depend on this value!
*/
MAX_VALUE = 112
}
export class KeyMod {
static readonly CtrlCmd: number;
static readonly Shift: number;
@@ -842,7 +647,7 @@ declare namespace monaco.editor {
/**
* Get the model that has `uri` if it exists.
*/
export function getModel(uri: Uri): ITextModel;
export function getModel(uri: Uri): ITextModel | null;
/**
* Get all the created models.
@@ -897,7 +702,7 @@ declare namespace monaco.editor {
export function tokenize(text: string, languageId: string): Token[][];
/**
* Define a new theme or updte an existing theme.
* Define a new theme or update an existing theme.
*/
export function defineTheme(themeName: string, themeData: IStandaloneThemeData): void;
@@ -1002,7 +807,7 @@ declare namespace monaco.editor {
contextMenuOrder?: number;
/**
* Method that will be executed when the action is triggered.
* @param editor The editor instance is passed in as a convinience
* @param editor The editor instance is passed in as a convenience
*/
run(editor: ICodeEditor): void | Promise<void>;
}
@@ -1014,7 +819,7 @@ declare namespace monaco.editor {
/**
* The initial model associated with this code editor.
*/
model?: ITextModel;
model?: ITextModel | null;
/**
* The initial value of the auto created model in the editor.
* To not create automatically a model, use `model: null`.
@@ -1055,13 +860,13 @@ declare namespace monaco.editor {
}
export interface IStandaloneCodeEditor extends ICodeEditor {
addCommand(keybinding: number, handler: ICommandHandler, context: string): string;
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;
addCommand(keybinding: number, handler: ICommandHandler, context: string): string | null;
createContextKey<T>(key: string, defaultValue: T): IContextKey<T>;
addAction(descriptor: IActionDescriptor): IDisposable;
getOriginalEditor(): IStandaloneCodeEditor;
@@ -1074,7 +879,7 @@ declare namespace monaco.editor {
export interface IContextKey<T> {
set(value: T): void;
reset(): void;
get(): T;
get(): T | undefined;
}
export interface IEditorOverrideServices {
@@ -4184,7 +3989,7 @@ declare namespace monaco.languages {
export function registerRenameProvider(languageId: string, provider: RenameProvider): IDisposable;
/**
* Register a signature help provider (used by e.g. paremeter hints).
* Register a signature help provider (used by e.g. parameter hints).
*/
export function registerSignatureHelpProvider(languageId: string, provider: SignatureHelpProvider): IDisposable;
@@ -4291,189 +4096,6 @@ declare namespace monaco.languages {
provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): (Command | CodeAction)[] | Thenable<(Command | CodeAction)[]>;
}
/**
* Completion item kinds.
*/
export enum CompletionItemKind {
Text = 0,
Method = 1,
Function = 2,
Constructor = 3,
Field = 4,
Variable = 5,
Class = 6,
Interface = 7,
Module = 8,
Property = 9,
Unit = 10,
Value = 11,
Enum = 12,
Keyword = 13,
Snippet = 14,
Color = 15,
File = 16,
Reference = 17,
Folder = 18
}
/**
* A snippet string is a template which allows to insert text
* and to control the editor cursor when insertion happens.
*
* A snippet can define tab stops and placeholders with `$1`, `$2`
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
* the end of the snippet. Variables are defined with `$name` and
* `${name:default value}`. The full snippet syntax is documented
* [here](http://code.visualstudio.com/docs/editor/userdefinedsnippets#_creating-your-own-snippets).
*/
export interface SnippetString {
/**
* The snippet string.
*/
value: string;
}
/**
* A completion item represents a text snippet that is
* proposed to complete text that is being typed.
*/
export interface CompletionItem {
/**
* The label of this completion item. By default
* this is also the text that is inserted when selecting
* this completion.
*/
label: string;
/**
* The kind of this completion item. Based on the kind
* an icon is chosen by the editor.
*/
kind: CompletionItemKind;
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
*/
detail?: string;
/**
* A human-readable string that represents a doc-comment.
*/
documentation?: string | IMarkdownString;
/**
* A command that should be run upon acceptance of this item.
*/
command?: Command;
/**
* A string that should be used when comparing this item
* with other items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
sortText?: string;
/**
* A string that should be used when filtering a set of
* completion items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
filterText?: string;
/**
* A string or snippet that should be inserted in a document when selecting
* this completion. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
insertText?: string | SnippetString;
/**
* A range of text that should be replaced by this completion item.
*
* Defaults to a range from the start of the [current word](#TextDocument.getWordRangeAtPosition) to the
* current position.
*
* *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?: Range;
/**
* 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
* characters will be ignored.
*/
commitCharacters?: string[];
/**
* @deprecated **Deprecated** in favor of `CompletionItem.insertText` and `CompletionItem.range`.
*
* ~~An [edit](#TextEdit) which is applied to a document when selecting
* this completion. When an edit is provided the value of
* [insertText](#CompletionItem.insertText) is ignored.~~
*
* ~~The [range](#Range) of the edit must be single-line and on the same
* line completions were [requested](#CompletionItemProvider.provideCompletionItems) at.~~
*/
textEdit?: editor.ISingleEditOperation;
/**
* An optional array of additional text edits that are applied when
* selecting this completion. Edits must not overlap with the main edit
* nor with themselves.
*/
additionalTextEdits?: editor.ISingleEditOperation[];
}
/**
* Represents a collection of [completion items](#CompletionItem) to be presented
* in the editor.
*/
export interface CompletionList {
/**
* This list it not complete. Further typing should result in recomputing
* this list.
*/
isIncomplete?: boolean;
/**
* The completion items.
*/
items: CompletionItem[];
}
/**
* Contains additional information about the context in which
* [completion provider](#CompletionItemProvider.provideCompletionItems) is triggered.
*/
export interface CompletionContext {
/**
* How the completion was triggered.
*/
triggerKind: SuggestTriggerKind;
/**
* Character that triggered the completion item provider.
*
* `undefined` if provider was not triggered by a character.
*/
triggerCharacter?: string;
}
/**
* The completion item provider interface defines the contract between extensions and
* the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).
*
* When computing *complete* completion items is expensive, providers can optionally implement
* the `resolveCompletionItem`-function. In that case it is enough to return completion
* items with a [label](#CompletionItem.label) from the
* [provideCompletionItems](#CompletionItemProvider.provideCompletionItems)-function. Subsequently,
* when a completion item is shown in the UI and gains focus this provider is asked to resolve
* the item, like adding [doc-comment](#CompletionItem.documentation) or [details](#CompletionItem.detail).
*/
export interface CompletionItemProvider {
triggerCharacters?: string[];
/**
* Provide completion items for the given position and document.
*/
provideCompletionItems(document: editor.ITextModel, position: Position, token: CancellationToken, context: CompletionContext): CompletionItem[] | Thenable<CompletionItem[]> | CompletionList | Thenable<CompletionList>;
/**
* Given a completion item fill in more data, like [doc-comment](#CompletionItem.documentation)
* or [details](#CompletionItem.detail).
*
* The editor will only resolve a completion item once.
*/
resolveCompletionItem?(item: CompletionItem, token: CancellationToken): CompletionItem | Thenable<CompletionItem>;
}
/**
* Describes how comments for a language work.
*/
@@ -5368,15 +4990,15 @@ declare namespace monaco.languages {
tokenPostfix?: string;
}
export type IShortMonarchLanguageRule1 = [RegExp, string | IMonarchLanguageAction];
export type IShortMonarchLanguageRule2 = [RegExp, string | IMonarchLanguageAction, string];
/**
* A rule is either a regular expression and an action
* shorthands: [reg,act] == { regex: reg, action: act}
* and : [reg,act,nxt] == { regex: reg, action: act{ next: nxt }}
*/
export type IShortMonarchLanguageRule1 = [RegExp, IMonarchLanguageAction];
export type IShortMonarchLanguageRule2 = [RegExp, IMonarchLanguageAction, string];
export interface IExpandedMonarchLanguageRule {
/**
* match tokens
@@ -5399,7 +5021,9 @@ declare namespace monaco.languages {
* ... or a case statement with guards...
* ... or a basic action with a token value.
*/
export interface IMonarchLanguageAction {
export type IShortMonarchLanguageAction = string;
export interface IExpandedMonarchLanguageAction {
/**
* array of actions for each parenthesized match group
*/
@@ -5429,7 +5053,7 @@ declare namespace monaco.languages {
*/
bracket?: string;
/**
* switch to embedded language (useing the mimetype) or get out using "@pop"
* switch to embedded language (using the mimetype) or get out using "@pop"
*/
nextEmbedded?: string;
/**
@@ -5438,6 +5062,8 @@ declare namespace monaco.languages {
log?: string;
}
export type IMonarchLanguageAction = IShortMonarchLanguageAction | IExpandedMonarchLanguageAction | IShortMonarchLanguageAction[] | IExpandedMonarchLanguageAction[];
/**
* This interface can be shortened as an array, ie. ['{','}','delimiter.curly']
*/
@@ -5447,7 +5073,7 @@ declare namespace monaco.languages {
*/
open: string;
/**
* closeing bracket
* closing bracket
*/
close: string;
/**
@@ -5475,3 +5101,5 @@ declare namespace monaco.worker {
}
}
//dtsv=2