|
@@ -10,6 +10,10 @@
|
|
|
|
|
|
declare let MonacoEnvironment: monaco.Environment | undefined;
|
|
|
|
|
|
+interface Window {
|
|
|
+ MonacoEnvironment?: monaco.Environment | undefined;
|
|
|
+}
|
|
|
+
|
|
|
declare namespace monaco {
|
|
|
|
|
|
export type Thenable<T> = PromiseLike<T>;
|
|
@@ -621,7 +625,7 @@ declare namespace monaco {
|
|
|
*/
|
|
|
strictContainsRange(range: IRange): boolean;
|
|
|
/**
|
|
|
- * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false.
|
|
|
+ * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.
|
|
|
*/
|
|
|
static strictContainsRange(range: IRange, otherRange: IRange): boolean;
|
|
|
/**
|
|
@@ -1403,7 +1407,8 @@ declare namespace monaco.editor {
|
|
|
isWholeLine?: boolean;
|
|
|
/**
|
|
|
* Specifies the stack order of a decoration.
|
|
|
- * A decoration with greater stack order is always in front of a decoration with a lower stack order.
|
|
|
+ * A decoration with greater stack order is always in front of a decoration with
|
|
|
+ * a lower stack order when the decorations are on the same line.
|
|
|
*/
|
|
|
zIndex?: number;
|
|
|
/**
|
|
@@ -1643,6 +1648,11 @@ declare namespace monaco.editor {
|
|
|
readonly insertSpaces: boolean;
|
|
|
readonly defaultEOL: DefaultEndOfLine;
|
|
|
readonly trimAutoWhitespace: boolean;
|
|
|
+ readonly bracketPairColorizationOptions: BracketPairColorizationOptions;
|
|
|
+ }
|
|
|
+
|
|
|
+ export interface BracketPairColorizationOptions {
|
|
|
+ enabled: boolean;
|
|
|
}
|
|
|
|
|
|
export interface ITextModelUpdateOptions {
|
|
@@ -1650,6 +1660,7 @@ declare namespace monaco.editor {
|
|
|
indentSize?: number;
|
|
|
insertSpaces?: boolean;
|
|
|
trimAutoWhitespace?: boolean;
|
|
|
+ bracketColorizationOptions?: BracketPairColorizationOptions;
|
|
|
}
|
|
|
|
|
|
export class FindMatch {
|
|
@@ -2702,7 +2713,7 @@ declare namespace monaco.editor {
|
|
|
/**
|
|
|
* Control the rendering of line numbers.
|
|
|
* 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, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function).
|
|
|
* Otherwise, line numbers will not be rendered.
|
|
|
* Defaults to `on`.
|
|
|
*/
|
|
@@ -3335,7 +3346,7 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
originalAriaLabel?: string;
|
|
|
/**
|
|
|
- * Aria label for modifed editor.
|
|
|
+ * Aria label for modified editor.
|
|
|
*/
|
|
|
modifiedAriaLabel?: string;
|
|
|
}
|
|
@@ -3878,6 +3889,15 @@ declare namespace monaco.editor {
|
|
|
|
|
|
export type InternalInlineSuggestOptions = Readonly<Required<IInlineSuggestOptions>>;
|
|
|
|
|
|
+ export interface IBracketPairColorizationOptions {
|
|
|
+ /**
|
|
|
+ * Enable or disable bracket pair colorization.
|
|
|
+ */
|
|
|
+ enabled?: boolean;
|
|
|
+ }
|
|
|
+
|
|
|
+ export type InternalBracketPairColorizationOptions = Readonly<Required<IBracketPairColorizationOptions>>;
|
|
|
+
|
|
|
/**
|
|
|
* Configuration options for editor suggest widget
|
|
|
*/
|
|
@@ -4086,125 +4106,126 @@ declare namespace monaco.editor {
|
|
|
autoIndent = 9,
|
|
|
automaticLayout = 10,
|
|
|
autoSurround = 11,
|
|
|
- codeLens = 12,
|
|
|
- codeLensFontFamily = 13,
|
|
|
- codeLensFontSize = 14,
|
|
|
- colorDecorators = 15,
|
|
|
- columnSelection = 16,
|
|
|
- comments = 17,
|
|
|
- contextmenu = 18,
|
|
|
- copyWithSyntaxHighlighting = 19,
|
|
|
- cursorBlinking = 20,
|
|
|
- cursorSmoothCaretAnimation = 21,
|
|
|
- cursorStyle = 22,
|
|
|
- cursorSurroundingLines = 23,
|
|
|
- cursorSurroundingLinesStyle = 24,
|
|
|
- cursorWidth = 25,
|
|
|
- disableLayerHinting = 26,
|
|
|
- disableMonospaceOptimizations = 27,
|
|
|
- domReadOnly = 28,
|
|
|
- dragAndDrop = 29,
|
|
|
- emptySelectionClipboard = 30,
|
|
|
- extraEditorClassName = 31,
|
|
|
- fastScrollSensitivity = 32,
|
|
|
- find = 33,
|
|
|
- fixedOverflowWidgets = 34,
|
|
|
- folding = 35,
|
|
|
- foldingStrategy = 36,
|
|
|
- foldingHighlight = 37,
|
|
|
- foldingImportsByDefault = 38,
|
|
|
- unfoldOnClickAfterEndOfLine = 39,
|
|
|
- fontFamily = 40,
|
|
|
- fontInfo = 41,
|
|
|
- fontLigatures = 42,
|
|
|
- fontSize = 43,
|
|
|
- fontWeight = 44,
|
|
|
- formatOnPaste = 45,
|
|
|
- formatOnType = 46,
|
|
|
- glyphMargin = 47,
|
|
|
- gotoLocation = 48,
|
|
|
- hideCursorInOverviewRuler = 49,
|
|
|
- highlightActiveIndentGuide = 50,
|
|
|
- hover = 51,
|
|
|
- inDiffEditor = 52,
|
|
|
- inlineSuggest = 53,
|
|
|
- letterSpacing = 54,
|
|
|
- lightbulb = 55,
|
|
|
- lineDecorationsWidth = 56,
|
|
|
- lineHeight = 57,
|
|
|
- lineNumbers = 58,
|
|
|
- lineNumbersMinChars = 59,
|
|
|
- linkedEditing = 60,
|
|
|
- links = 61,
|
|
|
- matchBrackets = 62,
|
|
|
- minimap = 63,
|
|
|
- mouseStyle = 64,
|
|
|
- mouseWheelScrollSensitivity = 65,
|
|
|
- mouseWheelZoom = 66,
|
|
|
- multiCursorMergeOverlapping = 67,
|
|
|
- multiCursorModifier = 68,
|
|
|
- multiCursorPaste = 69,
|
|
|
- occurrencesHighlight = 70,
|
|
|
- overviewRulerBorder = 71,
|
|
|
- overviewRulerLanes = 72,
|
|
|
- padding = 73,
|
|
|
- parameterHints = 74,
|
|
|
- peekWidgetDefaultFocus = 75,
|
|
|
- definitionLinkOpensInPeek = 76,
|
|
|
- quickSuggestions = 77,
|
|
|
- quickSuggestionsDelay = 78,
|
|
|
- readOnly = 79,
|
|
|
- renameOnType = 80,
|
|
|
- renderControlCharacters = 81,
|
|
|
- renderIndentGuides = 82,
|
|
|
- renderFinalNewline = 83,
|
|
|
- renderLineHighlight = 84,
|
|
|
- renderLineHighlightOnlyWhenFocus = 85,
|
|
|
- renderValidationDecorations = 86,
|
|
|
- renderWhitespace = 87,
|
|
|
- revealHorizontalRightPadding = 88,
|
|
|
- roundedSelection = 89,
|
|
|
- rulers = 90,
|
|
|
- scrollbar = 91,
|
|
|
- scrollBeyondLastColumn = 92,
|
|
|
- scrollBeyondLastLine = 93,
|
|
|
- scrollPredominantAxis = 94,
|
|
|
- selectionClipboard = 95,
|
|
|
- selectionHighlight = 96,
|
|
|
- selectOnLineNumbers = 97,
|
|
|
- showFoldingControls = 98,
|
|
|
- showUnused = 99,
|
|
|
- snippetSuggestions = 100,
|
|
|
- smartSelect = 101,
|
|
|
- smoothScrolling = 102,
|
|
|
- stickyTabStops = 103,
|
|
|
- stopRenderingLineAfter = 104,
|
|
|
- suggest = 105,
|
|
|
- suggestFontSize = 106,
|
|
|
- suggestLineHeight = 107,
|
|
|
- suggestOnTriggerCharacters = 108,
|
|
|
- suggestSelection = 109,
|
|
|
- tabCompletion = 110,
|
|
|
- tabIndex = 111,
|
|
|
- unusualLineTerminators = 112,
|
|
|
- useShadowDOM = 113,
|
|
|
- useTabStops = 114,
|
|
|
- wordSeparators = 115,
|
|
|
- wordWrap = 116,
|
|
|
- wordWrapBreakAfterCharacters = 117,
|
|
|
- wordWrapBreakBeforeCharacters = 118,
|
|
|
- wordWrapColumn = 119,
|
|
|
- wordWrapOverride1 = 120,
|
|
|
- wordWrapOverride2 = 121,
|
|
|
- wrappingIndent = 122,
|
|
|
- wrappingStrategy = 123,
|
|
|
- showDeprecated = 124,
|
|
|
- inlayHints = 125,
|
|
|
- editorClassName = 126,
|
|
|
- pixelRatio = 127,
|
|
|
- tabFocusMode = 128,
|
|
|
- layoutInfo = 129,
|
|
|
- wrappingInfo = 130
|
|
|
+ bracketPairColorization = 12,
|
|
|
+ codeLens = 13,
|
|
|
+ codeLensFontFamily = 14,
|
|
|
+ codeLensFontSize = 15,
|
|
|
+ colorDecorators = 16,
|
|
|
+ columnSelection = 17,
|
|
|
+ comments = 18,
|
|
|
+ contextmenu = 19,
|
|
|
+ copyWithSyntaxHighlighting = 20,
|
|
|
+ cursorBlinking = 21,
|
|
|
+ cursorSmoothCaretAnimation = 22,
|
|
|
+ cursorStyle = 23,
|
|
|
+ cursorSurroundingLines = 24,
|
|
|
+ cursorSurroundingLinesStyle = 25,
|
|
|
+ cursorWidth = 26,
|
|
|
+ disableLayerHinting = 27,
|
|
|
+ disableMonospaceOptimizations = 28,
|
|
|
+ domReadOnly = 29,
|
|
|
+ dragAndDrop = 30,
|
|
|
+ emptySelectionClipboard = 31,
|
|
|
+ extraEditorClassName = 32,
|
|
|
+ fastScrollSensitivity = 33,
|
|
|
+ find = 34,
|
|
|
+ fixedOverflowWidgets = 35,
|
|
|
+ folding = 36,
|
|
|
+ foldingStrategy = 37,
|
|
|
+ foldingHighlight = 38,
|
|
|
+ foldingImportsByDefault = 39,
|
|
|
+ unfoldOnClickAfterEndOfLine = 40,
|
|
|
+ fontFamily = 41,
|
|
|
+ fontInfo = 42,
|
|
|
+ fontLigatures = 43,
|
|
|
+ fontSize = 44,
|
|
|
+ fontWeight = 45,
|
|
|
+ formatOnPaste = 46,
|
|
|
+ formatOnType = 47,
|
|
|
+ glyphMargin = 48,
|
|
|
+ gotoLocation = 49,
|
|
|
+ hideCursorInOverviewRuler = 50,
|
|
|
+ highlightActiveIndentGuide = 51,
|
|
|
+ hover = 52,
|
|
|
+ inDiffEditor = 53,
|
|
|
+ inlineSuggest = 54,
|
|
|
+ letterSpacing = 55,
|
|
|
+ lightbulb = 56,
|
|
|
+ lineDecorationsWidth = 57,
|
|
|
+ lineHeight = 58,
|
|
|
+ lineNumbers = 59,
|
|
|
+ lineNumbersMinChars = 60,
|
|
|
+ linkedEditing = 61,
|
|
|
+ links = 62,
|
|
|
+ matchBrackets = 63,
|
|
|
+ minimap = 64,
|
|
|
+ mouseStyle = 65,
|
|
|
+ mouseWheelScrollSensitivity = 66,
|
|
|
+ mouseWheelZoom = 67,
|
|
|
+ multiCursorMergeOverlapping = 68,
|
|
|
+ multiCursorModifier = 69,
|
|
|
+ multiCursorPaste = 70,
|
|
|
+ occurrencesHighlight = 71,
|
|
|
+ overviewRulerBorder = 72,
|
|
|
+ overviewRulerLanes = 73,
|
|
|
+ padding = 74,
|
|
|
+ parameterHints = 75,
|
|
|
+ peekWidgetDefaultFocus = 76,
|
|
|
+ definitionLinkOpensInPeek = 77,
|
|
|
+ quickSuggestions = 78,
|
|
|
+ quickSuggestionsDelay = 79,
|
|
|
+ readOnly = 80,
|
|
|
+ renameOnType = 81,
|
|
|
+ renderControlCharacters = 82,
|
|
|
+ renderIndentGuides = 83,
|
|
|
+ renderFinalNewline = 84,
|
|
|
+ renderLineHighlight = 85,
|
|
|
+ renderLineHighlightOnlyWhenFocus = 86,
|
|
|
+ renderValidationDecorations = 87,
|
|
|
+ renderWhitespace = 88,
|
|
|
+ revealHorizontalRightPadding = 89,
|
|
|
+ roundedSelection = 90,
|
|
|
+ rulers = 91,
|
|
|
+ scrollbar = 92,
|
|
|
+ scrollBeyondLastColumn = 93,
|
|
|
+ scrollBeyondLastLine = 94,
|
|
|
+ scrollPredominantAxis = 95,
|
|
|
+ selectionClipboard = 96,
|
|
|
+ selectionHighlight = 97,
|
|
|
+ selectOnLineNumbers = 98,
|
|
|
+ showFoldingControls = 99,
|
|
|
+ showUnused = 100,
|
|
|
+ snippetSuggestions = 101,
|
|
|
+ smartSelect = 102,
|
|
|
+ smoothScrolling = 103,
|
|
|
+ stickyTabStops = 104,
|
|
|
+ stopRenderingLineAfter = 105,
|
|
|
+ suggest = 106,
|
|
|
+ suggestFontSize = 107,
|
|
|
+ suggestLineHeight = 108,
|
|
|
+ suggestOnTriggerCharacters = 109,
|
|
|
+ suggestSelection = 110,
|
|
|
+ tabCompletion = 111,
|
|
|
+ tabIndex = 112,
|
|
|
+ unusualLineTerminators = 113,
|
|
|
+ useShadowDOM = 114,
|
|
|
+ useTabStops = 115,
|
|
|
+ wordSeparators = 116,
|
|
|
+ wordWrap = 117,
|
|
|
+ wordWrapBreakAfterCharacters = 118,
|
|
|
+ wordWrapBreakBeforeCharacters = 119,
|
|
|
+ wordWrapColumn = 120,
|
|
|
+ wordWrapOverride1 = 121,
|
|
|
+ wordWrapOverride2 = 122,
|
|
|
+ wrappingIndent = 123,
|
|
|
+ wrappingStrategy = 124,
|
|
|
+ showDeprecated = 125,
|
|
|
+ inlayHints = 126,
|
|
|
+ editorClassName = 127,
|
|
|
+ pixelRatio = 128,
|
|
|
+ tabFocusMode = 129,
|
|
|
+ layoutInfo = 130,
|
|
|
+ wrappingInfo = 131
|
|
|
}
|
|
|
export const EditorOptions: {
|
|
|
acceptSuggestionOnCommitCharacter: IEditorOption<EditorOption.acceptSuggestionOnCommitCharacter, boolean>;
|
|
@@ -4219,6 +4240,7 @@ declare namespace monaco.editor {
|
|
|
autoIndent: IEditorOption<EditorOption.autoIndent, EditorAutoIndentStrategy>;
|
|
|
automaticLayout: IEditorOption<EditorOption.automaticLayout, boolean>;
|
|
|
autoSurround: IEditorOption<EditorOption.autoSurround, 'languageDefined' | 'never' | 'quotes' | 'brackets'>;
|
|
|
+ bracketPairColorization: IEditorOption<EditorOption.bracketPairColorization, any>;
|
|
|
stickyTabStops: IEditorOption<EditorOption.stickyTabStops, boolean>;
|
|
|
codeLens: IEditorOption<EditorOption.codeLens, boolean>;
|
|
|
codeLensFontFamily: IEditorOption<EditorOption.codeLensFontFamily, string>;
|
|
@@ -5338,7 +5360,7 @@ declare namespace monaco.languages {
|
|
|
/**
|
|
|
* Register a code action provider (used by e.g. quick fix).
|
|
|
*/
|
|
|
- export function registerCodeActionProvider(languageId: string, provider: CodeActionProvider): IDisposable;
|
|
|
+ export function registerCodeActionProvider(languageId: string, provider: CodeActionProvider, metadata?: CodeActionProviderMetadata): IDisposable;
|
|
|
|
|
|
/**
|
|
|
* Register a formatter that can handle only entire models.
|
|
@@ -5431,6 +5453,21 @@ declare namespace monaco.languages {
|
|
|
provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult<CodeActionList>;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Metadata about the type of code actions that a {@link CodeActionProvider} provides.
|
|
|
+ */
|
|
|
+ export interface CodeActionProviderMetadata {
|
|
|
+ /**
|
|
|
+ * List of code action kinds that a {@link CodeActionProvider} may return.
|
|
|
+ *
|
|
|
+ * This list is used to determine if a given `CodeActionProvider` should be invoked or not.
|
|
|
+ * To avoid unnecessary computation, every `CodeActionProvider` should list use `providedCodeActionKinds`. The
|
|
|
+ * list of kinds may either be generic, such as `["quickfix", "refactor", "source"]`, or list out every kind provided,
|
|
|
+ * such as `["quickfix.removeLine", "source.fixAll" ...]`.
|
|
|
+ */
|
|
|
+ readonly providedCodeActionKinds?: readonly string[];
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Describes how comments for a language work.
|
|
|
*/
|
|
@@ -5486,6 +5523,11 @@ declare namespace monaco.languages {
|
|
|
* settings will be used.
|
|
|
*/
|
|
|
surroundingPairs?: IAutoClosingPair[];
|
|
|
+ /**
|
|
|
+ * Defines a list of bracket pairs that are colorized depending on their nesting level.
|
|
|
+ * If not set, the configured brackets will be used.
|
|
|
+ */
|
|
|
+ colorizedBracketPairs?: CharacterPair[];
|
|
|
/**
|
|
|
* Defines what characters must be after the cursor for bracket or quote autoclosing to occur when using the \'languageDefined\' autoclosing setting.
|
|
|
*
|
|
@@ -5919,6 +5961,12 @@ declare namespace monaco.languages {
|
|
|
* How the completion was triggered.
|
|
|
*/
|
|
|
readonly triggerKind: InlineCompletionTriggerKind;
|
|
|
+ readonly selectedSuggestionInfo: SelectedSuggestionInfo | undefined;
|
|
|
+ }
|
|
|
+
|
|
|
+ export interface SelectedSuggestionInfo {
|
|
|
+ range: IRange;
|
|
|
+ text: string;
|
|
|
}
|
|
|
|
|
|
export interface InlineCompletion {
|
|
@@ -6982,6 +7030,15 @@ declare namespace monaco.languages.typescript {
|
|
|
/** A full HTTP path to a JavaScript file which adds a function `customTSWorkerFactory` to the self inside a web-worker */
|
|
|
customWorkerPath?: string;
|
|
|
}
|
|
|
+ interface InlayHintsOptions {
|
|
|
+ readonly includeInlayParameterNameHints?: 'none' | 'literals' | 'all';
|
|
|
+ readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
|
|
|
+ readonly includeInlayFunctionParameterTypeHints?: boolean;
|
|
|
+ readonly includeInlayVariableTypeHints?: boolean;
|
|
|
+ readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
|
|
+ readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
|
|
+ readonly includeInlayEnumMemberValueHints?: boolean;
|
|
|
+ }
|
|
|
interface IExtraLib {
|
|
|
content: string;
|
|
|
version: number;
|
|
@@ -7040,6 +7097,7 @@ declare namespace monaco.languages.typescript {
|
|
|
*/
|
|
|
readonly onDidExtraLibsChange: IEvent<void>;
|
|
|
readonly workerOptions: WorkerOptions;
|
|
|
+ readonly inlayHintsOptions: InlayHintsOptions;
|
|
|
/**
|
|
|
* Get the current extra libs registered with the language service.
|
|
|
*/
|
|
@@ -7241,6 +7299,12 @@ declare namespace monaco.languages.typescript {
|
|
|
errorCodes: number[],
|
|
|
formatOptions: any
|
|
|
): Promise<ReadonlyArray<any>>;
|
|
|
+ /**
|
|
|
+ * Get inlay hints in the range of the file.
|
|
|
+ * @param fileName
|
|
|
+ * @returns `Promise<typescript.InlayHint[]>`
|
|
|
+ */
|
|
|
+ provideInlayHints(fileName: string, start: number, end: number): Promise<ReadonlyArray<any>>;
|
|
|
}
|
|
|
export const typescriptVersion: string;
|
|
|
export const typescriptDefaults: LanguageServiceDefaults;
|