Explorar o código

Adopts breaking change in nightly monaco-editor-core.

Henning Dieterichs %!s(int64=3) %!d(string=hai) anos
pai
achega
36f7110813

+ 6 - 0
CHANGELOG.md

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3077 - 1
package-lock.json


+ 1 - 1
package.json

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

+ 1 - 1
src/language/typescript/languageFeatures.ts

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

+ 47 - 24
website/playground/monaco.d.ts.txt

@@ -428,6 +428,7 @@ declare namespace monaco {
         readonly isTrusted?: boolean;
         readonly supportThemeIcons?: boolean;
         readonly supportHtml?: boolean;
+        readonly baseUri?: UriComponents;
         uris?: {
             [href: string]: UriComponents;
         };
@@ -710,6 +711,7 @@ declare namespace monaco {
          */
         static lift(range: undefined | null): null;
         static lift(range: IRange): Range;
+        static lift(range: IRange | undefined | null): Range | null;
         /**
          * Test if `obj` is an `IRange`.
          */
@@ -736,6 +738,7 @@ declare namespace monaco {
          * Test if the range spans multiple lines.
          */
         static spansMultipleLines(range: IRange): boolean;
+        toJSON(): IRange;
     }
 
     /**
@@ -1648,20 +1651,7 @@ declare namespace monaco.editor {
     /**
      * A single edit operation, that has an identifier.
      */
-    export interface IIdentifiedSingleEditOperation {
-        /**
-         * 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 IIdentifiedSingleEditOperation extends ISingleEditOperation {
     }
 
     export interface IValidEditOperation {
@@ -2369,8 +2359,9 @@ declare namespace monaco.editor {
         /**
          * Set the primary position of the cursor. This will remove any secondary cursors.
          * @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.
          */
@@ -2416,28 +2407,34 @@ declare namespace monaco.editor {
         /**
          * Set the primary selection of the editor. This will remove any secondary cursors.
          * @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.
          * @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.
          * @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.
          * @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.
          * 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.
          */
@@ -3340,7 +3337,14 @@ declare namespace monaco.editor {
          * Controls the behavior of editor guides.
         */
         guides?: IGuidesOptions;
+        /**
+         * Controls the behavior of the unicode highlight feature
+         * (by default, ambiguous and invisible characters are highlighted).
+         */
         unicodeHighlight?: IUnicodeHighlightOptions;
+        /**
+         * Configures bracket pair colorization (disabled by default).
+        */
         bracketPairColorization?: IBracketPairColorizationOptions;
     }
 
@@ -3921,15 +3925,33 @@ declare namespace monaco.editor {
      * Configuration options for unicode highlighting.
      */
     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;
+        /**
+         * Controls whether characters that just reserve space or have no width at all are highlighted.
+         */
         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;
+        /**
+         * Controls whether characters in comments should also be subject to unicode highlighting.
+         */
         includeComments?: boolean | InUntrustedWorkspace;
+        /**
+         * Controls whether characters in strings should also be subject to unicode highlighting.
+         */
         includeStrings?: boolean | InUntrustedWorkspace;
         /**
-         * A map of allowed characters (true: allowed).
-        */
+         * Defines allowed characters that are not being highlighted.
+         */
         allowedCharacters?: Record<string, true>;
+        /**
+         * Unicode characters that are common in allowed locales are not being highlighted.
+         */
         allowedLocales?: Record<string | '_os' | '_vscode', true>;
     }
 
@@ -6886,7 +6908,6 @@ declare namespace monaco.languages {
     }
 
     export enum InlayHintKind {
-        Other = 0,
         Type = 1,
         Parameter = 2
     }
@@ -6901,8 +6922,9 @@ declare namespace monaco.languages {
     export interface InlayHint {
         label: string | InlayHintLabelPart[];
         tooltip?: string | IMarkdownString;
+        command?: Command;
         position: IPosition;
-        kind: InlayHintKind;
+        kind?: InlayHintKind;
         paddingLeft?: boolean;
         paddingRight?: boolean;
     }
@@ -6913,6 +6935,7 @@ declare namespace monaco.languages {
     }
 
     export interface InlayHintsProvider {
+        displayName?: string;
         onDidChangeInlayHints?: IEvent<void>;
         provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;
         resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;

+ 47 - 24
website/typedoc/monaco.d.ts

@@ -428,6 +428,7 @@ declare namespace monaco {
         readonly isTrusted?: boolean;
         readonly supportThemeIcons?: boolean;
         readonly supportHtml?: boolean;
+        readonly baseUri?: UriComponents;
         uris?: {
             [href: string]: UriComponents;
         };
@@ -710,6 +711,7 @@ declare namespace monaco {
          */
         static lift(range: undefined | null): null;
         static lift(range: IRange): Range;
+        static lift(range: IRange | undefined | null): Range | null;
         /**
          * Test if `obj` is an `IRange`.
          */
@@ -736,6 +738,7 @@ declare namespace monaco {
          * Test if the range spans multiple lines.
          */
         static spansMultipleLines(range: IRange): boolean;
+        toJSON(): IRange;
     }
 
     /**
@@ -1648,20 +1651,7 @@ declare namespace monaco.editor {
     /**
      * A single edit operation, that has an identifier.
      */
-    export interface IIdentifiedSingleEditOperation {
-        /**
-         * 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 IIdentifiedSingleEditOperation extends ISingleEditOperation {
     }
 
     export interface IValidEditOperation {
@@ -2369,8 +2359,9 @@ declare namespace monaco.editor {
         /**
          * Set the primary position of the cursor. This will remove any secondary cursors.
          * @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.
          */
@@ -2416,28 +2407,34 @@ declare namespace monaco.editor {
         /**
          * Set the primary selection of the editor. This will remove any secondary cursors.
          * @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.
          * @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.
          * @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.
          * @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.
          * 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.
          */
@@ -3340,7 +3337,14 @@ declare namespace monaco.editor {
          * Controls the behavior of editor guides.
         */
         guides?: IGuidesOptions;
+        /**
+         * Controls the behavior of the unicode highlight feature
+         * (by default, ambiguous and invisible characters are highlighted).
+         */
         unicodeHighlight?: IUnicodeHighlightOptions;
+        /**
+         * Configures bracket pair colorization (disabled by default).
+        */
         bracketPairColorization?: IBracketPairColorizationOptions;
     }
 
@@ -3921,15 +3925,33 @@ declare namespace monaco.editor {
      * Configuration options for unicode highlighting.
      */
     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;
+        /**
+         * Controls whether characters that just reserve space or have no width at all are highlighted.
+         */
         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;
+        /**
+         * Controls whether characters in comments should also be subject to unicode highlighting.
+         */
         includeComments?: boolean | InUntrustedWorkspace;
+        /**
+         * Controls whether characters in strings should also be subject to unicode highlighting.
+         */
         includeStrings?: boolean | InUntrustedWorkspace;
         /**
-         * A map of allowed characters (true: allowed).
-        */
+         * Defines allowed characters that are not being highlighted.
+         */
         allowedCharacters?: Record<string, true>;
+        /**
+         * Unicode characters that are common in allowed locales are not being highlighted.
+         */
         allowedLocales?: Record<string | '_os' | '_vscode', true>;
     }
 
@@ -6886,7 +6908,6 @@ declare namespace monaco.languages {
     }
 
     export enum InlayHintKind {
-        Other = 0,
         Type = 1,
         Parameter = 2
     }
@@ -6901,8 +6922,9 @@ declare namespace monaco.languages {
     export interface InlayHint {
         label: string | InlayHintLabelPart[];
         tooltip?: string | IMarkdownString;
+        command?: Command;
         position: IPosition;
-        kind: InlayHintKind;
+        kind?: InlayHintKind;
         paddingLeft?: boolean;
         paddingRight?: boolean;
     }
@@ -6913,6 +6935,7 @@ declare namespace monaco.languages {
     }
 
     export interface InlayHintsProvider {
+        displayName?: string;
         onDidChangeInlayHints?: IEvent<void>;
         provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHintList>;
         resolveInlayHint?(hint: InlayHint, token: CancellationToken): ProviderResult<InlayHint>;

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio