Adopts breaking change in nightly monaco-editor-core.

This commit is contained in:
Henning Dieterichs 2022-02-14 11:32:52 +01:00
parent 0d48f9fec8
commit 36f7110813
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06
6 changed files with 3187 additions and 58 deletions

View file

@ -1,5 +1,11 @@
# Monaco Editor Changelog # Monaco Editor Changelog
## [0.33.0] (TBD)
### Breaking Changes
- `InlayHintKind.Other` is removed.
## [0.32.1] (04.02.2022) ## [0.32.1] (04.02.2022)
- fixes [an issue with service initialization](https://github.com/microsoft/monaco-editor/issues/2941). - fixes [an issue with service initialization](https://github.com/microsoft/monaco-editor/issues/2941).

3093
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -42,7 +42,7 @@
"jsdom": "^19.0.0", "jsdom": "^19.0.0",
"jsonc-parser": "^3.0.0", "jsonc-parser": "^3.0.0",
"mocha": "^9.2.0", "mocha": "^9.2.0",
"monaco-editor-core": "0.32.1", "monaco-editor-core": "0.33.0-dev.20220214",
"playwright": "^1.18.1", "playwright": "^1.18.1",
"prettier": "^2.5.1", "prettier": "^2.5.1",
"pretty-quick": "^3.1.3", "pretty-quick": "^3.1.3",

View file

@ -1259,7 +1259,7 @@ export class InlayHintsAdapter extends Adapter implements languages.InlayHintsPr
case 'Type': case 'Type':
return languages.InlayHintKind.Type; return languages.InlayHintKind.Type;
default: default:
return languages.InlayHintKind.Other; return languages.InlayHintKind.Type;
} }
} }
} }

View file

