Merge VS Code 1.21 source code (#1067)

* Initial VS Code 1.21 file copy with patches

* A few more merges

* Post npm install

* Fix batch of build breaks

* Fix more build breaks

* Fix more build errors

* Fix more build breaks

* Runtime fixes 1

* Get connection dialog working with some todos

* Fix a few packaging issues

* Copy several node_modules to package build to fix loader issues

* Fix breaks from master

* A few more fixes

* Make tests pass

* First pass of license header updates

* Second pass of license header updates

* Fix restore dialog issues

* Remove add additional themes menu items

* fix select box issues where the list doesn't show up

* formatting

* Fix editor dispose issue

* Copy over node modules to correct location on all platforms
This commit is contained in:
Karl Burtram
2018-04-04 15:27:51 -07:00
committed by GitHub
parent 5fba3e31b4
commit dafb780987
9412 changed files with 141255 additions and 98813 deletions

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

@@ -801,17 +801,17 @@ declare module monaco.editor {
* Create a new editor model.
* You can specify the language that should be set for this model or let the language be inferred from the `uri`.
*/
export function createModel(value: string, language?: string, uri?: Uri): IModel;
export function createModel(value: string, language?: string, uri?: Uri): ITextModel;
/**
* Change the language for a model.
*/
export function setModelLanguage(model: IModel, language: string): void;
export function setModelLanguage(model: ITextModel, language: string): void;
/**
* Set the markers for a model.
*/
export function setModelMarkers(model: IModel, owner: string, markers: IMarkerData[]): void;
export function setModelMarkers(model: ITextModel, owner: string, markers: IMarkerData[]): void;
/**
* Get markers for owner and/or resource
@@ -827,31 +827,31 @@ declare module monaco.editor {
/**
* Get the model that has `uri` if it exists.
*/
export function getModel(uri: Uri): IModel;
export function getModel(uri: Uri): ITextModel;
/**
* Get all the created models.
*/
export function getModels(): IModel[];
export function getModels(): ITextModel[];
/**
* Emitted when a model is created.
* @event
*/
export function onDidCreateModel(listener: (model: IModel) => void): IDisposable;
export function onDidCreateModel(listener: (model: ITextModel) => void): IDisposable;
/**
* Emitted right before a model is disposed.
* @event
*/
export function onWillDisposeModel(listener: (model: IModel) => void): IDisposable;
export function onWillDisposeModel(listener: (model: ITextModel) => void): IDisposable;
/**
* Emitted when a different language is set to a model.
* @event
*/
export function onDidChangeModelLanguage(listener: (e: {
readonly model: IModel;
readonly model: ITextModel;
readonly oldLanguage: string;
}) => void): IDisposable;
@@ -874,7 +874,7 @@ declare module monaco.editor {
/**
* Colorize a line in a model.
*/
export function colorizeModelLine(model: IModel, lineNumber: number, tabSize?: number): string;
export function colorizeModelLine(model: ITextModel, lineNumber: number, tabSize?: number): string;
/**
* Tokenize `text` using language `languageId`
@@ -998,7 +998,7 @@ declare module monaco.editor {
/**
* The initial model associated with this code editor.
*/
model?: IModel;
model?: ITextModel;
/**
* The initial value of the auto created model in the editor.
* To not create automatically a model, use `model: null`.
@@ -1317,70 +1317,6 @@ declare module monaco.editor {
minor: number;
}
/**
* A builder and helper for edit operations for a command.
*/
export interface IEditOperationBuilder {
/**
* Add a new edit operation (a replace operation).
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addEditOperation(range: Range, text: string): void;
/**
* Add a new edit operation (a replace operation).
* The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addTrackedEditOperation(range: Range, text: string): void;
/**
* Track `selection` when applying edit operations.
* A best effort will be made to not grow/expand the selection.
* An empty selection will clamp to a nearby character.
* @param selection The selection to track.
* @param trackPreviousOnEmpty If set, and the selection is empty, indicates whether the selection
* should clamp to the previous or the next character.
* @return A unique identifer.
*/
trackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string;
}
/**
* A helper for computing cursor state after a command.
*/
export interface ICursorStateComputerData {
/**
* Get the inverse edit operations of the added edit operations.
*/
getInverseEditOperations(): IIdentifiedSingleEditOperation[];
/**
* Get a previously tracked selection.
* @param id The unique identifier returned by `trackSelection`.
* @return The selection.
*/
getTrackedSelection(id: string): Selection;
}
/**
* A command that modifies text / cursor state on a model.
*/
export interface ICommand {
/**
* Get the edit operations needed to execute this command.
* @param model The model the command will execute on.
* @param builder A helper to collect the needed edit operations and to track selections.
*/
getEditOperations(model: ITokenizedModel, builder: IEditOperationBuilder): void;
/**
* Compute the cursor state after the edit operations were applied.
* @param model The model the commad has executed on.
* @param helper A helper to get inverse edit operations and to get previously tracked selections.
* @return The cursor state after the command executed.
*/
computeCursorState(model: ITokenizedModel, helper: ICursorStateComputerData): Selection;
}
/**
* A single edit operation, that acts as a simple replace.
* i.e. Replace text at `range` with `text` in model.
@@ -1405,10 +1341,6 @@ declare module monaco.editor {
* A single edit operation, that has an identifier.
*/
export interface IIdentifiedSingleEditOperation {
/**
* An identifier associated with this single edit operation.
*/
identifier: ISingleEditOperationIdentifier;
/**
* The range to replace. This can be empty to emulate a simple insert.
*/
@@ -1421,12 +1353,7 @@ declare module monaco.editor {
* This indicates that this operation has "insert" semantics.
* i.e. forceMoveMarkers = true => if `range` is collapsed, all markers at the position will be moved.
*/
forceMoveMarkers: boolean;
/**
* This indicates that this operation is inserting automatic whitespace
* that can be removed on next model edit operation if `config.trimAutoWhitespace` is true.
*/
isAutoWhitespaceEdit?: boolean;
forceMoveMarkers?: boolean;
}
/**
@@ -1453,10 +1380,35 @@ declare module monaco.editor {
trimAutoWhitespace?: boolean;
}
export class FindMatch {
_findMatchBrand: void;
readonly range: Range;
readonly matches: string[];
}
/**
* A textual read-only model.
* Describes the behavior of decorations when typing/editing near their edges.
* Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`
*/
export enum TrackedRangeStickiness {
AlwaysGrowsWhenTypingAtEdges = 0,
NeverGrowsWhenTypingAtEdges = 1,
GrowsOnlyWhenTypingBefore = 2,
GrowsOnlyWhenTypingAfter = 3,
}
/**
* A model.
*/
export interface ITextModel {
/**
* Gets the resource associated with this editor model.
*/
readonly uri: Uri;
/**
* A unique identifier associated with this model.
*/
readonly id: string;
/**
* Get the resolved options for this model.
*/
@@ -1594,7 +1546,7 @@ declare module monaco.editor {
* @param limitResultCount Limit the number of results
* @return The ranges where the matches are. It is empty if not matches have been found.
*/
findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[];
findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[];
/**
* Search the model.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
@@ -1606,7 +1558,7 @@ declare module monaco.editor {
* @param limitResultCount Limit the number of results
* @return The ranges where the matches are. It is empty if no matches have been found.
*/
findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean, limitResultCount?: number): FindMatch[];
findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean, limitResultCount?: number): FindMatch[];
/**
* Search the model for the next match. Loops to the beginning of the model if needed.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
@@ -1617,7 +1569,7 @@ declare module monaco.editor {
* @param captureMatches The result will contain the captured groups.
* @return The range where the next match is. It is null if no next match has been found.
*/
findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch;
findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch;
/**
* Search the model for the previous match. Loops to the end of the model if needed.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
@@ -1628,20 +1580,7 @@ declare module monaco.editor {
* @param captureMatches The result will contain the captured groups.
* @return The range where the previous match is. It is null if no previous match has been found.
*/
findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string, captureMatches: boolean): FindMatch;
}
export class FindMatch {
_findMatchBrand: void;
readonly range: Range;
readonly matches: string[];
}
export interface IReadOnlyModel extends ITextModel {
/**
* Gets the resource associated with this editor model.
*/
readonly uri: Uri;
findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wordSeparators: string | null, captureMatches: boolean): FindMatch;
/**
* Get the language associated with this model.
*/
@@ -1660,12 +1599,6 @@ declare module monaco.editor {
* @return The word under or besides `position`. Will never be null.
*/
getWordUntilPosition(position: IPosition): IWordAtPosition;
}
/**
* A model that is tokenized.
*/
export interface ITokenizedModel extends ITextModel {
/**
* Get the language associated with this model.
*/
@@ -1684,23 +1617,6 @@ declare module monaco.editor {
* @return The word under or besides `position`. Will never be null.
*/
getWordUntilPosition(position: IPosition): IWordAtPosition;
}
/**
* Describes the behavior of decorations when typing/editing near their edges.
* Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`
*/
export enum TrackedRangeStickiness {
AlwaysGrowsWhenTypingAtEdges = 0,
NeverGrowsWhenTypingAtEdges = 1,
GrowsOnlyWhenTypingBefore = 2,
GrowsOnlyWhenTypingAfter = 3,
}
/**
* A model that can have decorations.
*/
export interface ITextModelWithDecorations {
/**
* Perform a minimum ammount of operations, in order to transform the decorations
* identified by `oldDecorations` to the decorations described by `newDecorations`
@@ -1762,12 +1678,6 @@ declare module monaco.editor {
* @param filterOutValidation If set, it will ignore decorations specific to validation (i.e. warnings, errors).
*/
getOverviewRulerDecorations(ownerId?: number, filterOutValidation?: boolean): IModelDecoration[];
}
/**
* An editable text model.
*/
export interface IEditableTextModel extends ITextModel {
/**
* Normalize a string containing whitespace according to indentation rules (converts to spaces or to tabs).
*/
@@ -1806,12 +1716,6 @@ declare module monaco.editor {
* @return The inverse edit operations, that, when applied, will bring the model back to the previous state.
*/
applyEdits(operations: IIdentifiedSingleEditOperation[]): IIdentifiedSingleEditOperation[];
}
/**
* A model.
*/
export interface IModel extends IReadOnlyModel, IEditableTextModel, ITokenizedModel, ITextModelWithDecorations {
/**
* An event emitted when the contents of the model have changed.
* @event
@@ -1842,10 +1746,6 @@ declare module monaco.editor {
* @event
*/
onWillDispose(listener: () => void): IDisposable;
/**
* A unique identifier associated with this model.
*/
readonly id: string;
/**
* Destroy this model. This will unbind the model from the mode
* and make all necessary clean-up to release this object to the GC.
@@ -1853,6 +1753,70 @@ declare module monaco.editor {
dispose(): void;
}
/**
* A builder and helper for edit operations for a command.
*/
export interface IEditOperationBuilder {
/**
* Add a new edit operation (a replace operation).
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addEditOperation(range: Range, text: string): void;
/**
* Add a new edit operation (a replace operation).
* The inverse edits will be accessible in `ICursorStateComputerData.getInverseEditOperations()`
* @param range The range to replace (delete). May be empty to represent a simple insert.
* @param text The text to replace with. May be null to represent a simple delete.
*/
addTrackedEditOperation(range: Range, text: string): void;
/**
* Track `selection` when applying edit operations.
* A best effort will be made to not grow/expand the selection.
* An empty selection will clamp to a nearby character.
* @param selection The selection to track.
* @param trackPreviousOnEmpty If set, and the selection is empty, indicates whether the selection
* should clamp to the previous or the next character.
* @return A unique identifer.
*/
trackSelection(selection: Selection, trackPreviousOnEmpty?: boolean): string;
}
/**
* A helper for computing cursor state after a command.
*/
export interface ICursorStateComputerData {
/**
* Get the inverse edit operations of the added edit operations.
*/
getInverseEditOperations(): IIdentifiedSingleEditOperation[];
/**
* Get a previously tracked selection.
* @param id The unique identifier returned by `trackSelection`.
* @return The selection.
*/
getTrackedSelection(id: string): Selection;
}
/**
* A command that modifies text / cursor state on a model.
*/
export interface ICommand {
/**
* Get the edit operations needed to execute this command.
* @param model The model the command will execute on.
* @param builder A helper to collect the needed edit operations and to track selections.
*/
getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void;
/**
* Compute the cursor state after the edit operations were applied.
* @param model The model the commad has executed on.
* @param helper A helper to get inverse edit operations and to get previously tracked selections.
* @return The cursor state after the command executed.
*/
computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection;
}
/**
* A model for the diff editor.
*/
@@ -1860,11 +1824,11 @@ declare module monaco.editor {
/**
* Original model.
*/
original: IModel;
original: ITextModel;
/**
* Modified model.
*/
modified: IModel;
modified: ITextModel;
}
/**
@@ -1926,7 +1890,7 @@ declare module monaco.editor {
run(): Promise<void>;
}
export type IEditorModel = IModel | IDiffEditorModel;
export type IEditorModel = ITextModel | IDiffEditorModel;
/**
* A (serializable) state of the cursors.
@@ -2171,7 +2135,7 @@ declare module monaco.editor {
/**
* The type of the `IEditor`.
*/
export var EditorType: {
export const EditorType: {
ICodeEditor: string;
IDiffEditor: string;
};
@@ -2431,6 +2395,11 @@ declare module monaco.editor {
* Defaults to false.
*/
enabled?: boolean;
/**
* Control the side of the minimap in editor.
* Defaults to 'right'.
*/
side?: 'right' | 'left';
/**
* Control the rendering of the minimap slider.
* Defaults to 'mouseover'.
@@ -2574,6 +2543,10 @@ declare module monaco.editor {
* Defaults to 'line'.
*/
cursorStyle?: string;
/**
* Control the width of the cursor when cursorStyle is set to 'line'
*/
cursorWidth?: number;
/**
* Enable font ligatures.
* Defaults to false.
@@ -2769,6 +2742,10 @@ declare module monaco.editor {
* Enable word based suggestions. Defaults to 'true'
*/
wordBasedSuggestions?: boolean;
/**
* The history mode for suggestions.
*/
suggestSelection?: string;
/**
* The font size for the suggest widget.
* Defaults to the editor font size.
@@ -2993,6 +2970,7 @@ declare module monaco.editor {
export interface InternalEditorMinimapOptions {
readonly enabled: boolean;
readonly side: 'right' | 'left';
readonly showSlider: 'always' | 'mouseover';
readonly renderCharacters: boolean;
readonly maxColumn: number;
@@ -3039,6 +3017,7 @@ declare module monaco.editor {
readonly cursorBlinking: TextEditorCursorBlinkingStyle;
readonly mouseWheelZoom: boolean;
readonly cursorStyle: TextEditorCursorStyle;
readonly cursorWidth: number;
readonly hideCursorInOverviewRuler: boolean;
readonly scrollBeyondLastLine: boolean;
readonly smoothScrolling: boolean;
@@ -3073,6 +3052,7 @@ declare module monaco.editor {
readonly acceptSuggestionOnCommitCharacter: boolean;
readonly snippetSuggestions: 'top' | 'bottom' | 'inline' | 'none';
readonly wordBasedSuggestions: boolean;
readonly suggestSelection: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
readonly suggestFontSize: number;
readonly suggestLineHeight: number;
readonly selectionHighlight: boolean;
@@ -3193,6 +3173,10 @@ declare module monaco.editor {
* The height of the content (actual height)
*/
readonly contentHeight: number;
/**
* The position for the minimap
*/
readonly minimapLeft: number;
/**
* The width of the minimap
*/
@@ -3656,14 +3640,14 @@ declare module monaco.editor {
/**
* Type the getModel() of IEditor.
*/
getModel(): IModel;
getModel(): ITextModel;
/**
* Returns the current editor's configuration
*/
getConfiguration(): InternalEditorOptions;
/**
* Get value of the current model attached to this editor.
* @see IModel.getValue
* @see `ITextModel.getValue`
*/
getValue(options?: {
preserveBOM: boolean;
@@ -3671,7 +3655,7 @@ declare module monaco.editor {
}): string;
/**
* Set the value of the current model attached to this editor.
* @see IModel.setValue
* @see `ITextModel.setValue`
*/
setValue(newValue: string): void;
/**
@@ -3739,7 +3723,7 @@ declare module monaco.editor {
getLineDecorations(lineNumber: number): IModelDecoration[];
/**
* All decorations added through this call will get the ownerId of this editor.
* @see IModel.deltaDecorations
* @see `ITextModel.deltaDecorations`
*/
deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];
/**
@@ -3750,6 +3734,11 @@ declare module monaco.editor {
* Returns the range that is currently centered in the view port.
*/
getCenteredRangeInViewport(): Range;
/**
* Returns the ranges that are currently visible.
* Does not account for horizontal scrolling.
*/
getVisibleRanges(): Range[];
/**
* Get the vertical position (top offset) for the line w.r.t. to the first line.
*/
@@ -3901,6 +3890,10 @@ declare module monaco.editor {
readonly lineHeight: number;
readonly letterSpacing: number;
}
//compatibility:
export type IReadOnlyModel = ITextModel;
export type IModel = ITextModel;
}
declare module monaco.languages {
@@ -4059,6 +4052,9 @@ declare module monaco.languages {
*/
export function registerColorProvider(languageId: string, provider: DocumentColorProvider): IDisposable;
/**
* Register a folding provider
*/
/**
* Contains additional diagnostic information about the context in which
* a [code action](#CodeActionProvider.provideCodeActions) is run.
@@ -4070,6 +4066,10 @@ declare module monaco.languages {
* @readonly
*/
readonly markers: editor.IMarkerData[];
/**
* Requested kind of actions to return.
*/
readonly only?: string;
}
/**
@@ -4080,7 +4080,7 @@ declare module monaco.languages {
/**
* Provide commands for the given document and range.
*/
provideCodeActions(model: editor.IReadOnlyModel, range: Range, context: CodeActionContext, token: CancellationToken): (Command | CodeAction)[] | Thenable<(Command | CodeAction)[]>;
provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): (Command | CodeAction)[] | Thenable<(Command | CodeAction)[]>;
}
/**
@@ -4193,6 +4193,18 @@ declare module monaco.languages {
* 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[];
/**
* 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[];
}
/**
@@ -4244,7 +4256,7 @@ declare module monaco.languages {
/**
* Provide completion items for the given position and document.
*/
provideCompletionItems(document: editor.IReadOnlyModel, position: Position, token: CancellationToken, context: CompletionContext): CompletionItem[] | Thenable<CompletionItem[]> | CompletionList | Thenable<CompletionList>;
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).
@@ -4505,7 +4517,7 @@ declare module monaco.languages {
* position will be merged by the editor. A hover can have a range which defaults
* to the word range at the position when omitted.
*/
provideHover(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): Hover | Thenable<Hover>;
provideHover(model: editor.ITextModel, position: Position, token: CancellationToken): Hover | Thenable<Hover>;
}
/**
@@ -4514,13 +4526,15 @@ declare module monaco.languages {
export enum SuggestTriggerKind {
Invoke = 0,
TriggerCharacter = 1,
TriggerForIncompleteCompletions = 2,
}
export interface CodeAction {
title: string;
command?: Command;
edits?: WorkspaceEdit;
edit?: WorkspaceEdit;
diagnostics?: editor.IMarkerData[];
kind?: string;
}
/**
@@ -4591,7 +4605,7 @@ declare module monaco.languages {
/**
* Provide help for the signature at the given position and document.
*/
provideSignatureHelp(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): SignatureHelp | Thenable<SignatureHelp>;
provideSignatureHelp(model: editor.ITextModel, position: Position, token: CancellationToken): SignatureHelp | Thenable<SignatureHelp>;
}
/**
@@ -4637,7 +4651,7 @@ declare module monaco.languages {
* Provide a set of document highlights, like all occurrences of a variable or
* all exit-points of a function.
*/
provideDocumentHighlights(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): DocumentHighlight[] | Thenable<DocumentHighlight[]>;
provideDocumentHighlights(model: editor.ITextModel, position: Position, token: CancellationToken): DocumentHighlight[] | Thenable<DocumentHighlight[]>;
}
/**
@@ -4659,7 +4673,7 @@ declare module monaco.languages {
/**
* Provide a set of project-wide references for the given position and document.
*/
provideReferences(model: editor.IReadOnlyModel, position: Position, context: ReferenceContext, token: CancellationToken): Location[] | Thenable<Location[]>;
provideReferences(model: editor.ITextModel, position: Position, context: ReferenceContext, token: CancellationToken): Location[] | Thenable<Location[]>;
}
/**
@@ -4693,7 +4707,7 @@ declare module monaco.languages {
/**
* Provide the definition of the symbol at the given position and document.
*/
provideDefinition(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>;
provideDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>;
}
/**
@@ -4704,7 +4718,7 @@ declare module monaco.languages {
/**
* Provide the implementation of the symbol at the given position and document.
*/
provideImplementation(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>;
provideImplementation(model: editor.ITextModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>;
}
/**
@@ -4715,7 +4729,7 @@ declare module monaco.languages {
/**
* Provide the type definition of the symbol at the given position and document.
*/
provideTypeDefinition(model: editor.IReadOnlyModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>;
provideTypeDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): Definition | Thenable<Definition>;
}
/**
@@ -4781,7 +4795,7 @@ declare module monaco.languages {
/**
* Provide symbol information for the given document.
*/
provideDocumentSymbols(model: editor.IReadOnlyModel, token: CancellationToken): SymbolInformation[] | Thenable<SymbolInformation[]>;
provideDocumentSymbols(model: editor.ITextModel, token: CancellationToken): SymbolInformation[] | Thenable<SymbolInformation[]>;
}
export interface TextEdit {
@@ -4812,7 +4826,7 @@ declare module monaco.languages {
/**
* Provide formatting edits for a whole document.
*/
provideDocumentFormattingEdits(model: editor.IReadOnlyModel, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>;
provideDocumentFormattingEdits(model: editor.ITextModel, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>;
}
/**
@@ -4827,7 +4841,7 @@ declare module monaco.languages {
* or larger range. Often this is done by adjusting the start and end
* of the range to full syntax nodes.
*/
provideDocumentRangeFormattingEdits(model: editor.IReadOnlyModel, range: Range, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>;
provideDocumentRangeFormattingEdits(model: editor.ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>;
}
/**
@@ -4843,7 +4857,7 @@ declare module monaco.languages {
* what range the position to expand to, like find the matching `{`
* when `}` has been entered.
*/
provideOnTypeFormattingEdits(model: editor.IReadOnlyModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>;
provideOnTypeFormattingEdits(model: editor.ITextModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): TextEdit[] | Thenable<TextEdit[]>;
}
/**
@@ -4851,14 +4865,14 @@ declare module monaco.languages {
*/
export interface ILink {
range: IRange;
url: string;
url?: string;
}
/**
* A provider of links.
*/
export interface LinkProvider {
provideLinks(model: editor.IReadOnlyModel, token: CancellationToken): ILink[] | Thenable<ILink[]>;
provideLinks(model: editor.ITextModel, token: CancellationToken): ILink[] | Thenable<ILink[]>;
resolveLink?: (link: ILink, token: CancellationToken) => ILink | Thenable<ILink>;
}
@@ -4927,26 +4941,37 @@ declare module monaco.languages {
/**
* Provides the color ranges for a specific model.
*/
provideDocumentColors(model: editor.IReadOnlyModel, token: CancellationToken): IColorInformation[] | Thenable<IColorInformation[]>;
provideDocumentColors(model: editor.ITextModel, token: CancellationToken): IColorInformation[] | Thenable<IColorInformation[]>;
/**
* Provide the string representations for a color.
*/
provideColorPresentations(model: editor.IReadOnlyModel, colorInfo: IColorInformation, token: CancellationToken): IColorPresentation[] | Thenable<IColorPresentation[]>;
provideColorPresentations(model: editor.ITextModel, colorInfo: IColorInformation, token: CancellationToken): IColorPresentation[] | Thenable<IColorPresentation[]>;
}
export interface IResourceEdit {
export interface ResourceFileEdit {
oldUri: Uri;
newUri: Uri;
}
export interface ResourceTextEdit {
resource: Uri;
range: IRange;
newText: string;
modelVersionId?: number;
edits: TextEdit[];
}
export interface WorkspaceEdit {
edits: IResourceEdit[];
edits: Array<ResourceTextEdit | ResourceFileEdit>;
rejectReason?: string;
}
export interface RenameInitialValue {
range: IRange;
text?: string;
}
export interface RenameProvider {
provideRenameEdits(model: editor.IReadOnlyModel, position: Position, newName: string, token: CancellationToken): WorkspaceEdit | Thenable<WorkspaceEdit>;
provideRenameEdits(model: editor.ITextModel, position: Position, newName: string, token: CancellationToken): WorkspaceEdit | Thenable<WorkspaceEdit>;
resolveInitialRenameValue?(model: editor.ITextModel, position: Position, token: CancellationToken): RenameInitialValue | Thenable<RenameInitialValue>;
}
export interface Command {
@@ -4964,8 +4989,8 @@ declare module monaco.languages {
export interface CodeLensProvider {
onDidChange?: IEvent<this>;
provideCodeLenses(model: editor.IReadOnlyModel, token: CancellationToken): ICodeLensSymbol[] | Thenable<ICodeLensSymbol[]>;
resolveCodeLens?(model: editor.IReadOnlyModel, codeLens: ICodeLensSymbol, token: CancellationToken): ICodeLensSymbol | Thenable<ICodeLensSymbol>;
provideCodeLenses(model: editor.ITextModel, token: CancellationToken): ICodeLensSymbol[] | Thenable<ICodeLensSymbol[]>;
resolveCodeLens?(model: editor.ITextModel, codeLens: ICodeLensSymbol, token: CancellationToken): ICodeLensSymbol | Thenable<ICodeLensSymbol>;
}
export interface ILanguageExtensionPoint {