diff --git a/build/lib/monaco-api.js b/build/lib/monaco-api.js index 2c6677d430c..98234633a2a 100644 --- a/build/lib/monaco-api.js +++ b/build/lib/monaco-api.js @@ -149,26 +149,6 @@ function getMassagedTopLevelDeclarationText(ts, sourceFile, declaration, importN } }); } - else if (declaration.kind === ts.SyntaxKind.VariableStatement) { - const jsDoc = result.substr(0, declaration.getLeadingTriviaWidth(sourceFile)); - if (jsDoc.indexOf('@monacodtsreplace') >= 0) { - const jsDocLines = jsDoc.split(/\r\n|\r|\n/); - let directives = []; - for (const jsDocLine of jsDocLines) { - const m = jsDocLine.match(/^\s*\* \/([^/]+)\/([^/]+)\/$/); - if (m) { - directives.push([new RegExp(m[1], 'g'), m[2]]); - } - } - // remove the jsdoc - result = result.substr(jsDoc.length); - if (directives.length > 0) { - // apply replace directives - const replacer = createReplacerFromDirectives(directives); - result = replacer(result); - } - } - } result = result.replace(/export default /g, 'export '); result = result.replace(/export declare /g, 'export '); result = result.replace(/declare /g, ''); diff --git a/build/lib/monaco-api.ts b/build/lib/monaco-api.ts index e45422b537e..31487baf0a9 100644 --- a/build/lib/monaco-api.ts +++ b/build/lib/monaco-api.ts @@ -178,25 +178,6 @@ function getMassagedTopLevelDeclarationText(ts: typeof import('typescript'), sou // life.. } }); - } else if (declaration.kind === ts.SyntaxKind.VariableStatement) { - const jsDoc = result.substr(0, declaration.getLeadingTriviaWidth(sourceFile)); - if (jsDoc.indexOf('@monacodtsreplace') >= 0) { - const jsDocLines = jsDoc.split(/\r\n|\r|\n/); - let directives: [RegExp, string][] = []; - for (const jsDocLine of jsDocLines) { - const m = jsDocLine.match(/^\s*\* \/([^/]+)\/([^/]+)\/$/); - if (m) { - directives.push([new RegExp(m[1], 'g'), m[2]]); - } - } - // remove the jsdoc - result = result.substr(jsDoc.length); - if (directives.length > 0) { - // apply replace directives - const replacer = createReplacerFromDirectives(directives); - result = replacer(result); - } - } } result = result.replace(/export default /g, 'export '); result = result.replace(/export declare /g, 'export '); diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 7d8189c50be..36287b033d2 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -1152,6 +1152,9 @@ export interface IEditorCommentsOptions { ignoreEmptyLines?: boolean; } +/** + * @internal + */ export type EditorCommentsOptions = Readonly>; class EditorComments extends BaseEditorOption { @@ -1382,6 +1385,9 @@ export interface IEditorFindOptions { loop?: boolean; } +/** + * @internal + */ export type EditorFindOptions = Readonly>; class EditorFind extends BaseEditorOption { @@ -1634,6 +1640,9 @@ export interface IGotoLocationOptions { alternativeReferenceCommand?: string; } +/** + * @internal + */ export type GoToLocationOptions = Readonly>; class EditorGoToLocation extends BaseEditorOption { @@ -1769,6 +1778,9 @@ export interface IEditorHoverOptions { sticky?: boolean; } +/** + * @internal + */ export type EditorHoverOptions = Readonly>; class EditorHover extends BaseEditorOption { @@ -2390,6 +2402,9 @@ export interface IEditorLightbulbOptions { enabled?: boolean; } +/** + * @internal + */ export type EditorLightbulbOptions = Readonly>; class EditorLightbulb extends BaseEditorOption { @@ -2446,6 +2461,9 @@ export interface IEditorInlayHintsOptions { fontFamily?: string; } +/** + * @internal + */ export type EditorInlayHintsOptions = Readonly>; class EditorInlayHints extends BaseEditorOption { @@ -2554,6 +2572,9 @@ export interface IEditorMinimapOptions { scale?: number; } +/** + * @internal + */ export type EditorMinimapOptions = Readonly>; class EditorMinimap extends BaseEditorOption { @@ -2667,10 +2688,10 @@ export interface IEditorPaddingOptions { bottom?: number; } -export interface InternalEditorPaddingOptions { - readonly top: number; - readonly bottom: number; -} +/** + * @internal + */ +export type InternalEditorPaddingOptions = Readonly>; class EditorPadding extends BaseEditorOption { @@ -2728,6 +2749,9 @@ export interface IEditorParameterHintOptions { cycle?: boolean; } +/** + * @internal + */ export type InternalParameterHintOptions = Readonly>; class EditorParameterHints extends BaseEditorOption { @@ -2794,6 +2818,9 @@ export interface IQuickSuggestionsOptions { strings?: boolean; } +/** + * @internal + */ export type ValidQuickSuggestionsOptions = boolean | Readonly>; class EditorQuickSuggestions extends BaseEditorOption { @@ -3226,6 +3253,9 @@ export interface IInlineSuggestOptions { mode?: 'prefix' | 'subword' | 'subwordSmart'; } +/** + * @internal + */ export type InternalInlineSuggestOptions = Readonly>; /** @@ -3273,6 +3303,9 @@ export interface IBracketPairColorizationOptions { enabled?: boolean; } +/** + * @internal + */ export type InternalBracketPairColorizationOptions = Readonly>; /** @@ -3330,6 +3363,9 @@ export interface IGuidesOptions { highlightActiveIndentation?: boolean; } +/** + * @internal + */ export type InternalGuidesOptions = Readonly>; /** @@ -3540,6 +3576,9 @@ export interface ISuggestOptions { showSnippets?: boolean; } +/** + * @internal + */ export type InternalSuggestOptions = Readonly>; class EditorSuggest extends BaseEditorOption { @@ -3851,6 +3890,9 @@ export interface ISmartSelectOptions { selectLeadingAndTrailingWhitespace?: boolean } +/** + * @internal + */ export type SmartSelectOptions = Readonly>; class SmartSelect extends BaseEditorOption { @@ -4140,21 +4182,6 @@ export const enum EditorOption { wrappingInfo, } -/** - * WORKAROUND: TS emits "any" for complex editor options values (anything except string, bool, enum, etc. ends up being "any") - * @monacodtsreplace - * /accessibilitySupport, any/accessibilitySupport, AccessibilitySupport/ - * /comments, any/comments, EditorCommentsOptions/ - * /find, any/find, EditorFindOptions/ - * /fontInfo, any/fontInfo, FontInfo/ - * /gotoLocation, any/gotoLocation, GoToLocationOptions/ - * /hover, any/hover, EditorHoverOptions/ - * /lightbulb, any/lightbulb, EditorLightbulbOptions/ - * /minimap, any/minimap, EditorMinimapOptions/ - * /parameterHints, any/parameterHints, InternalParameterHintOptions/ - * /quickSuggestions, any/quickSuggestions, ValidQuickSuggestionsOptions/ - * /suggest, any/suggest, InternalSuggestOptions/ - */ export const EditorOptions = { acceptSuggestionOnCommitCharacter: register(new EditorBooleanOption( EditorOption.acceptSuggestionOnCommitCharacter, 'acceptSuggestionOnCommitCharacter', true, diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 5e0533dd41a..6ef6eb0a853 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -3377,8 +3377,6 @@ declare namespace monaco.editor { ignoreEmptyLines?: boolean; } - export type EditorCommentsOptions = Readonly>; - /** * The kind of animation in which the editor's cursor should be rendered. */ @@ -3462,8 +3460,6 @@ declare namespace monaco.editor { loop?: boolean; } - export type EditorFindOptions = Readonly>; - export type GoToLocationValues = 'peek' | 'gotoAndPeek' | 'goto'; /** @@ -3483,8 +3479,6 @@ declare namespace monaco.editor { alternativeReferenceCommand?: string; } - export type GoToLocationOptions = Readonly>; - /** * Configuration options for editor hover */ @@ -3506,8 +3500,6 @@ declare namespace monaco.editor { sticky?: boolean; } - export type EditorHoverOptions = Readonly>; - /** * A description for the overview ruler position. */ @@ -3633,8 +3625,6 @@ declare namespace monaco.editor { enabled?: boolean; } - export type EditorLightbulbOptions = Readonly>; - /** * Configuration options for editor inlayHints */ @@ -3656,8 +3646,6 @@ declare namespace monaco.editor { fontFamily?: string; } - export type EditorInlayHintsOptions = Readonly>; - /** * Configuration options for editor minimap */ @@ -3698,8 +3686,6 @@ declare namespace monaco.editor { scale?: number; } - export type EditorMinimapOptions = Readonly>; - /** * Configuration options for editor padding */ @@ -3714,11 +3700,6 @@ declare namespace monaco.editor { bottom?: number; } - export interface InternalEditorPaddingOptions { - readonly top: number; - readonly bottom: number; - } - /** * Configuration options for parameter hints */ @@ -3735,8 +3716,6 @@ declare namespace monaco.editor { cycle?: boolean; } - export type InternalParameterHintOptions = Readonly>; - /** * Configuration options for quick suggestions */ @@ -3746,8 +3725,6 @@ declare namespace monaco.editor { strings?: boolean; } - export type ValidQuickSuggestionsOptions = boolean | Readonly>; - export type LineNumbersType = 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string); export enum RenderLineNumbersType { @@ -3877,8 +3854,6 @@ declare namespace monaco.editor { mode?: 'prefix' | 'subword' | 'subwordSmart'; } - export type InternalInlineSuggestOptions = Readonly>; - export interface IBracketPairColorizationOptions { /** * Enable or disable bracket pair colorization. @@ -3886,8 +3861,6 @@ declare namespace monaco.editor { enabled?: boolean; } - export type InternalBracketPairColorizationOptions = Readonly>; - export interface IGuidesOptions { /** * Enable rendering of bracket pair guides. @@ -3905,8 +3878,6 @@ declare namespace monaco.editor { highlightActiveIndentation?: boolean; } - export type InternalGuidesOptions = Readonly>; - /** * Configuration options for editor suggest widget */ @@ -4065,14 +4036,10 @@ declare namespace monaco.editor { showSnippets?: boolean; } - export type InternalSuggestOptions = Readonly>; - export interface ISmartSelectOptions { selectLeadingAndTrailingWhitespace?: boolean; } - export type SmartSelectOptions = Readonly>; - /** * Describes how to indent wrapped lines. */ @@ -4235,6 +4202,7 @@ declare namespace monaco.editor { layoutInfo = 129, wrappingInfo = 130 } + export const EditorOptions: { acceptSuggestionOnCommitCharacter: IEditorOption; acceptSuggestionOnEnter: IEditorOption; @@ -4310,11 +4278,11 @@ declare namespace monaco.editor { occurrencesHighlight: IEditorOption; overviewRulerBorder: IEditorOption; overviewRulerLanes: IEditorOption; - padding: IEditorOption; + padding: IEditorOption>>; parameterHints: IEditorOption>>; peekWidgetDefaultFocus: IEditorOption; definitionLinkOpensInPeek: IEditorOption; - quickSuggestions: IEditorOption; + quickSuggestions: IEditorOption; quickSuggestionsDelay: IEditorOption; readOnly: IEditorOption; renameOnType: IEditorOption;