|
@@ -8,12 +8,18 @@
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
-declare namespace monaco {
|
|
|
+declare let MonacoEnvironment: monaco.Environment | undefined;
|
|
|
|
|
|
- // THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.
|
|
|
+declare namespace monaco {
|
|
|
|
|
|
export type Thenable<T> = PromiseLike<T>;
|
|
|
|
|
|
+ export interface Environment {
|
|
|
+ baseUrl?: string;
|
|
|
+ getWorker?(workerId: string, label: string): Worker;
|
|
|
+ getWorkerUrl?(workerId: string, label: string): string;
|
|
|
+ }
|
|
|
+
|
|
|
export interface IDisposable {
|
|
|
dispose(): void;
|
|
|
}
|
|
@@ -385,6 +391,7 @@ declare namespace monaco {
|
|
|
export interface IMarkdownString {
|
|
|
readonly value: string;
|
|
|
readonly isTrusted?: boolean;
|
|
|
+ readonly supportThemeIcons?: boolean;
|
|
|
uris?: {
|
|
|
[href: string]: UriComponents;
|
|
|
};
|
|
@@ -409,6 +416,7 @@ declare namespace monaco {
|
|
|
readonly leftButton: boolean;
|
|
|
readonly middleButton: boolean;
|
|
|
readonly rightButton: boolean;
|
|
|
+ readonly buttons: number;
|
|
|
readonly target: HTMLElement;
|
|
|
readonly detail: number;
|
|
|
readonly posx: number;
|
|
@@ -1049,7 +1057,7 @@ declare namespace monaco.editor {
|
|
|
* Method that will be executed when the action is triggered.
|
|
|
* @param editor The editor instance is passed in as a convenience
|
|
|
*/
|
|
|
- run(editor: ICodeEditor): void | Promise<void>;
|
|
|
+ run(editor: ICodeEditor, ...args: any[]): void | Promise<void>;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1064,7 +1072,7 @@ declare namespace monaco.editor {
|
|
|
tabSize?: number;
|
|
|
/**
|
|
|
* Insert spaces when pressing `Tab`.
|
|
|
- * This setting is overridden based on the file contents when detectIndentation` is on.
|
|
|
+ * This setting is overridden based on the file contents when `detectIndentation` is on.
|
|
|
* Defaults to true.
|
|
|
*/
|
|
|
insertSpaces?: boolean;
|
|
@@ -1179,7 +1187,10 @@ declare namespace monaco.editor {
|
|
|
owner: string;
|
|
|
resource: Uri;
|
|
|
severity: MarkerSeverity;
|
|
|
- code?: string;
|
|
|
+ code?: string | {
|
|
|
+ value: string;
|
|
|
+ link: Uri;
|
|
|
+ };
|
|
|
message: string;
|
|
|
source?: string;
|
|
|
startLineNumber: number;
|
|
@@ -1194,7 +1205,10 @@ declare namespace monaco.editor {
|
|
|
* A structure defining a problem/warning/etc.
|
|
|
*/
|
|
|
export interface IMarkerData {
|
|
|
- code?: string;
|
|
|
+ code?: string | {
|
|
|
+ value: string;
|
|
|
+ link: Uri;
|
|
|
+ };
|
|
|
severity: MarkerSeverity;
|
|
|
message: string;
|
|
|
source?: string;
|
|
@@ -1458,20 +1472,6 @@ declare namespace monaco.editor {
|
|
|
CRLF = 1
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * An identifier for a single edit operation.
|
|
|
- */
|
|
|
- export interface ISingleEditOperationIdentifier {
|
|
|
- /**
|
|
|
- * Identifier major
|
|
|
- */
|
|
|
- major: number;
|
|
|
- /**
|
|
|
- * Identifier minor
|
|
|
- */
|
|
|
- minor: number;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* A single edit operation, that acts as a simple replace.
|
|
|
* i.e. Replace text at `range` with `text` in model.
|
|
@@ -1910,14 +1910,14 @@ declare namespace monaco.editor {
|
|
|
* @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 | null): void;
|
|
|
+ addEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): 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 | null): void;
|
|
|
+ addTrackedEditOperation(range: Range, text: string | null, forceMoveMarkers?: boolean): void;
|
|
|
/**
|
|
|
* Track `selection` when applying edit operations.
|
|
|
* A best effort will be made to not grow/expand the selection.
|
|
@@ -2025,6 +2025,13 @@ declare namespace monaco.editor {
|
|
|
readonly charChanges: ICharChange[] | undefined;
|
|
|
}
|
|
|
|
|
|
+ export interface IContentSizeChangedEvent {
|
|
|
+ readonly contentWidth: number;
|
|
|
+ readonly contentHeight: number;
|
|
|
+ readonly contentWidthChanged: boolean;
|
|
|
+ readonly contentHeightChanged: boolean;
|
|
|
+ }
|
|
|
+
|
|
|
export interface INewScrollPosition {
|
|
|
scrollLeft?: number;
|
|
|
scrollTop?: number;
|
|
@@ -2363,23 +2370,6 @@ declare namespace monaco.editor {
|
|
|
export interface IModelDecorationsChangedEvent {
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 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)
|
|
|
- */
|
|
|
- readonly fromLineNumber: number;
|
|
|
- /**
|
|
|
- * The end of the range (inclusive)
|
|
|
- */
|
|
|
- readonly toLineNumber: number;
|
|
|
- }[];
|
|
|
- }
|
|
|
-
|
|
|
export interface IModelOptionsChangedEvent {
|
|
|
readonly tabSize: boolean;
|
|
|
readonly indentSize: boolean;
|
|
@@ -2544,7 +2534,7 @@ declare namespace monaco.editor {
|
|
|
* If it is a function, it will be invoked when rendering a line number and the return value will be rendered.
|
|
|
* Otherwise, if it is a truey, line numbers will be rendered normally (equivalent of using an identity function).
|
|
|
* Otherwise, line numbers will not be rendered.
|
|
|
- * Defaults to true.
|
|
|
+ * Defaults to `on`.
|
|
|
*/
|
|
|
lineNumbers?: LineNumbersType;
|
|
|
/**
|
|
@@ -2605,6 +2595,11 @@ declare namespace monaco.editor {
|
|
|
* Defaults to false.
|
|
|
*/
|
|
|
readOnly?: boolean;
|
|
|
+ /**
|
|
|
+ * Should the editor render validation decorations.
|
|
|
+ * Defaults to editable.
|
|
|
+ */
|
|
|
+ renderValidationDecorations?: 'editable' | 'on' | 'off';
|
|
|
/**
|
|
|
* Control the behavior and rendering of the scrollbars.
|
|
|
*/
|
|
@@ -2731,21 +2726,21 @@ declare namespace monaco.editor {
|
|
|
* Defaults to 'same' in vscode and to 'none' in monaco-editor.
|
|
|
*/
|
|
|
wrappingIndent?: 'none' | 'same' | 'indent' | 'deepIndent';
|
|
|
+ /**
|
|
|
+ * Controls the wrapping strategy to use.
|
|
|
+ * Defaults to 'simple'.
|
|
|
+ */
|
|
|
+ wrappingStrategy?: 'simple' | 'advanced';
|
|
|
/**
|
|
|
* Configure word wrapping characters. A break will be introduced before these characters.
|
|
|
- * Defaults to '{([+'.
|
|
|
+ * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'.
|
|
|
*/
|
|
|
wordWrapBreakBeforeCharacters?: string;
|
|
|
/**
|
|
|
* Configure word wrapping characters. A break will be introduced after these characters.
|
|
|
- * Defaults to ' \t})]?|&,;'.
|
|
|
+ * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'.
|
|
|
*/
|
|
|
wordWrapBreakAfterCharacters?: string;
|
|
|
- /**
|
|
|
- * Configure word wrapping characters. A break will be introduced after these characters only if no `wordWrapBreakBeforeCharacters` or `wordWrapBreakAfterCharacters` were found.
|
|
|
- * Defaults to '.'.
|
|
|
- */
|
|
|
- wordWrapBreakObtrusiveCharacters?: string;
|
|
|
/**
|
|
|
* Performance guard: Stop rendering a line after x characters.
|
|
|
* Defaults to 10000.
|
|
@@ -2765,6 +2760,10 @@ declare namespace monaco.editor {
|
|
|
* Enable inline color decorators and color picker rendering.
|
|
|
*/
|
|
|
colorDecorators?: boolean;
|
|
|
+ /**
|
|
|
+ * Control the behaviour of comments in the editor.
|
|
|
+ */
|
|
|
+ comments?: IEditorCommentsOptions;
|
|
|
/**
|
|
|
* Enable custom contextmenu.
|
|
|
* Defaults to true.
|
|
@@ -2846,8 +2845,8 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
autoSurround?: EditorAutoSurroundStrategy;
|
|
|
/**
|
|
|
- * Enable auto indentation adjustment.
|
|
|
- * Defaults to false.
|
|
|
+ * Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.
|
|
|
+ * Defaults to advanced.
|
|
|
*/
|
|
|
autoIndent?: 'none' | 'keep' | 'brackets' | 'advanced' | 'full';
|
|
|
/**
|
|
@@ -2934,7 +2933,7 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
codeActionsOnSaveTimeout?: number;
|
|
|
/**
|
|
|
- * Enable code folding
|
|
|
+ * Enable code folding.
|
|
|
* Defaults to true.
|
|
|
*/
|
|
|
folding?: boolean;
|
|
@@ -2943,6 +2942,11 @@ declare namespace monaco.editor {
|
|
|
* Defaults to 'auto'.
|
|
|
*/
|
|
|
foldingStrategy?: 'auto' | 'indentation';
|
|
|
+ /**
|
|
|
+ * Enable highlight for folded regions.
|
|
|
+ * Defaults to true.
|
|
|
+ */
|
|
|
+ foldingHighlight?: boolean;
|
|
|
/**
|
|
|
* Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.
|
|
|
* Defaults to 'mouseover'.
|
|
@@ -3006,6 +3010,11 @@ declare namespace monaco.editor {
|
|
|
* Controls fading out of unused variables.
|
|
|
*/
|
|
|
showUnused?: boolean;
|
|
|
+ /**
|
|
|
+ * Controls whether to focus the inline editor in the peek widget by default.
|
|
|
+ * Defaults to false.
|
|
|
+ */
|
|
|
+ peekWidgetDefaultFocus?: 'tree' | 'editor';
|
|
|
}
|
|
|
|
|
|
export interface IEditorConstructionOptions extends IEditorOptions {
|
|
@@ -3055,6 +3064,7 @@ declare namespace monaco.editor {
|
|
|
* An event describing that the configuration of the editor has changed.
|
|
|
*/
|
|
|
export class ConfigurationChangedEvent {
|
|
|
+ hasChanged(id: EditorOption): boolean;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3070,6 +3080,19 @@ declare namespace monaco.editor {
|
|
|
defaultValue: V;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Configuration options for editor comments
|
|
|
+ */
|
|
|
+ export interface IEditorCommentsOptions {
|
|
|
+ /**
|
|
|
+ * Insert a space after the line comment token and inside the block comments tokens.
|
|
|
+ * Defaults to true.
|
|
|
+ */
|
|
|
+ insertSpace?: boolean;
|
|
|
+ }
|
|
|
+
|
|
|
+ export type EditorCommentsOptions = Readonly<Required<IEditorCommentsOptions>>;
|
|
|
+
|
|
|
/**
|
|
|
* The kind of animation in which the editor's cursor should be rendered.
|
|
|
*/
|
|
@@ -3239,10 +3262,6 @@ declare namespace monaco.editor {
|
|
|
* The width of the glyph margin.
|
|
|
*/
|
|
|
readonly glyphMarginWidth: number;
|
|
|
- /**
|
|
|
- * The height of the glyph margin.
|
|
|
- */
|
|
|
- readonly glyphMarginHeight: number;
|
|
|
/**
|
|
|
* Left position for the line numbers.
|
|
|
*/
|
|
@@ -3251,10 +3270,6 @@ declare namespace monaco.editor {
|
|
|
* The width of the line numbers.
|
|
|
*/
|
|
|
readonly lineNumbersWidth: number;
|
|
|
- /**
|
|
|
- * The height of the line numbers.
|
|
|
- */
|
|
|
- readonly lineNumbersHeight: number;
|
|
|
/**
|
|
|
* Left position for the line decorations.
|
|
|
*/
|
|
@@ -3263,10 +3278,6 @@ declare namespace monaco.editor {
|
|
|
* The width of the line decorations.
|
|
|
*/
|
|
|
readonly decorationsWidth: number;
|
|
|
- /**
|
|
|
- * The height of the line decorations.
|
|
|
- */
|
|
|
- readonly decorationsHeight: number;
|
|
|
/**
|
|
|
* Left position for the content (actual text)
|
|
|
*/
|
|
@@ -3275,10 +3286,6 @@ declare namespace monaco.editor {
|
|
|
* The width of the content (actual text)
|
|
|
*/
|
|
|
readonly contentWidth: number;
|
|
|
- /**
|
|
|
- * The height of the content (actual height)
|
|
|
- */
|
|
|
- readonly contentHeight: number;
|
|
|
/**
|
|
|
* The position for the minimap
|
|
|
*/
|
|
@@ -3620,6 +3627,10 @@ declare namespace monaco.editor {
|
|
|
* Show snippet-suggestions.
|
|
|
*/
|
|
|
showSnippets?: boolean;
|
|
|
+ /**
|
|
|
+ * Controls the visibility of the status bar at the bottom of the suggest widget.
|
|
|
+ */
|
|
|
+ hideStatusBar?: boolean;
|
|
|
}
|
|
|
|
|
|
export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;
|
|
@@ -3667,102 +3678,106 @@ declare namespace monaco.editor {
|
|
|
autoSurround = 10,
|
|
|
codeLens = 11,
|
|
|
colorDecorators = 12,
|
|
|
- contextmenu = 13,
|
|
|
- copyWithSyntaxHighlighting = 14,
|
|
|
- cursorBlinking = 15,
|
|
|
- cursorSmoothCaretAnimation = 16,
|
|
|
- cursorStyle = 17,
|
|
|
- cursorSurroundingLines = 18,
|
|
|
- cursorSurroundingLinesStyle = 19,
|
|
|
- cursorWidth = 20,
|
|
|
- disableLayerHinting = 21,
|
|
|
- disableMonospaceOptimizations = 22,
|
|
|
- dragAndDrop = 23,
|
|
|
- emptySelectionClipboard = 24,
|
|
|
- extraEditorClassName = 25,
|
|
|
- fastScrollSensitivity = 26,
|
|
|
- find = 27,
|
|
|
- fixedOverflowWidgets = 28,
|
|
|
- folding = 29,
|
|
|
- foldingStrategy = 30,
|
|
|
- fontFamily = 31,
|
|
|
- fontInfo = 32,
|
|
|
- fontLigatures = 33,
|
|
|
- fontSize = 34,
|
|
|
- fontWeight = 35,
|
|
|
- formatOnPaste = 36,
|
|
|
- formatOnType = 37,
|
|
|
- glyphMargin = 38,
|
|
|
- gotoLocation = 39,
|
|
|
- hideCursorInOverviewRuler = 40,
|
|
|
- highlightActiveIndentGuide = 41,
|
|
|
- hover = 42,
|
|
|
- inDiffEditor = 43,
|
|
|
- letterSpacing = 44,
|
|
|
- lightbulb = 45,
|
|
|
- lineDecorationsWidth = 46,
|
|
|
- lineHeight = 47,
|
|
|
- lineNumbers = 48,
|
|
|
- lineNumbersMinChars = 49,
|
|
|
- links = 50,
|
|
|
- matchBrackets = 51,
|
|
|
- minimap = 52,
|
|
|
- mouseStyle = 53,
|
|
|
- mouseWheelScrollSensitivity = 54,
|
|
|
- mouseWheelZoom = 55,
|
|
|
- multiCursorMergeOverlapping = 56,
|
|
|
- multiCursorModifier = 57,
|
|
|
- multiCursorPaste = 58,
|
|
|
- occurrencesHighlight = 59,
|
|
|
- overviewRulerBorder = 60,
|
|
|
- overviewRulerLanes = 61,
|
|
|
- parameterHints = 62,
|
|
|
- quickSuggestions = 63,
|
|
|
- quickSuggestionsDelay = 64,
|
|
|
- readOnly = 65,
|
|
|
- renderControlCharacters = 66,
|
|
|
- renderIndentGuides = 67,
|
|
|
- renderFinalNewline = 68,
|
|
|
- renderLineHighlight = 69,
|
|
|
- renderWhitespace = 70,
|
|
|
- revealHorizontalRightPadding = 71,
|
|
|
- roundedSelection = 72,
|
|
|
- rulers = 73,
|
|
|
- scrollbar = 74,
|
|
|
- scrollBeyondLastColumn = 75,
|
|
|
- scrollBeyondLastLine = 76,
|
|
|
- selectionClipboard = 77,
|
|
|
- selectionHighlight = 78,
|
|
|
- selectOnLineNumbers = 79,
|
|
|
- showFoldingControls = 80,
|
|
|
- showUnused = 81,
|
|
|
- snippetSuggestions = 82,
|
|
|
- smoothScrolling = 83,
|
|
|
- stopRenderingLineAfter = 84,
|
|
|
- suggest = 85,
|
|
|
- suggestFontSize = 86,
|
|
|
- suggestLineHeight = 87,
|
|
|
- suggestOnTriggerCharacters = 88,
|
|
|
- suggestSelection = 89,
|
|
|
- tabCompletion = 90,
|
|
|
- useTabStops = 91,
|
|
|
- wordSeparators = 92,
|
|
|
- wordWrap = 93,
|
|
|
- wordWrapBreakAfterCharacters = 94,
|
|
|
- wordWrapBreakBeforeCharacters = 95,
|
|
|
- wordWrapBreakObtrusiveCharacters = 96,
|
|
|
- wordWrapColumn = 97,
|
|
|
- wordWrapMinified = 98,
|
|
|
- wrappingIndent = 99,
|
|
|
- editorClassName = 100,
|
|
|
- pixelRatio = 101,
|
|
|
- tabFocusMode = 102,
|
|
|
- layoutInfo = 103,
|
|
|
- wrappingInfo = 104
|
|
|
+ comments = 13,
|
|
|
+ contextmenu = 14,
|
|
|
+ copyWithSyntaxHighlighting = 15,
|
|
|
+ cursorBlinking = 16,
|
|
|
+ cursorSmoothCaretAnimation = 17,
|
|
|
+ cursorStyle = 18,
|
|
|
+ cursorSurroundingLines = 19,
|
|
|
+ cursorSurroundingLinesStyle = 20,
|
|
|
+ cursorWidth = 21,
|
|
|
+ disableLayerHinting = 22,
|
|
|
+ disableMonospaceOptimizations = 23,
|
|
|
+ dragAndDrop = 24,
|
|
|
+ emptySelectionClipboard = 25,
|
|
|
+ extraEditorClassName = 26,
|
|
|
+ fastScrollSensitivity = 27,
|
|
|
+ find = 28,
|
|
|
+ fixedOverflowWidgets = 29,
|
|
|
+ folding = 30,
|
|
|
+ foldingStrategy = 31,
|
|
|
+ foldingHighlight = 32,
|
|
|
+ fontFamily = 33,
|
|
|
+ fontInfo = 34,
|
|
|
+ fontLigatures = 35,
|
|
|
+ fontSize = 36,
|
|
|
+ fontWeight = 37,
|
|
|
+ formatOnPaste = 38,
|
|
|
+ formatOnType = 39,
|
|
|
+ glyphMargin = 40,
|
|
|
+ gotoLocation = 41,
|
|
|
+ hideCursorInOverviewRuler = 42,
|
|
|
+ highlightActiveIndentGuide = 43,
|
|
|
+ hover = 44,
|
|
|
+ inDiffEditor = 45,
|
|
|
+ letterSpacing = 46,
|
|
|
+ lightbulb = 47,
|
|
|
+ lineDecorationsWidth = 48,
|
|
|
+ lineHeight = 49,
|
|
|
+ lineNumbers = 50,
|
|
|
+ lineNumbersMinChars = 51,
|
|
|
+ links = 52,
|
|
|
+ matchBrackets = 53,
|
|
|
+ minimap = 54,
|
|
|
+ mouseStyle = 55,
|
|
|
+ mouseWheelScrollSensitivity = 56,
|
|
|
+ mouseWheelZoom = 57,
|
|
|
+ multiCursorMergeOverlapping = 58,
|
|
|
+ multiCursorModifier = 59,
|
|
|
+ multiCursorPaste = 60,
|
|
|
+ occurrencesHighlight = 61,
|
|
|
+ overviewRulerBorder = 62,
|
|
|
+ overviewRulerLanes = 63,
|
|
|
+ parameterHints = 64,
|
|
|
+ peekWidgetDefaultFocus = 65,
|
|
|
+ quickSuggestions = 66,
|
|
|
+ quickSuggestionsDelay = 67,
|
|
|
+ readOnly = 68,
|
|
|
+ renderControlCharacters = 69,
|
|
|
+ renderIndentGuides = 70,
|
|
|
+ renderFinalNewline = 71,
|
|
|
+ renderLineHighlight = 72,
|
|
|
+ renderValidationDecorations = 73,
|
|
|
+ renderWhitespace = 74,
|
|
|
+ revealHorizontalRightPadding = 75,
|
|
|
+ roundedSelection = 76,
|
|
|
+ rulers = 77,
|
|
|
+ scrollbar = 78,
|
|
|
+ scrollBeyondLastColumn = 79,
|
|
|
+ scrollBeyondLastLine = 80,
|
|
|
+ selectionClipboard = 81,
|
|
|
+ selectionHighlight = 82,
|
|
|
+ selectOnLineNumbers = 83,
|
|
|
+ showFoldingControls = 84,
|
|
|
+ showUnused = 85,
|
|
|
+ snippetSuggestions = 86,
|
|
|
+ smoothScrolling = 87,
|
|
|
+ stopRenderingLineAfter = 88,
|
|
|
+ suggest = 89,
|
|
|
+ suggestFontSize = 90,
|
|
|
+ suggestLineHeight = 91,
|
|
|
+ suggestOnTriggerCharacters = 92,
|
|
|
+ suggestSelection = 93,
|
|
|
+ tabCompletion = 94,
|
|
|
+ useTabStops = 95,
|
|
|
+ wordSeparators = 96,
|
|
|
+ wordWrap = 97,
|
|
|
+ wordWrapBreakAfterCharacters = 98,
|
|
|
+ wordWrapBreakBeforeCharacters = 99,
|
|
|
+ wordWrapColumn = 100,
|
|
|
+ wordWrapMinified = 101,
|
|
|
+ wrappingIndent = 102,
|
|
|
+ wrappingStrategy = 103,
|
|
|
+ editorClassName = 104,
|
|
|
+ pixelRatio = 105,
|
|
|
+ tabFocusMode = 106,
|
|
|
+ layoutInfo = 107,
|
|
|
+ wrappingInfo = 108
|
|
|
}
|
|
|
export const EditorOptions: {
|
|
|
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
|
|
|
- acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, "on" | "off" | "smart">;
|
|
|
+ acceptSuggestionOnEnter: IEditorOption<EditorOption.acceptSuggestionOnEnter, 'on' | 'off' | 'smart'>;
|
|
|
accessibilitySupport: IEditorOption<EditorOption.accessibilitySupport, AccessibilitySupport>;
|
|
|
accessibilityPageSize: IEditorOption<EditorOption.accessibilityPageSize, number>;
|
|
|
ariaLabel: IEditorOption<EditorOption.ariaLabel, string>;
|
|
@@ -3774,13 +3789,14 @@ declare namespace monaco.editor {
|
|
|
autoSurround: IEditorOption<EditorOption.autoSurround, EditorAutoSurroundStrategy>;
|
|
|
codeLens: IEditorOption<EditorOption.codeLens, boolean>;
|
|
|
colorDecorators: IEditorOption<EditorOption.colorDecorators, boolean>;
|
|
|
+ comments: IEditorOption<EditorOption.comments, EditorCommentsOptions>;
|
|
|
contextmenu: IEditorOption<EditorOption.contextmenu, boolean>;
|
|
|
copyWithSyntaxHighlighting: IEditorOption<EditorOption.copyWithSyntaxHighlighting, boolean>;
|
|
|
cursorBlinking: IEditorOption<EditorOption.cursorBlinking, TextEditorCursorBlinkingStyle>;
|
|
|
cursorSmoothCaretAnimation: IEditorOption<EditorOption.cursorSmoothCaretAnimation, boolean>;
|
|
|
cursorStyle: IEditorOption<EditorOption.cursorStyle, TextEditorCursorStyle>;
|
|
|
cursorSurroundingLines: IEditorOption<EditorOption.cursorSurroundingLines, number>;
|
|
|
- cursorSurroundingLinesStyle: IEditorOption<EditorOption.cursorSurroundingLinesStyle, "default" | "all">;
|
|
|
+ cursorSurroundingLinesStyle: IEditorOption<EditorOption.cursorSurroundingLinesStyle, 'default' | 'all'>;
|
|
|
cursorWidth: IEditorOption<EditorOption.cursorWidth, number>;
|
|
|
disableLayerHinting: IEditorOption<EditorOption.disableLayerHinting, boolean>;
|
|
|
disableMonospaceOptimizations: IEditorOption<EditorOption.disableMonospaceOptimizations, boolean>;
|
|
@@ -3791,7 +3807,8 @@ declare namespace monaco.editor {
|
|
|
find: IEditorOption<EditorOption.find, EditorFindOptions>;
|
|
|
fixedOverflowWidgets: IEditorOption<EditorOption.fixedOverflowWidgets, boolean>;
|
|
|
folding: IEditorOption<EditorOption.folding, boolean>;
|
|
|
- foldingStrategy: IEditorOption<EditorOption.foldingStrategy, "auto" | "indentation">;
|
|
|
+ foldingStrategy: IEditorOption<EditorOption.foldingStrategy, 'auto' | 'indentation'>;
|
|
|
+ foldingHighlight: IEditorOption<EditorOption.foldingHighlight, boolean>;
|
|
|
fontFamily: IEditorOption<EditorOption.fontFamily, string>;
|
|
|
fontInfo: IEditorOption<EditorOption.fontInfo, FontInfo>;
|
|
|
fontLigatures2: IEditorOption<EditorOption.fontLigatures, string>;
|
|
@@ -3812,26 +3829,28 @@ declare namespace monaco.editor {
|
|
|
lineNumbers: IEditorOption<EditorOption.lineNumbers, InternalEditorRenderLineNumbersOptions>;
|
|
|
lineNumbersMinChars: IEditorOption<EditorOption.lineNumbersMinChars, number>;
|
|
|
links: IEditorOption<EditorOption.links, boolean>;
|
|
|
- matchBrackets: IEditorOption<EditorOption.matchBrackets, "always" | "never" | "near">;
|
|
|
+ matchBrackets: IEditorOption<EditorOption.matchBrackets, 'always' | 'never' | 'near'>;
|
|
|
minimap: IEditorOption<EditorOption.minimap, EditorMinimapOptions>;
|
|
|
- mouseStyle: IEditorOption<EditorOption.mouseStyle, "default" | "text" | "copy">;
|
|
|
+ mouseStyle: IEditorOption<EditorOption.mouseStyle, 'default' | 'text' | 'copy'>;
|
|
|
mouseWheelScrollSensitivity: IEditorOption<EditorOption.mouseWheelScrollSensitivity, number>;
|
|
|
mouseWheelZoom: IEditorOption<EditorOption.mouseWheelZoom, boolean>;
|
|
|
multiCursorMergeOverlapping: IEditorOption<EditorOption.multiCursorMergeOverlapping, boolean>;
|
|
|
- multiCursorModifier: IEditorOption<EditorOption.multiCursorModifier, "altKey" | "metaKey" | "ctrlKey">;
|
|
|
- multiCursorPaste: IEditorOption<EditorOption.multiCursorPaste, "spread" | "full">;
|
|
|
+ multiCursorModifier: IEditorOption<EditorOption.multiCursorModifier, 'altKey' | 'metaKey' | 'ctrlKey'>;
|
|
|
+ multiCursorPaste: IEditorOption<EditorOption.multiCursorPaste, 'spread' | 'full'>;
|
|
|
occurrencesHighlight: IEditorOption<EditorOption.occurrencesHighlight, boolean>;
|
|
|
overviewRulerBorder: IEditorOption<EditorOption.overviewRulerBorder, boolean>;
|
|
|
overviewRulerLanes: IEditorOption<EditorOption.overviewRulerLanes, number>;
|
|
|
parameterHints: IEditorOption<EditorOption.parameterHints, InternalParameterHintOptions>;
|
|
|
+ peekWidgetDefaultFocus: IEditorOption<EditorOption.peekWidgetDefaultFocus, 'tree' | 'editor'>;
|
|
|
quickSuggestions: IEditorOption<EditorOption.quickSuggestions, ValidQuickSuggestionsOptions>;
|
|
|
quickSuggestionsDelay: IEditorOption<EditorOption.quickSuggestionsDelay, number>;
|
|
|
readOnly: IEditorOption<EditorOption.readOnly, boolean>;
|
|
|
renderControlCharacters: IEditorOption<EditorOption.renderControlCharacters, boolean>;
|
|
|
renderIndentGuides: IEditorOption<EditorOption.renderIndentGuides, boolean>;
|
|
|
renderFinalNewline: IEditorOption<EditorOption.renderFinalNewline, boolean>;
|
|
|
- renderLineHighlight: IEditorOption<EditorOption.renderLineHighlight, "all" | "line" | "none" | "gutter">;
|
|
|
- renderWhitespace: IEditorOption<EditorOption.renderWhitespace, "all" | "none" | "boundary" | "selection">;
|
|
|
+ renderLineHighlight: IEditorOption<EditorOption.renderLineHighlight, 'all' | 'line' | 'none' | 'gutter'>;
|
|
|
+ renderValidationDecorations: IEditorOption<EditorOption.renderValidationDecorations, 'on' | 'off' | 'editable'>;
|
|
|
+ renderWhitespace: IEditorOption<EditorOption.renderWhitespace, 'all' | 'none' | 'boundary' | 'selection'>;
|
|
|
revealHorizontalRightPadding: IEditorOption<EditorOption.revealHorizontalRightPadding, number>;
|
|
|
roundedSelection: IEditorOption<EditorOption.roundedSelection, boolean>;
|
|
|
rulers: IEditorOption<EditorOption.rulers, {}>;
|
|
@@ -3841,26 +3860,26 @@ declare namespace monaco.editor {
|
|
|
selectionClipboard: IEditorOption<EditorOption.selectionClipboard, boolean>;
|
|
|
selectionHighlight: IEditorOption<EditorOption.selectionHighlight, boolean>;
|
|
|
selectOnLineNumbers: IEditorOption<EditorOption.selectOnLineNumbers, boolean>;
|
|
|
- showFoldingControls: IEditorOption<EditorOption.showFoldingControls, "always" | "mouseover">;
|
|
|
+ showFoldingControls: IEditorOption<EditorOption.showFoldingControls, 'always' | 'mouseover'>;
|
|
|
showUnused: IEditorOption<EditorOption.showUnused, boolean>;
|
|
|
- snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, "none" | "top" | "bottom" | "inline">;
|
|
|
+ snippetSuggestions: IEditorOption<EditorOption.snippetSuggestions, 'none' | 'top' | 'bottom' | 'inline'>;
|
|
|
smoothScrolling: IEditorOption<EditorOption.smoothScrolling, boolean>;
|
|
|
stopRenderingLineAfter: IEditorOption<EditorOption.stopRenderingLineAfter, number>;
|
|
|
suggest: IEditorOption<EditorOption.suggest, InternalSuggestOptions>;
|
|
|
suggestFontSize: IEditorOption<EditorOption.suggestFontSize, number>;
|
|
|
suggestLineHeight: IEditorOption<EditorOption.suggestLineHeight, number>;
|
|
|
suggestOnTriggerCharacters: IEditorOption<EditorOption.suggestOnTriggerCharacters, boolean>;
|
|
|
- suggestSelection: IEditorOption<EditorOption.suggestSelection, "first" | "recentlyUsed" | "recentlyUsedByPrefix">;
|
|
|
- tabCompletion: IEditorOption<EditorOption.tabCompletion, "on" | "off" | "onlySnippets">;
|
|
|
+ suggestSelection: IEditorOption<EditorOption.suggestSelection, 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'>;
|
|
|
+ tabCompletion: IEditorOption<EditorOption.tabCompletion, 'on' | 'off' | 'onlySnippets'>;
|
|
|
useTabStops: IEditorOption<EditorOption.useTabStops, boolean>;
|
|
|
wordSeparators: IEditorOption<EditorOption.wordSeparators, string>;
|
|
|
- wordWrap: IEditorOption<EditorOption.wordWrap, "on" | "off" | "wordWrapColumn" | "bounded">;
|
|
|
+ wordWrap: IEditorOption<EditorOption.wordWrap, 'on' | 'off' | 'wordWrapColumn' | 'bounded'>;
|
|
|
wordWrapBreakAfterCharacters: IEditorOption<EditorOption.wordWrapBreakAfterCharacters, string>;
|
|
|
wordWrapBreakBeforeCharacters: IEditorOption<EditorOption.wordWrapBreakBeforeCharacters, string>;
|
|
|
- wordWrapBreakObtrusiveCharacters: IEditorOption<EditorOption.wordWrapBreakObtrusiveCharacters, string>;
|
|
|
wordWrapColumn: IEditorOption<EditorOption.wordWrapColumn, number>;
|
|
|
wordWrapMinified: IEditorOption<EditorOption.wordWrapMinified, boolean>;
|
|
|
wrappingIndent: IEditorOption<EditorOption.wrappingIndent, WrappingIndent>;
|
|
|
+ wrappingStrategy: IEditorOption<EditorOption.wrappingStrategy, 'simple' | 'advanced'>;
|
|
|
editorClassName: IEditorOption<EditorOption.editorClassName, string>;
|
|
|
pixelRatio: IEditorOption<EditorOption.pixelRatio, number>;
|
|
|
tabFocusMode: IEditorOption<EditorOption.tabFocusMode, boolean>;
|
|
@@ -4170,6 +4189,14 @@ declare namespace monaco.editor {
|
|
|
readonly target: IMouseTarget | null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * A paste event originating from the editor.
|
|
|
+ */
|
|
|
+ export interface IPasteEvent {
|
|
|
+ readonly range: Range;
|
|
|
+ readonly mode: string | null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* A rich code editor.
|
|
|
*/
|
|
@@ -4242,16 +4269,16 @@ declare namespace monaco.editor {
|
|
|
/**
|
|
|
* An event emitted after composition has started.
|
|
|
*/
|
|
|
- onCompositionStart(listener: () => void): IDisposable;
|
|
|
+ onDidCompositionStart(listener: () => void): IDisposable;
|
|
|
/**
|
|
|
* An event emitted after composition has ended.
|
|
|
*/
|
|
|
- onCompositionEnd(listener: () => void): IDisposable;
|
|
|
+ onDidCompositionEnd(listener: () => void): IDisposable;
|
|
|
/**
|
|
|
* An event emitted when users paste text in the editor.
|
|
|
* @event
|
|
|
*/
|
|
|
- onDidPaste(listener: (range: Range) => void): IDisposable;
|
|
|
+ onDidPaste(listener: (e: IPasteEvent) => void): IDisposable;
|
|
|
/**
|
|
|
* An event emitted on a "mouseup".
|
|
|
* @event
|
|
@@ -4292,6 +4319,11 @@ declare namespace monaco.editor {
|
|
|
* @event
|
|
|
*/
|
|
|
onDidLayoutChange(listener: (e: EditorLayoutInfo) => void): IDisposable;
|
|
|
+ /**
|
|
|
+ * An event emitted when the content width or content height in the editor has changed.
|
|
|
+ * @event
|
|
|
+ */
|
|
|
+ onDidContentSizeChange(listener: (e: IContentSizeChangedEvent) => void): IDisposable;
|
|
|
/**
|
|
|
* An event emitted when the scroll in the editor has changed.
|
|
|
* @event
|
|
@@ -4353,6 +4385,11 @@ declare namespace monaco.editor {
|
|
|
* @see `ITextModel.setValue`
|
|
|
*/
|
|
|
setValue(newValue: string): void;
|
|
|
+ /**
|
|
|
+ * Get the width of the editor's content.
|
|
|
+ * This is information that is "erased" when computing `scrollWidth = Math.max(contentWidth, width)`
|
|
|
+ */
|
|
|
+ getContentWidth(): number;
|
|
|
/**
|
|
|
* Get the scrollWidth of the editor's viewport.
|
|
|
*/
|
|
@@ -4361,6 +4398,11 @@ declare namespace monaco.editor {
|
|
|
* Get the scrollLeft of the editor's viewport.
|
|
|
*/
|
|
|
getScrollLeft(): number;
|
|
|
+ /**
|
|
|
+ * Get the height of the editor's content.
|
|
|
+ * This is information that is "erased" when computing `scrollHeight = Math.max(contentHeight, height)`
|
|
|
+ */
|
|
|
+ getContentHeight(): number;
|
|
|
/**
|
|
|
* Get the scrollHeight of the editor's viewport.
|
|
|
*/
|
|
@@ -4438,6 +4480,10 @@ declare namespace monaco.editor {
|
|
|
* Get the vertical position (top offset) for the position w.r.t. to the first line.
|
|
|
*/
|
|
|
getTopForPosition(lineNumber: number, column: number): number;
|
|
|
+ /**
|
|
|
+ * Returns the editor's container dom node
|
|
|
+ */
|
|
|
+ getContainerDomNode(): HTMLElement;
|
|
|
/**
|
|
|
* Returns the editor's dom node
|
|
|
*/
|
|
@@ -4584,6 +4630,7 @@ declare namespace monaco.editor {
|
|
|
readonly typicalFullwidthCharacterWidth: number;
|
|
|
readonly canUseHalfwidthRightwardsArrow: boolean;
|
|
|
readonly spaceWidth: number;
|
|
|
+ readonly middotWidth: number;
|
|
|
readonly maxDigitWidth: number;
|
|
|
}
|
|
|
|
|
@@ -4822,6 +4869,16 @@ declare namespace monaco.languages {
|
|
|
*/
|
|
|
export function registerSelectionRangeProvider(languageId: string, provider: SelectionRangeProvider): IDisposable;
|
|
|
|
|
|
+ /**
|
|
|
+ * Register a document semantic tokens provider
|
|
|
+ */
|
|
|
+ export function registerDocumentSemanticTokensProvider(languageId: string, provider: DocumentSemanticTokensProvider): IDisposable;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Register a document range semantic tokens provider
|
|
|
+ */
|
|
|
+ export function registerDocumentRangeSemanticTokensProvider(languageId: string, provider: DocumentRangeSemanticTokensProvider): IDisposable;
|
|
|
+
|
|
|
/**
|
|
|
* Contains additional diagnostic information about the context in which
|
|
|
* a [code action](#CodeActionProvider.provideCodeActions) is run.
|
|
@@ -5143,6 +5200,25 @@ declare namespace monaco.languages {
|
|
|
Snippet = 25
|
|
|
}
|
|
|
|
|
|
+ export interface CompletionItemLabel {
|
|
|
+ /**
|
|
|
+ * The function or variable. Rendered leftmost.
|
|
|
+ */
|
|
|
+ name: string;
|
|
|
+ /**
|
|
|
+ * The signature without the return type. Render after `name`.
|
|
|
+ */
|
|
|
+ signature?: string;
|
|
|
+ /**
|
|
|
+ * The fully qualified name, like package name or file path. Rendered after `signature`.
|
|
|
+ */
|
|
|
+ qualifier?: string;
|
|
|
+ /**
|
|
|
+ * The return-type of a function or type of a property/variable. Rendered rightmost.
|
|
|
+ */
|
|
|
+ type?: string;
|
|
|
+ }
|
|
|
+
|
|
|
export enum CompletionItemTag {
|
|
|
Deprecated = 1
|
|
|
}
|
|
@@ -5169,7 +5245,7 @@ declare namespace monaco.languages {
|
|
|
* this is also the text that is inserted when selecting
|
|
|
* this completion.
|
|
|
*/
|
|
|
- label: string;
|
|
|
+ label: string | CompletionItemLabel;
|
|
|
/**
|
|
|
* The kind of this completion item. Based on the kind
|
|
|
* an icon is chosen by the editor.
|
|
@@ -5209,7 +5285,7 @@ declare namespace monaco.languages {
|
|
|
preselect?: boolean;
|
|
|
/**
|
|
|
* A string or snippet that should be inserted in a document when selecting
|
|
|
- * this completion.
|
|
|
+ * this completion. When `falsy` the [label](#CompletionItem.label)
|
|
|
* is used.
|
|
|
*/
|
|
|
insertText: string;
|
|
@@ -5843,25 +5919,41 @@ declare namespace monaco.languages {
|
|
|
constructor(value: string);
|
|
|
}
|
|
|
|
|
|
- export interface ResourceFileEdit {
|
|
|
+ export interface WorkspaceEditMetadata {
|
|
|
+ needsConfirmation: boolean;
|
|
|
+ label: string;
|
|
|
+ description?: string;
|
|
|
+ iconPath?: {
|
|
|
+ id: string;
|
|
|
+ } | {
|
|
|
+ light: Uri;
|
|
|
+ dark: Uri;
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ export interface WorkspaceFileEditOptions {
|
|
|
+ overwrite?: boolean;
|
|
|
+ ignoreIfNotExists?: boolean;
|
|
|
+ ignoreIfExists?: boolean;
|
|
|
+ recursive?: boolean;
|
|
|
+ }
|
|
|
+
|
|
|
+ export interface WorkspaceFileEdit {
|
|
|
oldUri?: Uri;
|
|
|
newUri?: Uri;
|
|
|
- options?: {
|
|
|
- overwrite?: boolean;
|
|
|
- ignoreIfNotExists?: boolean;
|
|
|
- ignoreIfExists?: boolean;
|
|
|
- recursive?: boolean;
|
|
|
- };
|
|
|
+ options?: WorkspaceFileEditOptions;
|
|
|
+ metadata?: WorkspaceEditMetadata;
|
|
|
}
|
|
|
|
|
|
- export interface ResourceTextEdit {
|
|
|
+ export interface WorkspaceTextEdit {
|
|
|
resource: Uri;
|
|
|
+ edit: TextEdit;
|
|
|
modelVersionId?: number;
|
|
|
- edits: TextEdit[];
|
|
|
+ metadata?: WorkspaceEditMetadata;
|
|
|
}
|
|
|
|
|
|
export interface WorkspaceEdit {
|
|
|
- edits: Array<ResourceTextEdit | ResourceFileEdit>;
|
|
|
+ edits: Array<WorkspaceTextEdit | WorkspaceFileEdit>;
|
|
|
}
|
|
|
|
|
|
export interface Rejection {
|
|
@@ -5923,10 +6015,15 @@ declare namespace monaco.languages {
|
|
|
readonly edits: SemanticTokensEdit[];
|
|
|
}
|
|
|
|
|
|
- export interface SemanticTokensProvider {
|
|
|
+ export interface DocumentSemanticTokensProvider {
|
|
|
getLegend(): SemanticTokensLegend;
|
|
|
- provideSemanticTokens(model: editor.ITextModel, lastResultId: string | null, ranges: Range[] | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
|
|
|
- releaseSemanticTokens(resultId: string | undefined): void;
|
|
|
+ provideDocumentSemanticTokens(model: editor.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
|
|
|
+ releaseDocumentSemanticTokens(resultId: string | undefined): void;
|
|
|
+ }
|
|
|
+
|
|
|
+ export interface DocumentRangeSemanticTokensProvider {
|
|
|
+ getLegend(): SemanticTokensLegend;
|
|
|
+ provideDocumentRangeSemanticTokens(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
|
|
|
}
|
|
|
|
|
|
export interface ILanguageExtensionPoint {
|
|
@@ -6140,6 +6237,7 @@ declare namespace monaco.languages.typescript {
|
|
|
interface CompilerOptions {
|
|
|
allowJs?: boolean;
|
|
|
allowSyntheticDefaultImports?: boolean;
|
|
|
+ allowUmdGlobalAccess?: boolean;
|
|
|
allowUnreachableCode?: boolean;
|
|
|
allowUnusedLabels?: boolean;
|
|
|
alwaysStrict?: boolean;
|
|
@@ -6151,6 +6249,7 @@ declare namespace monaco.languages.typescript {
|
|
|
emitDeclarationOnly?: boolean;
|
|
|
declarationDir?: string;
|
|
|
disableSizeLimit?: boolean;
|
|
|
+ disableSourceOfProjectReferenceRedirect?: boolean;
|
|
|
downlevelIteration?: boolean;
|
|
|
emitBOM?: boolean;
|
|
|
emitDecoratorMetadata?: boolean;
|
|
@@ -6202,8 +6301,10 @@ declare namespace monaco.languages.typescript {
|
|
|
sourceRoot?: string;
|
|
|
strict?: boolean;
|
|
|
strictFunctionTypes?: boolean;
|
|
|
+ strictBindCallApply?: boolean;
|
|
|
strictNullChecks?: boolean;
|
|
|
strictPropertyInitialization?: boolean;
|
|
|
+ stripInternal?: boolean;
|
|
|
suppressExcessPropertyErrors?: boolean;
|
|
|
suppressImplicitAnyIndexErrors?: boolean;
|
|
|
target?: ScriptTarget;
|
|
@@ -6213,6 +6314,7 @@ declare namespace monaco.languages.typescript {
|
|
|
/** Paths used to compute primary types search locations */
|
|
|
typeRoots?: string[];
|
|
|
esModuleInterop?: boolean;
|
|
|
+ useDefineForClassFields?: boolean;
|
|
|
[option: string]: CompilerOptionsValue | undefined;
|
|
|
}
|
|
|
|
|
@@ -6223,7 +6325,69 @@ declare namespace monaco.languages.typescript {
|
|
|
diagnosticCodesToIgnore?: number[];
|
|
|
}
|
|
|
|
|
|
+ interface IExtraLib {
|
|
|
+ content: string;
|
|
|
+ version: number;
|
|
|
+ }
|
|
|
+
|
|
|
+ interface IExtraLibs {
|
|
|
+ [path: string]: IExtraLib;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * A linked list of formatted diagnostic messages to be used as part of a multiline message.
|
|
|
+ * It is built from the bottom up, leaving the head to be the "main" diagnostic.
|
|
|
+ */
|
|
|
+ interface DiagnosticMessageChain {
|
|
|
+ messageText: string;
|
|
|
+ /** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
|
|
|
+ category: 0 | 1 | 2 | 3;
|
|
|
+ code: number;
|
|
|
+ next?: DiagnosticMessageChain[];
|
|
|
+ }
|
|
|
+ interface Diagnostic extends DiagnosticRelatedInformation {
|
|
|
+ /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
|
|
|
+ reportsUnnecessary?: {};
|
|
|
+ source?: string;
|
|
|
+ relatedInformation?: DiagnosticRelatedInformation[];
|
|
|
+ }
|
|
|
+ interface DiagnosticRelatedInformation {
|
|
|
+ /** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
|
|
|
+ category: 0 | 1 | 2 | 3;
|
|
|
+ code: number;
|
|
|
+ /** TypeScriptWorker removes this to avoid serializing circular JSON structures. */
|
|
|
+ file: undefined;
|
|
|
+ start: number | undefined;
|
|
|
+ length: number | undefined;
|
|
|
+ messageText: string | DiagnosticMessageChain;
|
|
|
+ }
|
|
|
+
|
|
|
+ interface EmitOutput {
|
|
|
+ outputFiles: OutputFile[];
|
|
|
+ emitSkipped: boolean;
|
|
|
+ }
|
|
|
+ interface OutputFile {
|
|
|
+ name: string;
|
|
|
+ writeByteOrderMark: boolean;
|
|
|
+ text: string;
|
|
|
+ }
|
|
|
+
|
|
|
export interface LanguageServiceDefaults {
|
|
|
+ /**
|
|
|
+ * Event fired when compiler options or diagnostics options are changed.
|
|
|
+ */
|
|
|
+ readonly onDidChange: IEvent<void>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Event fired when extra libraries registered with the language service change.
|
|
|
+ */
|
|
|
+ readonly onDidExtraLibsChange: IEvent<void>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the current extra libs registered with the language service.
|
|
|
+ */
|
|
|
+ getExtraLibs(): IExtraLibs;
|
|
|
+
|
|
|
/**
|
|
|
* Add an additional source file to the language service. Use this
|
|
|
* for typescript (definition) files that won't be loaded as editor
|
|
@@ -6244,11 +6408,21 @@ declare namespace monaco.languages.typescript {
|
|
|
*/
|
|
|
setExtraLibs(libs: { content: string; filePath?: string }[]): void;
|
|
|
|
|
|
+ /**
|
|
|
+ * Get current TypeScript compiler options for the language service.
|
|
|
+ */
|
|
|
+ getCompilerOptions(): CompilerOptions;
|
|
|
+
|
|
|
/**
|
|
|
* Set TypeScript compiler options.
|
|
|
*/
|
|
|
setCompilerOptions(options: CompilerOptions): void;
|
|
|
|
|
|
+ /**
|
|
|
+ * Get the current diagnostics options for the language service.
|
|
|
+ */
|
|
|
+ getDiagnosticsOptions(): DiagnosticsOptions;
|
|
|
+
|
|
|
/**
|
|
|
* Configure whether syntactic and/or semantic validation should
|
|
|
* be performed
|
|
@@ -6256,10 +6430,7 @@ declare namespace monaco.languages.typescript {
|
|
|
setDiagnosticsOptions(options: DiagnosticsOptions): void;
|
|
|
|
|
|
/**
|
|
|
- * Configure when the worker shuts down. By default that is 2mins.
|
|
|
- *
|
|
|
- * @param value The maximum idle time in milliseconds. Values less than one
|
|
|
- * mean never shut down.
|
|
|
+ * No-op.
|
|
|
*/
|
|
|
setMaximumWorkerIdleTime(value: number): void;
|
|
|
|
|
@@ -6268,15 +6439,139 @@ declare namespace monaco.languages.typescript {
|
|
|
* to the worker on start or restart.
|
|
|
*/
|
|
|
setEagerModelSync(value: boolean): void;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the current setting for whether all existing models should be eagerly sync'd
|
|
|
+ * to the worker on start or restart.
|
|
|
+ */
|
|
|
+ getEagerModelSync(): boolean;
|
|
|
+ }
|
|
|
+
|
|
|
+ export interface TypeScriptWorker {
|
|
|
+ /**
|
|
|
+ * Get diagnostic messages for any syntax issues in the given file.
|
|
|
+ */
|
|
|
+ getSyntacticDiagnostics(fileName: string): Promise<Diagnostic[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get diagnostic messages for any semantic issues in the given file.
|
|
|
+ */
|
|
|
+ getSemanticDiagnostics(fileName: string): Promise<Diagnostic[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get diagnostic messages for any suggestions related to the given file.
|
|
|
+ */
|
|
|
+ getSuggestionDiagnostics(fileName: string): Promise<Diagnostic[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get diagnostic messages related to the current compiler options.
|
|
|
+ * @param fileName Not used
|
|
|
+ */
|
|
|
+ getCompilerOptionsDiagnostics(fileName: string): Promise<Diagnostic[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get code completions for the given file and position.
|
|
|
+ * @returns `Promise<typescript.CompletionInfo | undefined>`
|
|
|
+ */
|
|
|
+ getCompletionsAtPosition(fileName: string, position: number): Promise<any | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get code completion details for the given file, position, and entry.
|
|
|
+ * @returns `Promise<typescript.CompletionEntryDetails | undefined>`
|
|
|
+ */
|
|
|
+ getCompletionEntryDetails(fileName: string, position: number, entry: string): Promise<any | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get signature help items for the item at the given file and position.
|
|
|
+ * @returns `Promise<typescript.SignatureHelpItems | undefined>`
|
|
|
+ */
|
|
|
+ getSignatureHelpItems(fileName: string, position: number): Promise<any | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get quick info for the item at the given position in the file.
|
|
|
+ * @returns `Promise<typescript.QuickInfo | undefined>`
|
|
|
+ */
|
|
|
+ getQuickInfoAtPosition(fileName: string, position: number): Promise<any | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get other ranges which are related to the item at the given position in the file (often used for highlighting).
|
|
|
+ * @returns `Promise<ReadonlyArray<typescript.ReferenceEntry> | undefined>`
|
|
|
+ */
|
|
|
+ getOccurrencesAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the definition of the item at the given position in the file.
|
|
|
+ * @returns `Promise<ReadonlyArray<typescript.DefinitionInfo> | undefined>`
|
|
|
+ */
|
|
|
+ getDefinitionAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get references to the item at the given position in the file.
|
|
|
+ * @returns `Promise<typescript.ReferenceEntry[] | undefined>`
|
|
|
+ */
|
|
|
+ getReferencesAtPosition(fileName: string, position: number): Promise<any[] | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get outline entries for the item at the given position in the file.
|
|
|
+ * @returns `Promise<typescript.NavigationBarItem[]>`
|
|
|
+ */
|
|
|
+ getNavigationBarItems(fileName: string): Promise<any[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get changes which should be applied to format the given file.
|
|
|
+ * @param options `typescript.FormatCodeOptions`
|
|
|
+ * @returns `Promise<typescript.TextChange[]>`
|
|
|
+ */
|
|
|
+ getFormattingEditsForDocument(fileName: string, options: any): Promise<any[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get changes which should be applied to format the given range in the file.
|
|
|
+ * @param options `typescript.FormatCodeOptions`
|
|
|
+ * @returns `Promise<typescript.TextChange[]>`
|
|
|
+ */
|
|
|
+ getFormattingEditsForRange(fileName: string, start: number, end: number, options: any): Promise<any[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get formatting changes which should be applied after the given keystroke.
|
|
|
+ * @param options `typescript.FormatCodeOptions`
|
|
|
+ * @returns `Promise<typescript.TextChange[]>`
|
|
|
+ */
|
|
|
+ getFormattingEditsAfterKeystroke(fileName: string, postion: number, ch: string, options: any): Promise<any[]>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get other occurrences which should be updated when renaming the item at the given file and position.
|
|
|
+ * @returns `Promise<readonly typescript.RenameLocation[] | undefined>`
|
|
|
+ */
|
|
|
+ findRenameLocations(fileName: string, positon: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename: boolean): Promise<readonly any[] | undefined>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get edits which should be applied to rename the item at the given file and position (or a failure reason).
|
|
|
+ * @param options `typescript.RenameInfoOptions`
|
|
|
+ * @returns `Promise<typescript.RenameInfo>`
|
|
|
+ */
|
|
|
+ getRenameInfo(fileName: string, positon: number, options: any): Promise<any>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get transpiled output for the given file.
|
|
|
+ * @returns `typescript.EmitOutput`
|
|
|
+ */
|
|
|
+ getEmitOutput(fileName: string): Promise<any>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get possible code fixes at the given position in the file.
|
|
|
+ * @param formatOptions `typescript.FormatCodeOptions`
|
|
|
+ * @returns `Promise<ReadonlyArray<typescript.CodeFixAction>>`
|
|
|
+ */
|
|
|
+ getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: any): Promise<ReadonlyArray<any>>;
|
|
|
}
|
|
|
|
|
|
- export var typescriptVersion: string;
|
|
|
+ export const typescriptVersion: string;
|
|
|
|
|
|
- export var typescriptDefaults: LanguageServiceDefaults;
|
|
|
- export var javascriptDefaults: LanguageServiceDefaults;
|
|
|
+ export const typescriptDefaults: LanguageServiceDefaults;
|
|
|
+ export const javascriptDefaults: LanguageServiceDefaults;
|
|
|
|
|
|
- export var getTypeScriptWorker: () => Promise<any>;
|
|
|
- export var getJavaScriptWorker: () => Promise<any>;
|
|
|
+ export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
|
|
|
+ export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
|
|
|
}
|
|
|
|
|
|
/*---------------------------------------------------------------------------------------------
|