|
@@ -807,6 +807,10 @@ declare namespace monaco {
|
|
|
* Get the position at `positionLineNumber` and `positionColumn`.
|
|
|
*/
|
|
|
getPosition(): Position;
|
|
|
+ /**
|
|
|
+ * Get the position at the start of the selection.
|
|
|
+ */
|
|
|
+ getSelectionStart(): Position;
|
|
|
/**
|
|
|
* Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.
|
|
|
*/
|
|
@@ -815,6 +819,10 @@ declare namespace monaco {
|
|
|
* Create a `Selection` from one or two positions
|
|
|
*/
|
|
|
static fromPositions(start: IPosition, end?: IPosition): Selection;
|
|
|
+ /**
|
|
|
+ * Creates a `Selection` from a range, given a direction.
|
|
|
+ */
|
|
|
+ static fromRange(range: Range, direction: SelectionDirection): Selection;
|
|
|
/**
|
|
|
* Create a `Selection` from an `ISelection`.
|
|
|
*/
|
|
@@ -1804,7 +1812,7 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
getLineLastNonWhitespaceColumn(lineNumber: number): number;
|
|
|
/**
|
|
|
- * Create a valid position,
|
|
|
+ * Create a valid position.
|
|
|
*/
|
|
|
validatePosition(position: IPosition): Position;
|
|
|
/**
|
|
@@ -1839,7 +1847,7 @@ declare namespace monaco.editor {
|
|
|
*/
|
|
|
getPositionAt(offset: number): Position;
|
|
|
/**
|
|
|
- * Get a range covering the entire model
|
|
|
+ * Get a range covering the entire model.
|
|
|
*/
|
|
|
getFullModelRange(): Range;
|
|
|
/**
|
|
@@ -2954,12 +2962,10 @@ declare namespace monaco.editor {
|
|
|
wrappingStrategy?: 'simple' | 'advanced';
|
|
|
/**
|
|
|
* Configure word wrapping characters. A break will be introduced before these characters.
|
|
|
- * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'.
|
|
|
*/
|
|
|
wordWrapBreakBeforeCharacters?: string;
|
|
|
/**
|
|
|
* Configure word wrapping characters. A break will be introduced after these characters.
|
|
|
- * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'.
|
|
|
*/
|
|
|
wordWrapBreakAfterCharacters?: string;
|
|
|
/**
|
|
@@ -3298,6 +3304,7 @@ declare namespace monaco.editor {
|
|
|
* Controls the behavior of editor guides.
|
|
|
*/
|
|
|
guides?: IGuidesOptions;
|
|
|
+ unicodeHighlight?: IUnicodeHighlightOptions;
|
|
|
}
|
|
|
|
|
|
export interface IDiffEditorBaseOptions {
|
|
@@ -3376,6 +3383,16 @@ declare namespace monaco.editor {
|
|
|
readonly id: K1;
|
|
|
readonly name: string;
|
|
|
defaultValue: V;
|
|
|
+ /**
|
|
|
+ * Might modify `value`.
|
|
|
+ */
|
|
|
+ applyUpdate(value: V, update: V): ApplyUpdateResult<V>;
|
|
|
+ }
|
|
|
+
|
|
|
+ export class ApplyUpdateResult<T> {
|
|
|
+ readonly newValue: T;
|
|
|
+ readonly didChange: boolean;
|
|
|
+ constructor(newValue: T, didChange: boolean);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3861,6 +3878,22 @@ declare namespace monaco.editor {
|
|
|
readonly scrollByPage: boolean;
|
|
|
}
|
|
|
|
|
|
+ export type InUntrustedWorkspace = 'inUntrustedWorkspace';
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Configuration options for unicode highlighting.
|
|
|
+ */
|
|
|
+ export interface IUnicodeHighlightOptions {
|
|
|
+ nonBasicASCII?: boolean | InUntrustedWorkspace;
|
|
|
+ invisibleCharacters?: boolean;
|
|
|
+ ambiguousCharacters?: boolean;
|
|
|
+ includeComments?: boolean | InUntrustedWorkspace;
|
|
|
+ /**
|
|
|
+ * A map of allowed characters (true: allowed).
|
|
|
+ */
|
|
|
+ allowedCharacters?: Record<string, true>;
|
|
|
+ }
|
|
|
+
|
|
|
export interface IInlineSuggestOptions {
|
|
|
/**
|
|
|
* Enable or disable the rendering of automatic inline completions.
|
|
@@ -4215,25 +4248,26 @@ declare namespace monaco.editor {
|
|
|
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
|
|
|
+ unicodeHighlighting = 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: {
|
|
@@ -4351,6 +4385,7 @@ declare namespace monaco.editor {
|
|
|
suggestSelection: IEditorOption<EditorOption.suggestSelection, 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix'>;
|
|
|
tabCompletion: IEditorOption<EditorOption.tabCompletion, 'on' | 'off' | 'onlySnippets'>;
|
|
|
tabIndex: IEditorOption<EditorOption.tabIndex, number>;
|
|
|
+ unicodeHighlight: IEditorOption<EditorOption.unicodeHighlighting, Required<Readonly<IUnicodeHighlightOptions>>>;
|
|
|
unusualLineTerminators: IEditorOption<EditorOption.unusualLineTerminators, 'auto' | 'off' | 'prompt'>;
|
|
|
useShadowDOM: IEditorOption<EditorOption.useShadowDOM, boolean>;
|
|
|
useTabStops: IEditorOption<EditorOption.useTabStops, boolean>;
|
|
@@ -5097,6 +5132,7 @@ declare namespace monaco.editor {
|
|
|
* Apply the same font settings as the editor to `target`.
|
|
|
*/
|
|
|
applyFontInfo(target: HTMLElement): void;
|
|
|
+ setBanner(bannerDomNode: HTMLElement | null, height: number): void;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -5822,6 +5858,11 @@ declare namespace monaco.languages {
|
|
|
InsertAsSnippet = 4
|
|
|
}
|
|
|
|
|
|
+ export interface CompletionItemRanges {
|
|
|
+ insert: IRange;
|
|
|
+ replace: IRange;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* A completion item represents a text snippet that is
|
|
|
* proposed to complete text that is being typed.
|
|
@@ -5873,11 +5914,10 @@ declare namespace monaco.languages {
|
|
|
/**
|
|
|
* A string or snippet that should be inserted in a document when selecting
|
|
|
* this completion.
|
|
|
- * is used.
|
|
|
*/
|
|
|
insertText: string;
|
|
|
/**
|
|
|
- * Addition rules (as bitmask) that should be applied when inserting
|
|
|
+ * Additional rules (as bitmask) that should be applied when inserting
|
|
|
* this completion.
|
|
|
*/
|
|
|
insertTextRules?: CompletionItemInsertTextRule;
|
|
@@ -5890,10 +5930,7 @@ declare namespace monaco.languages {
|
|
|
* *Note:* The range must be a {@link Range.isSingleLine single line} and it must
|
|
|
* {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}.
|
|
|
*/
|
|
|
- range: IRange | {
|
|
|
- insert: IRange;
|
|
|
- replace: IRange;
|
|
|
- };
|
|
|
+ range: IRange | CompletionItemRanges;
|
|
|
/**
|
|
|
* 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
|
|
@@ -5997,6 +6034,8 @@ declare namespace monaco.languages {
|
|
|
export interface SelectedSuggestionInfo {
|
|
|
range: IRange;
|
|
|
text: string;
|
|
|
+ isSnippetText: boolean;
|
|
|
+ completionKind: CompletionItemKind;
|
|
|
}
|
|
|
|
|
|
export interface InlineCompletion {
|