@ -428,6 +428,7 @@ declare namespace monaco {
readonly isTrusted?: boolean; readonly isTrusted?: boolean;
readonly supportThemeIcons?: boolean; readonly supportThemeIcons?: boolean;
readonly supportHtml?: boolean; readonly supportHtml?: boolean;
readonly baseUri?: UriComponents;
uris?: { uris?: {
[href: string]: UriComponents; [href: string]: UriComponents;
}; };
@ -710,6 +711,7 @@ declare namespace monaco {
*/ */
static lift(range: undefined | null): null; static lift(range: undefined | null): null;
static lift(range: IRange): Range; static lift(range: IRange): Range;
static lift(range: IRange | undefined | null): Range | null;
/** /**
* Test if `obj` is an `IRange`. * Test if `obj` is an `IRange`.
*/ */
@ -736,6 +738,7 @@ declare namespace monaco {
* Test if the range spans multiple lines. * Test if the range spans multiple lines.
*/ */
static spansMultipleLines(range: IRange): boolean; static spansMultipleLines(range: IRange): boolean;
toJSON(): IRange;
} }
/** /**
@ -1648,20 +1651,7 @@ declare namespace monaco.editor {
/** /**
* A single edit operation, that has an identifier. * A single edit operation, that has an identifier.
*/ */
export interface IIdentifiedSingleEditOperation { export interface IIdentifiedSingleEditOperation extends ISingleEditOperation {
/**
* The range to replace. This can be empty to emulate a simple insert.
*/
range: IRange;
/**
* The text to replace with. This can be null to emulate a simple delete.
*/
text: string | null;
/**
* 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;
} }
export interface IValidEditOperation { export interface IValidEditOperation {
@ -2369,8 +2359,9 @@ declare namespace monaco.editor {
/** /**
* Set the primary position of the cursor. This will remove any secondary cursors. * Set the primary position of the cursor. This will remove any secondary cursors.
* @param position New primary cursor's position * @param position New primary cursor's position
* @param source Source of the call that caused the position
*/ */
setPosition(position: IPosition): void; setPosition(position: IPosition, source?: string): void;
/** /**
* Scroll vertically as necessary and reveal a line. * Scroll vertically as necessary and reveal a line.
*/ */
@ -2416,28 +2407,34 @@ declare namespace monaco.editor {
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: IRange): void; setSelection(selection: IRange, source?: string): void;
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: Range): void; setSelection(selection: Range, source?: string): void;
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: ISelection): void; setSelection(selection: ISelection, source?: string): void;
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: Selection): void; setSelection(selection: Selection, source?: string): void;
/** /**
* Set the selections for all the cursors of the editor. * Set the selections for all the cursors of the editor.
* Cursors will be removed or added, as necessary. * Cursors will be removed or added, as necessary.
* @param selections The new selection
* @param source Source of the call that caused the selection
*/ */
setSelections(selections: readonly ISelection[]): void; setSelections(selections: readonly ISelection[], source?: string): void;
/** /**
* Scroll vertically as necessary and reveal lines. * Scroll vertically as necessary and reveal lines.
*/ */
@ -3340,7 +3337,14 @@ declare namespace monaco.editor {
* Controls the behavior of editor guides. * Controls the behavior of editor guides.
*/ */
guides?: IGuidesOptions; guides?: IGuidesOptions;
/**
* Controls the behavior of the unicode highlight feature
* (by default, ambiguous and invisible characters are highlighted).
*/
unicodeHighlight?: IUnicodeHighlightOptions; unicodeHighlight?: IUnicodeHighlightOptions;
/**
* Configures bracket pair colorization (disabled by default).
*/
bracketPairColorization?: IBracketPairColorizationOptions; bracketPairColorization?: IBracketPairColorizationOptions;
} }
@ -3921,15 +3925,33 @@ declare namespace monaco.editor {
* Configuration options for unicode highlighting. * Configuration options for unicode highlighting.
*/ */
export interface IUnicodeHighlightOptions { export interface IUnicodeHighlightOptions {
/**
* Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.
*/
nonBasicASCII?: boolean | InUntrustedWorkspace; nonBasicASCII?: boolean | InUntrustedWorkspace;
/**
* Controls whether characters that just reserve space or have no width at all are highlighted.
*/
invisibleCharacters?: boolean; invisibleCharacters?: boolean;
/**
* Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.
*/
ambiguousCharacters?: boolean; ambiguousCharacters?: boolean;
/**
* Controls whether characters in comments should also be subject to unicode highlighting.
*/
includeComments?: boolean | InUntrustedWorkspace; includeComments?: boolean | InUntrustedWorkspace;
/**
* Controls whether characters in strings should also be subject to unicode highlighting.
*/
includeStrings?: boolean | InUntrustedWorkspace; includeStrings?: boolean | InUntrustedWorkspace;
/** /**
* A map of allowed characters (true: allowed). * Defines allowed characters that are not being highlighted.
*/ */
allowedCharacters?: Record<string, true>; allowedCharacters?: Record<string, true>;
/**
* Unicode characters that are common in allowed locales are not being highlighted.
*/
allowedLocales?: Record<string | '_os' | '_vscode', true>; allowedLocales?: Record<string | '_os' | '_vscode', true>;
} }
@ -6886,7 +6908,6 @@ declare namespace monaco.languages {
} }
export enum InlayHintKind { export enum InlayHintKind {
Other = 0,
Type = 1, Type = 1,
Parameter = 2 Parameter = 2
} }
@ -6901,8 +6922,9 @@ declare namespace monaco.languages {
export interface InlayHint { export interface InlayHint {
label: string | InlayHintLabelPart[]; label: string | InlayHintLabelPart[];
tooltip?: string | IMarkdownString; tooltip?: string | IMarkdownString;
command?: Command;
position: IPosition; position: IPosition;
kind: InlayHintKind; kind?: InlayHintKind;
paddingLeft?: boolean; paddingLeft?: boolean;
paddingRight?: boolean; paddingRight?: boolean;
} }
@ -6913,6 +6935,7 @@ declare namespace monaco.languages {
} }
export interface InlayHintsProvider { export interface InlayHintsProvider {
displayName?: string;
onDidChangeInlayHints?: IEvent<void>; onDidChangeInlayHints?: IEvent<void>;
provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>; provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;
resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>; resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;

View file

@ -428,6 +428,7 @@ declare namespace monaco {
readonly isTrusted?: boolean; readonly isTrusted?: boolean;
readonly supportThemeIcons?: boolean; readonly supportThemeIcons?: boolean;
readonly supportHtml?: boolean; readonly supportHtml?: boolean;
readonly baseUri?: UriComponents;
uris?: { uris?: {
[href: string]: UriComponents; [href: string]: UriComponents;
}; };
@ -710,6 +711,7 @@ declare namespace monaco {
*/ */
static lift(range: undefined | null): null; static lift(range: undefined | null): null;
static lift(range: IRange): Range; static lift(range: IRange): Range;
static lift(range: IRange | undefined | null): Range | null;
/** /**
* Test if `obj` is an `IRange`. * Test if `obj` is an `IRange`.
*/ */
@ -736,6 +738,7 @@ declare namespace monaco {
* Test if the range spans multiple lines. * Test if the range spans multiple lines.
*/ */
static spansMultipleLines(range: IRange): boolean; static spansMultipleLines(range: IRange): boolean;
toJSON(): IRange;
} }
/** /**
@ -1648,20 +1651,7 @@ declare namespace monaco.editor {
/** /**
* A single edit operation, that has an identifier. * A single edit operation, that has an identifier.
*/ */
export interface IIdentifiedSingleEditOperation { export interface IIdentifiedSingleEditOperation extends ISingleEditOperation {
/**
* The range to replace. This can be empty to emulate a simple insert.
*/
range: IRange;
/**
* The text to replace with. This can be null to emulate a simple delete.
*/
text: string | null;
/**
* 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;
} }
export interface IValidEditOperation { export interface IValidEditOperation {
@ -2369,8 +2359,9 @@ declare namespace monaco.editor {
/** /**
* Set the primary position of the cursor. This will remove any secondary cursors. * Set the primary position of the cursor. This will remove any secondary cursors.
* @param position New primary cursor's position * @param position New primary cursor's position
* @param source Source of the call that caused the position
*/ */
setPosition(position: IPosition): void; setPosition(position: IPosition, source?: string): void;
/** /**
* Scroll vertically as necessary and reveal a line. * Scroll vertically as necessary and reveal a line.
*/ */
@ -2416,28 +2407,34 @@ declare namespace monaco.editor {
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: IRange): void; setSelection(selection: IRange, source?: string): void;
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: Range): void; setSelection(selection: Range, source?: string): void;
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: ISelection): void; setSelection(selection: ISelection, source?: string): void;
/** /**
* Set the primary selection of the editor. This will remove any secondary cursors. * Set the primary selection of the editor. This will remove any secondary cursors.
* @param selection The new selection * @param selection The new selection
* @param source Source of the call that caused the selection
*/ */
setSelection(selection: Selection): void; setSelection(selection: Selection, source?: string): void;
/** /**
* Set the selections for all the cursors of the editor. * Set the selections for all the cursors of the editor.
* Cursors will be removed or added, as necessary. * Cursors will be removed or added, as necessary.
* @param selections The new selection
* @param source Source of the call that caused the selection
*/ */
setSelections(selections: readonly ISelection[]): void; setSelections(selections: readonly ISelection[], source?: string): void;
/** /**
* Scroll vertically as necessary and reveal lines. * Scroll vertically as necessary and reveal lines.
*/ */
@ -3340,7 +3337,14 @@ declare namespace monaco.editor {
* Controls the behavior of editor guides. * Controls the behavior of editor guides.
*/ */
guides?: IGuidesOptions; guides?: IGuidesOptions;
/**
* Controls the behavior of the unicode highlight feature
* (by default, ambiguous and invisible characters are highlighted).
*/
unicodeHighlight?: IUnicodeHighlightOptions; unicodeHighlight?: IUnicodeHighlightOptions;
/**
* Configures bracket pair colorization (disabled by default).
*/
bracketPairColorization?: IBracketPairColorizationOptions; bracketPairColorization?: IBracketPairColorizationOptions;
} }
@ -3921,15 +3925,33 @@ declare namespace monaco.editor {
* Configuration options for unicode highlighting. * Configuration options for unicode highlighting.
*/ */
export interface IUnicodeHighlightOptions { export interface IUnicodeHighlightOptions {
/**
* Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.
*/
nonBasicASCII?: boolean | InUntrustedWorkspace; nonBasicASCII?: boolean | InUntrustedWorkspace;
/**
* Controls whether characters that just reserve space or have no width at all are highlighted.
*/
invisibleCharacters?: boolean; invisibleCharacters?: boolean;
/**
* Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.
*/
ambiguousCharacters?: boolean; ambiguousCharacters?: boolean;
/**
* Controls whether characters in comments should also be subject to unicode highlighting.
*/
includeComments?: boolean | InUntrustedWorkspace; includeComments?: boolean | InUntrustedWorkspace;
/**
* Controls whether characters in strings should also be subject to unicode highlighting.
*/
includeStrings?: boolean | InUntrustedWorkspace; includeStrings?: boolean | InUntrustedWorkspace;
/** /**
* A map of allowed characters (true: allowed). * Defines allowed characters that are not being highlighted.
*/ */
allowedCharacters?: Record<string, true>; allowedCharacters?: Record<string, true>;
/**
* Unicode characters that are common in allowed locales are not being highlighted.
*/
allowedLocales?: Record<string | '_os' | '_vscode', true>; allowedLocales?: Record<string | '_os' | '_vscode', true>;
} }
@ -6886,7 +6908,6 @@ declare namespace monaco.languages {
} }
export enum InlayHintKind { export enum InlayHintKind {
Other = 0,
Type = 1, Type = 1,
Parameter = 2 Parameter = 2
} }
@ -6901,8 +6922,9 @@ declare namespace monaco.languages {
export interface InlayHint { export interface InlayHint {
label: string | InlayHintLabelPart[]; label: string | InlayHintLabelPart[];
tooltip?: string | IMarkdownString; tooltip?: string | IMarkdownString;
command?: Command;
position: IPosition; position: IPosition;
kind: InlayHintKind; kind?: InlayHintKind;
paddingLeft?: boolean; paddingLeft?: boolean;
paddingRight?: boolean; paddingRight?: boolean;
} }
@ -6913,6 +6935,7 @@ declare namespace monaco.languages {
} }
export interface InlayHintsProvider { export interface InlayHintsProvider {
displayName?: string;
onDidChangeInlayHints?: IEvent<void>; onDidChangeInlayHints?: IEvent<void>;
provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>; provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;
resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>; resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;