diff --git a/build/build.js b/build/build.js index efed0141..f4b71e06 100644 --- a/build/build.js +++ b/build/build.js @@ -17,22 +17,22 @@ tsc(`src/tsconfig.json`); dts( `out/amd/language/css/monaco.contribution.d.ts`, - `out/release/language/css/monaco.d.ts`, + `out/release/css.d.ts`, 'monaco.languages.css' ); dts( `out/amd/language/html/monaco.contribution.d.ts`, - `out/release/language/html/monaco.d.ts`, + `out/release/html.d.ts`, 'monaco.languages.html' ); dts( `out/amd/language/json/monaco.contribution.d.ts`, - `out/release/language/json/monaco.d.ts`, + `out/release/json.d.ts`, 'monaco.languages.json' ); dts( `out/amd/language/typescript/monaco.contribution.d.ts`, - `out/release/language/typescript/monaco.d.ts`, + `out/release/typescript.d.ts`, 'monaco.languages.typescript' ); diff --git a/build/release.js b/build/release.js index 98941989..2c3b0fdf 100644 --- a/build/release.js +++ b/build/release.js @@ -5,12 +5,6 @@ //@ts-check -/** - * @typedef { { src:string; built:string; releaseDev:string; releaseMin:string; } } ICorePaths - * @typedef { { dev:string; min:string; esm: string; } } IPluginPaths - * @typedef { { name:string; contrib:string; modulePrefix:string; rootPath:string; paths:IPluginPaths } } IPlugin - * @typedef { { METADATA: {CORE:{paths:ICorePaths}; PLUGINS:IPlugin[];} } } IMetadata - */ /** @typedef {import('../build/utils').IFile} IFile */ const path = require('path'); @@ -18,8 +12,6 @@ const fs = require('fs'); const { REPO_ROOT, readFiles, writeFiles } = require('../build/utils'); const { removeDir } = require('../build/fs'); const ts = require('typescript'); -/**@type { IMetadata } */ -const metadata = require('../metadata.js'); const { generateMetadata } = require('./releaseMetadata'); removeDir(`release`); @@ -85,24 +77,11 @@ function AMD_releaseOne(type) { AMD_addPluginContribs(type, coreFiles); writeFiles(coreFiles, `release/${type}`); - for (const plugin of metadata.METADATA.PLUGINS) { - AMD_releasePlugin(plugin, type, `release/${type}`); - } -} - -/** - * Release a plugin to `dev` or `min`. - * @param {IPlugin} plugin - * @param {'dev'|'min'} type - * @param {string} destinationPath - */ -function AMD_releasePlugin(plugin, type, destinationPath) { - const pluginPath = path.join(plugin.rootPath, plugin.paths[type]); // dev or min - const contribPath = - path.join(pluginPath, plugin.contrib.substring(plugin.modulePrefix.length)) + '.js'; - - const files = readFiles(`${pluginPath}/**/*`, { base: pluginPath, ignore: [contribPath] }); - writeFiles(files, path.join(destinationPath, plugin.modulePrefix)); + const pluginFiles = readFiles(`out/release/${type}/**/*`, { + base: `out/release/${type}`, + ignore: ['**/monaco.contribution.js'] + }); + writeFiles(pluginFiles, `release/${type}`); } /** @@ -125,25 +104,21 @@ function AMD_addPluginContribs(type, files) { // Rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main' contents = contents.replace(/"vs\/editor\/editor\.main\"/, '"vs/editor/edcore.main"'); - /** @type {string[]} */ - let extraContent = []; - /** @type {string[]} */ - let allPluginsModuleIds = []; + const pluginFiles = readFiles(`out/release/${type}/**/monaco.contribution.js`, { + base: `out/release/${type}` + }); - metadata.METADATA.PLUGINS.forEach(function (plugin) { - allPluginsModuleIds.push(plugin.contrib); - const pluginPath = path.join(plugin.rootPath, plugin.paths[type]); // dev or min - const contribPath = - path.join(REPO_ROOT, pluginPath, plugin.contrib.substring(plugin.modulePrefix.length)) + - '.js'; - let contribContents = fs.readFileSync(contribPath).toString(); + const extraContent = pluginFiles.map((file) => { + return file.contents + .toString() + .replace( + /define\((['"][a-z\/\-]+\/fillers\/monaco-editor-core['"]),\[\],/, + "define($1,['vs/editor/editor.api']," + ); + }); - contribContents = contribContents.replace( - /define\((['"][a-z\/\-]+\/fillers\/monaco-editor-core['"]),\[\],/, - "define($1,['vs/editor/editor.api']," - ); - - extraContent.push(contribContents); + const allPluginsModuleIds = pluginFiles.map((file) => { + return file.path.replace(/\.js$/, ''); }); extraContent.push( @@ -176,22 +151,16 @@ function ESM_release() { ESM_addPluginContribs(coreFiles); writeFiles(coreFiles, `release/esm`); - for (const plugin of metadata.METADATA.PLUGINS) { - ESM_releasePlugin(plugin, `release/esm`); - } + ESM_releasePlugins(); } /** * Release a plugin to `esm`. * Adds a dependency to 'vs/editor/editor.api' in contrib files in order for `monaco` to be defined. * Rewrites imports for 'monaco-editor-core/**' - * @param {IPlugin} plugin - * @param {string} destinationPath */ -function ESM_releasePlugin(plugin, destinationPath) { - const pluginPath = path.join(plugin.rootPath, plugin.paths['esm']); - - const files = readFiles(`${pluginPath}/**/*`, { base: pluginPath }); +function ESM_releasePlugins() { + const files = readFiles(`out/release/esm/**/*`, { base: 'out/release/esm/' }); for (const file of files) { if (!/(\.js$)|(\.ts$)/.test(file.path)) { @@ -217,10 +186,9 @@ function ESM_releasePlugin(plugin, destinationPath) { importText = 'monaco-editor-core/esm/vs/editor/editor.api'; } - const myFileDestPath = path.join(plugin.modulePrefix, file.path); const importFilePath = importText.substring('monaco-editor-core/esm/'.length); let relativePath = path - .relative(path.dirname(myFileDestPath), importFilePath) + .relative(path.dirname(file.path), importFilePath) .replace(/\\/g, '/'); if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { relativePath = './' + relativePath; @@ -238,9 +206,8 @@ function ESM_releasePlugin(plugin, destinationPath) { continue; } - const myFileDestPath = path.join(plugin.modulePrefix, file.path); const apiFilePath = 'vs/editor/editor.api'; - let relativePath = path.relative(path.dirname(myFileDestPath), apiFilePath).replace(/\\/g, '/'); + let relativePath = path.relative(path.dirname(file.path), apiFilePath).replace(/\\/g, '/'); if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { relativePath = './' + relativePath; } @@ -251,7 +218,7 @@ function ESM_releasePlugin(plugin, destinationPath) { } ESM_addImportSuffix(files); - writeFiles(files, path.join(destinationPath, plugin.modulePrefix)); + writeFiles(files, `release/esm`); } /** @@ -299,20 +266,20 @@ function ESM_addPluginContribs(files) { const mainFileDestPath = 'vs/editor/editor.main.js'; - /** @type {string[]} */ - let mainFileImports = []; - for (const plugin of metadata.METADATA.PLUGINS) { - const contribDestPath = plugin.contrib; - + const mainFileImports = readFiles(`out/release/esm/**/monaco.contribution.js`, { + base: `out/release/esm` + }).map((file) => { let relativePath = path - .relative(path.dirname(mainFileDestPath), contribDestPath) - .replace(/\\/g, '/'); + .relative(path.dirname(mainFileDestPath), file.path) + .replace(/\\/g, '/') + .replace(/\.js$/, ''); + if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { relativePath = './' + relativePath; } - mainFileImports.push(relativePath); - } + return relativePath; + }); const mainFileContents = mainFileImports.map((name) => `import '${name}';`).join('\n') + @@ -335,17 +302,10 @@ function releaseDTS() { let contents = monacodts.contents.toString(); - /** @type {string[]} */ - const extraContent = []; - metadata.METADATA.PLUGINS.forEach(function (plugin) { - const dtsPath = path.join(plugin.rootPath, './monaco.d.ts'); - try { - let plugindts = fs.readFileSync(dtsPath).toString(); - plugindts = plugindts.replace(/\/\/\/ { + return file.contents.toString().replace(/\/\/\/ ; + readonly modeConfiguration: ModeConfiguration; + readonly options: Options; + setOptions(options: Options): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; + /** @deprecated Use options instead */ + readonly diagnosticsOptions: DiagnosticsOptions; + /** @deprecated Use setOptions instead */ + setDiagnosticsOptions(options: DiagnosticsOptions): void; + } + /** @deprecated Use Options instead */ + export type DiagnosticsOptions = Options; + export const cssDefaults: LanguageServiceDefaults; + export const scssDefaults: LanguageServiceDefaults; + export const lessDefaults: LanguageServiceDefaults; + export interface CSSDataConfiguration { + /** + * Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown. + */ + useDefaultDataProvider?: boolean; + /** + * Provides a set of custom data providers. + */ + dataProviders?: { + [providerId: string]: CSSDataV1; + }; + } + /** + * Custom CSS properties, at-directives, pseudoClasses and pseudoElements + * https://github.com/microsoft/vscode-css-languageservice/blob/main/docs/customData.md + */ + export interface CSSDataV1 { + version: 1 | 1.1; + properties?: IPropertyData[]; + atDirectives?: IAtDirectiveData[]; + pseudoClasses?: IPseudoClassData[]; + pseudoElements?: IPseudoElementData[]; + } + export type EntryStatus = 'standard' | 'experimental' | 'nonstandard' | 'obsolete'; + export interface IReference { + name: string; + url: string; + } + export interface IPropertyData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + restrictions?: string[]; + status?: EntryStatus; + syntax?: string; + values?: IValueData[]; + references?: IReference[]; + relevance?: number; + } + export interface IAtDirectiveData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface IPseudoClassData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface IPseudoElementData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface IValueData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface MarkupContent { + kind: MarkupKind; + value: string; + } + export type MarkupKind = 'plaintext' | 'markdown'; +} + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare namespace monaco.languages.html { + export interface HTMLFormatConfiguration { + readonly tabSize: number; + readonly insertSpaces: boolean; + readonly wrapLineLength: number; + readonly unformatted: string; + readonly contentUnformatted: string; + readonly indentInnerHtml: boolean; + readonly preserveNewLines: boolean; + readonly maxPreserveNewLines: number | undefined; + readonly indentHandlebars: boolean; + readonly endWithNewline: boolean; + readonly extraLiners: string; + readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline'; + } + export interface CompletionConfiguration { + readonly [providerId: string]: boolean; + } + export interface Options { + /** + * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. + */ + readonly format?: HTMLFormatConfiguration; + /** + * A list of known schemas and/or associations of schemas to file names. + */ + readonly suggest?: CompletionConfiguration; + /** + * Configures the HTML data types known by the HTML langauge service. + */ + readonly data?: HTMLDataConfiguration; + } + export interface ModeConfiguration { + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + /** + * Defines whether the built-in definitions provider is enabled. + */ + readonly links?: boolean; + /** + * Defines whether the built-in references provider is enabled. + */ + readonly documentHighlights?: boolean; + /** + * Defines whether the built-in rename provider is enabled. + */ + readonly rename?: boolean; + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + /** + * Defines whether the built-in documentFormattingEdit provider is enabled. + */ + readonly documentFormattingEdits?: boolean; + /** + * Defines whether the built-in documentRangeFormattingEdit provider is enabled. + */ + readonly documentRangeFormattingEdits?: boolean; + } + export interface LanguageServiceDefaults { + readonly languageId: string; + readonly modeConfiguration: ModeConfiguration; + readonly onDidChange: IEvent; + readonly options: Options; + setOptions(options: Options): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; + } + export const htmlLanguageService: LanguageServiceRegistration; + export const htmlDefaults: LanguageServiceDefaults; + export const handlebarLanguageService: LanguageServiceRegistration; + export const handlebarDefaults: LanguageServiceDefaults; + export const razorLanguageService: LanguageServiceRegistration; + export const razorDefaults: LanguageServiceDefaults; + export interface LanguageServiceRegistration extends IDisposable { + readonly defaults: LanguageServiceDefaults; + } + /** + * Registers a new HTML language service for the languageId. + * Note: 'html', 'handlebar' and 'razor' are registered by default. + * + * Use this method to register additional language ids with a HTML service. + * The language server has to be registered before an editor model is opened. + */ + export function registerHTMLLanguageService(languageId: string, options?: Options, modeConfiguration?: ModeConfiguration): LanguageServiceRegistration; + export interface HTMLDataConfiguration { + /** + * Defines whether the standard HTML tags and attributes are shown + */ + readonly useDefaultDataProvider?: boolean; + /** + * Provides a set of custom data providers. + */ + readonly dataProviders?: { + [providerId: string]: HTMLDataV1; + }; + } + /** + * Custom HTML tags attributes and attribute values + * https://github.com/microsoft/vscode-html-languageservice/blob/main/docs/customData.md + */ + export interface HTMLDataV1 { + readonly version: 1 | 1.1; + readonly tags?: ITagData[]; + readonly globalAttributes?: IAttributeData[]; + readonly valueSets?: IValueSet[]; + } + export interface IReference { + readonly name: string; + readonly url: string; + } + export interface ITagData { + readonly name: string; + readonly description?: string | MarkupContent; + readonly attributes: IAttributeData[]; + readonly references?: IReference[]; + } + export interface IAttributeData { + readonly name: string; + readonly description?: string | MarkupContent; + readonly valueSet?: string; + readonly values?: IValueData[]; + readonly references?: IReference[]; + } + export interface IValueData { + readonly name: string; + readonly description?: string | MarkupContent; + readonly references?: IReference[]; + } + export interface IValueSet { + readonly name: string; + readonly values: IValueData[]; + } + export interface MarkupContent { + readonly kind: MarkupKind; + readonly value: string; + } + export type MarkupKind = 'plaintext' | 'markdown'; +} + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare namespace monaco.languages.json { + export interface DiagnosticsOptions { + /** + * If set, the validator will be enabled and perform syntax and schema based validation, + * unless `DiagnosticsOptions.schemaValidation` is set to `ignore`. + */ + readonly validate?: boolean; + /** + * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. + * `DiagnosticsOptions.allowComments` will override this setting. + */ + readonly allowComments?: boolean; + /** + * A list of known schemas and/or associations of schemas to file names. + */ + readonly schemas?: { + /** + * The URI of the schema, which is also the identifier of the schema. + */ + readonly uri: string; + /** + * A list of glob patterns that describe for which file URIs the JSON schema will be used. + * '*' and '**' wildcards are supported. Exclusion patterns start with '!'. + * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'. + * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'. + */ + readonly fileMatch?: string[]; + /** + * The schema for the given URI. + */ + readonly schema?: any; + }[]; + /** + * If set, the schema service would load schema content on-demand with 'fetch' if available + */ + readonly enableSchemaRequest?: boolean; + /** + * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used. + */ + readonly schemaValidation?: SeverityLevel; + /** + * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used. + */ + readonly schemaRequest?: SeverityLevel; + /** + * The severity of reported trailing commas. If not set, trailing commas will be reported as errors. + */ + readonly trailingCommas?: SeverityLevel; + /** + * The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors. + */ + readonly comments?: SeverityLevel; + } + export type SeverityLevel = 'error' | 'warning' | 'ignore'; + export interface ModeConfiguration { + /** + * Defines whether the built-in documentFormattingEdit provider is enabled. + */ + readonly documentFormattingEdits?: boolean; + /** + * Defines whether the built-in documentRangeFormattingEdit provider is enabled. + */ + readonly documentRangeFormattingEdits?: boolean; + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + /** + * Defines whether the built-in tokens provider is enabled. + */ + readonly tokens?: boolean; + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + } + export interface LanguageServiceDefaults { + readonly languageId: string; + readonly onDidChange: IEvent; + readonly diagnosticsOptions: DiagnosticsOptions; + readonly modeConfiguration: ModeConfiguration; + setDiagnosticsOptions(options: DiagnosticsOptions): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; + } + export const jsonDefaults: LanguageServiceDefaults; +} + /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -7520,452 +7969,3 @@ declare namespace monaco.languages.typescript { export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; } - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare namespace monaco.languages.css { - export interface Options { - readonly validate?: boolean; - readonly lint?: { - readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error'; - readonly vendorPrefix?: 'ignore' | 'warning' | 'error'; - readonly duplicateProperties?: 'ignore' | 'warning' | 'error'; - readonly emptyRules?: 'ignore' | 'warning' | 'error'; - readonly importStatement?: 'ignore' | 'warning' | 'error'; - readonly boxModel?: 'ignore' | 'warning' | 'error'; - readonly universalSelector?: 'ignore' | 'warning' | 'error'; - readonly zeroUnits?: 'ignore' | 'warning' | 'error'; - readonly fontFaceProperties?: 'ignore' | 'warning' | 'error'; - readonly hexColorLength?: 'ignore' | 'warning' | 'error'; - readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error'; - readonly unknownProperties?: 'ignore' | 'warning' | 'error'; - readonly ieHack?: 'ignore' | 'warning' | 'error'; - readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error'; - readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error'; - readonly important?: 'ignore' | 'warning' | 'error'; - readonly float?: 'ignore' | 'warning' | 'error'; - readonly idSelector?: 'ignore' | 'warning' | 'error'; - }; - /** - * Configures the CSS data types known by the langauge service. - */ - readonly data?: CSSDataConfiguration; - } - export interface ModeConfiguration { - /** - * Defines whether the built-in completionItemProvider is enabled. - */ - readonly completionItems?: boolean; - /** - * Defines whether the built-in hoverProvider is enabled. - */ - readonly hovers?: boolean; - /** - * Defines whether the built-in documentSymbolProvider is enabled. - */ - readonly documentSymbols?: boolean; - /** - * Defines whether the built-in definitions provider is enabled. - */ - readonly definitions?: boolean; - /** - * Defines whether the built-in references provider is enabled. - */ - readonly references?: boolean; - /** - * Defines whether the built-in references provider is enabled. - */ - readonly documentHighlights?: boolean; - /** - * Defines whether the built-in rename provider is enabled. - */ - readonly rename?: boolean; - /** - * Defines whether the built-in color provider is enabled. - */ - readonly colors?: boolean; - /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; - /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; - /** - * Defines whether the built-in selection range provider is enabled. - */ - readonly selectionRanges?: boolean; - } - export interface LanguageServiceDefaults { - readonly languageId: string; - readonly onDidChange: IEvent; - readonly modeConfiguration: ModeConfiguration; - readonly options: Options; - setOptions(options: Options): void; - setModeConfiguration(modeConfiguration: ModeConfiguration): void; - /** @deprecated Use options instead */ - readonly diagnosticsOptions: DiagnosticsOptions; - /** @deprecated Use setOptions instead */ - setDiagnosticsOptions(options: DiagnosticsOptions): void; - } - /** @deprecated Use Options instead */ - export type DiagnosticsOptions = Options; - export const cssDefaults: LanguageServiceDefaults; - export const scssDefaults: LanguageServiceDefaults; - export const lessDefaults: LanguageServiceDefaults; - export interface CSSDataConfiguration { - /** - * Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown. - */ - useDefaultDataProvider?: boolean; - /** - * Provides a set of custom data providers. - */ - dataProviders?: { - [providerId: string]: CSSDataV1; - }; - } - /** - * Custom CSS properties, at-directives, pseudoClasses and pseudoElements - * https://github.com/microsoft/vscode-css-languageservice/blob/main/docs/customData.md - */ - export interface CSSDataV1 { - version: 1 | 1.1; - properties?: IPropertyData[]; - atDirectives?: IAtDirectiveData[]; - pseudoClasses?: IPseudoClassData[]; - pseudoElements?: IPseudoElementData[]; - } - export type EntryStatus = 'standard' | 'experimental' | 'nonstandard' | 'obsolete'; - export interface IReference { - name: string; - url: string; - } - export interface IPropertyData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - restrictions?: string[]; - status?: EntryStatus; - syntax?: string; - values?: IValueData[]; - references?: IReference[]; - relevance?: number; - } - export interface IAtDirectiveData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface IPseudoClassData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface IPseudoElementData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface IValueData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface MarkupContent { - kind: MarkupKind; - value: string; - } - export type MarkupKind = 'plaintext' | 'markdown'; -} - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare namespace monaco.languages.json { - export interface DiagnosticsOptions { - /** - * If set, the validator will be enabled and perform syntax and schema based validation, - * unless `DiagnosticsOptions.schemaValidation` is set to `ignore`. - */ - readonly validate?: boolean; - /** - * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. - * `DiagnosticsOptions.allowComments` will override this setting. - */ - readonly allowComments?: boolean; - /** - * A list of known schemas and/or associations of schemas to file names. - */ - readonly schemas?: { - /** - * The URI of the schema, which is also the identifier of the schema. - */ - readonly uri: string; - /** - * A list of glob patterns that describe for which file URIs the JSON schema will be used. - * '*' and '**' wildcards are supported. Exclusion patterns start with '!'. - * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'. - * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'. - */ - readonly fileMatch?: string[]; - /** - * The schema for the given URI. - */ - readonly schema?: any; - }[]; - /** - * If set, the schema service would load schema content on-demand with 'fetch' if available - */ - readonly enableSchemaRequest?: boolean; - /** - * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used. - */ - readonly schemaValidation?: SeverityLevel; - /** - * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used. - */ - readonly schemaRequest?: SeverityLevel; - /** - * The severity of reported trailing commas. If not set, trailing commas will be reported as errors. - */ - readonly trailingCommas?: SeverityLevel; - /** - * The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors. - */ - readonly comments?: SeverityLevel; - } - export type SeverityLevel = 'error' | 'warning' | 'ignore'; - export interface ModeConfiguration { - /** - * Defines whether the built-in documentFormattingEdit provider is enabled. - */ - readonly documentFormattingEdits?: boolean; - /** - * Defines whether the built-in documentRangeFormattingEdit provider is enabled. - */ - readonly documentRangeFormattingEdits?: boolean; - /** - * Defines whether the built-in completionItemProvider is enabled. - */ - readonly completionItems?: boolean; - /** - * Defines whether the built-in hoverProvider is enabled. - */ - readonly hovers?: boolean; - /** - * Defines whether the built-in documentSymbolProvider is enabled. - */ - readonly documentSymbols?: boolean; - /** - * Defines whether the built-in tokens provider is enabled. - */ - readonly tokens?: boolean; - /** - * Defines whether the built-in color provider is enabled. - */ - readonly colors?: boolean; - /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; - /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; - /** - * Defines whether the built-in selection range provider is enabled. - */ - readonly selectionRanges?: boolean; - } - export interface LanguageServiceDefaults { - readonly languageId: string; - readonly onDidChange: IEvent; - readonly diagnosticsOptions: DiagnosticsOptions; - readonly modeConfiguration: ModeConfiguration; - setDiagnosticsOptions(options: DiagnosticsOptions): void; - setModeConfiguration(modeConfiguration: ModeConfiguration): void; - } - export const jsonDefaults: LanguageServiceDefaults; -} - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare namespace monaco.languages.html { - export interface HTMLFormatConfiguration { - readonly tabSize: number; - readonly insertSpaces: boolean; - readonly wrapLineLength: number; - readonly unformatted: string; - readonly contentUnformatted: string; - readonly indentInnerHtml: boolean; - readonly preserveNewLines: boolean; - readonly maxPreserveNewLines: number | undefined; - readonly indentHandlebars: boolean; - readonly endWithNewline: boolean; - readonly extraLiners: string; - readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline'; - } - export interface CompletionConfiguration { - readonly [providerId: string]: boolean; - } - export interface Options { - /** - * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. - */ - readonly format?: HTMLFormatConfiguration; - /** - * A list of known schemas and/or associations of schemas to file names. - */ - readonly suggest?: CompletionConfiguration; - /** - * Configures the HTML data types known by the HTML langauge service. - */ - readonly data?: HTMLDataConfiguration; - } - export interface ModeConfiguration { - /** - * Defines whether the built-in completionItemProvider is enabled. - */ - readonly completionItems?: boolean; - /** - * Defines whether the built-in hoverProvider is enabled. - */ - readonly hovers?: boolean; - /** - * Defines whether the built-in documentSymbolProvider is enabled. - */ - readonly documentSymbols?: boolean; - /** - * Defines whether the built-in definitions provider is enabled. - */ - readonly links?: boolean; - /** - * Defines whether the built-in references provider is enabled. - */ - readonly documentHighlights?: boolean; - /** - * Defines whether the built-in rename provider is enabled. - */ - readonly rename?: boolean; - /** - * Defines whether the built-in color provider is enabled. - */ - readonly colors?: boolean; - /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; - /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; - /** - * Defines whether the built-in selection range provider is enabled. - */ - readonly selectionRanges?: boolean; - /** - * Defines whether the built-in documentFormattingEdit provider is enabled. - */ - readonly documentFormattingEdits?: boolean; - /** - * Defines whether the built-in documentRangeFormattingEdit provider is enabled. - */ - readonly documentRangeFormattingEdits?: boolean; - } - export interface LanguageServiceDefaults { - readonly languageId: string; - readonly modeConfiguration: ModeConfiguration; - readonly onDidChange: IEvent; - readonly options: Options; - setOptions(options: Options): void; - setModeConfiguration(modeConfiguration: ModeConfiguration): void; - } - export const htmlLanguageService: LanguageServiceRegistration; - export const htmlDefaults: LanguageServiceDefaults; - export const handlebarLanguageService: LanguageServiceRegistration; - export const handlebarDefaults: LanguageServiceDefaults; - export const razorLanguageService: LanguageServiceRegistration; - export const razorDefaults: LanguageServiceDefaults; - export interface LanguageServiceRegistration extends IDisposable { - readonly defaults: LanguageServiceDefaults; - } - /** - * Registers a new HTML language service for the languageId. - * Note: 'html', 'handlebar' and 'razor' are registered by default. - * - * Use this method to register additional language ids with a HTML service. - * The language server has to be registered before an editor model is opened. - */ - export function registerHTMLLanguageService(languageId: string, options?: Options, modeConfiguration?: ModeConfiguration): LanguageServiceRegistration; - export interface HTMLDataConfiguration { - /** - * Defines whether the standard HTML tags and attributes are shown - */ - readonly useDefaultDataProvider?: boolean; - /** - * Provides a set of custom data providers. - */ - readonly dataProviders?: { - [providerId: string]: HTMLDataV1; - }; - } - /** - * Custom HTML tags attributes and attribute values - * https://github.com/microsoft/vscode-html-languageservice/blob/main/docs/customData.md - */ - export interface HTMLDataV1 { - readonly version: 1 | 1.1; - readonly tags?: ITagData[]; - readonly globalAttributes?: IAttributeData[]; - readonly valueSets?: IValueSet[]; - } - export interface IReference { - readonly name: string; - readonly url: string; - } - export interface ITagData { - readonly name: string; - readonly description?: string | MarkupContent; - readonly attributes: IAttributeData[]; - readonly references?: IReference[]; - } - export interface IAttributeData { - readonly name: string; - readonly description?: string | MarkupContent; - readonly valueSet?: string; - readonly values?: IValueData[]; - readonly references?: IReference[]; - } - export interface IValueData { - readonly name: string; - readonly description?: string | MarkupContent; - readonly references?: IReference[]; - } - export interface IValueSet { - readonly name: string; - readonly values: IValueData[]; - } - export interface MarkupContent { - readonly kind: MarkupKind; - readonly value: string; - } - export type MarkupKind = 'plaintext' | 'markdown'; -} diff --git a/website/typedoc/monaco.d.ts b/website/typedoc/monaco.d.ts index d2c4c98b..830e8843 100644 --- a/website/typedoc/monaco.d.ts +++ b/website/typedoc/monaco.d.ts @@ -7128,6 +7128,455 @@ declare namespace monaco.worker { //dtsv=3 +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare namespace monaco.languages.css { + export interface Options { + readonly validate?: boolean; + readonly lint?: { + readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error'; + readonly vendorPrefix?: 'ignore' | 'warning' | 'error'; + readonly duplicateProperties?: 'ignore' | 'warning' | 'error'; + readonly emptyRules?: 'ignore' | 'warning' | 'error'; + readonly importStatement?: 'ignore' | 'warning' | 'error'; + readonly boxModel?: 'ignore' | 'warning' | 'error'; + readonly universalSelector?: 'ignore' | 'warning' | 'error'; + readonly zeroUnits?: 'ignore' | 'warning' | 'error'; + readonly fontFaceProperties?: 'ignore' | 'warning' | 'error'; + readonly hexColorLength?: 'ignore' | 'warning' | 'error'; + readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error'; + readonly unknownProperties?: 'ignore' | 'warning' | 'error'; + readonly ieHack?: 'ignore' | 'warning' | 'error'; + readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error'; + readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error'; + readonly important?: 'ignore' | 'warning' | 'error'; + readonly float?: 'ignore' | 'warning' | 'error'; + readonly idSelector?: 'ignore' | 'warning' | 'error'; + }; + /** + * Configures the CSS data types known by the langauge service. + */ + readonly data?: CSSDataConfiguration; + } + export interface ModeConfiguration { + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + /** + * Defines whether the built-in definitions provider is enabled. + */ + readonly definitions?: boolean; + /** + * Defines whether the built-in references provider is enabled. + */ + readonly references?: boolean; + /** + * Defines whether the built-in references provider is enabled. + */ + readonly documentHighlights?: boolean; + /** + * Defines whether the built-in rename provider is enabled. + */ + readonly rename?: boolean; + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + } + export interface LanguageServiceDefaults { + readonly languageId: string; + readonly onDidChange: IEvent; + readonly modeConfiguration: ModeConfiguration; + readonly options: Options; + setOptions(options: Options): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; + /** @deprecated Use options instead */ + readonly diagnosticsOptions: DiagnosticsOptions; + /** @deprecated Use setOptions instead */ + setDiagnosticsOptions(options: DiagnosticsOptions): void; + } + /** @deprecated Use Options instead */ + export type DiagnosticsOptions = Options; + export const cssDefaults: LanguageServiceDefaults; + export const scssDefaults: LanguageServiceDefaults; + export const lessDefaults: LanguageServiceDefaults; + export interface CSSDataConfiguration { + /** + * Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown. + */ + useDefaultDataProvider?: boolean; + /** + * Provides a set of custom data providers. + */ + dataProviders?: { + [providerId: string]: CSSDataV1; + }; + } + /** + * Custom CSS properties, at-directives, pseudoClasses and pseudoElements + * https://github.com/microsoft/vscode-css-languageservice/blob/main/docs/customData.md + */ + export interface CSSDataV1 { + version: 1 | 1.1; + properties?: IPropertyData[]; + atDirectives?: IAtDirectiveData[]; + pseudoClasses?: IPseudoClassData[]; + pseudoElements?: IPseudoElementData[]; + } + export type EntryStatus = 'standard' | 'experimental' | 'nonstandard' | 'obsolete'; + export interface IReference { + name: string; + url: string; + } + export interface IPropertyData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + restrictions?: string[]; + status?: EntryStatus; + syntax?: string; + values?: IValueData[]; + references?: IReference[]; + relevance?: number; + } + export interface IAtDirectiveData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface IPseudoClassData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface IPseudoElementData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface IValueData { + name: string; + description?: string | MarkupContent; + browsers?: string[]; + status?: EntryStatus; + references?: IReference[]; + } + export interface MarkupContent { + kind: MarkupKind; + value: string; + } + export type MarkupKind = 'plaintext' | 'markdown'; +} + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare namespace monaco.languages.html { + export interface HTMLFormatConfiguration { + readonly tabSize: number; + readonly insertSpaces: boolean; + readonly wrapLineLength: number; + readonly unformatted: string; + readonly contentUnformatted: string; + readonly indentInnerHtml: boolean; + readonly preserveNewLines: boolean; + readonly maxPreserveNewLines: number | undefined; + readonly indentHandlebars: boolean; + readonly endWithNewline: boolean; + readonly extraLiners: string; + readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline'; + } + export interface CompletionConfiguration { + readonly [providerId: string]: boolean; + } + export interface Options { + /** + * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. + */ + readonly format?: HTMLFormatConfiguration; + /** + * A list of known schemas and/or associations of schemas to file names. + */ + readonly suggest?: CompletionConfiguration; + /** + * Configures the HTML data types known by the HTML langauge service. + */ + readonly data?: HTMLDataConfiguration; + } + export interface ModeConfiguration { + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + /** + * Defines whether the built-in definitions provider is enabled. + */ + readonly links?: boolean; + /** + * Defines whether the built-in references provider is enabled. + */ + readonly documentHighlights?: boolean; + /** + * Defines whether the built-in rename provider is enabled. + */ + readonly rename?: boolean; + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + /** + * Defines whether the built-in documentFormattingEdit provider is enabled. + */ + readonly documentFormattingEdits?: boolean; + /** + * Defines whether the built-in documentRangeFormattingEdit provider is enabled. + */ + readonly documentRangeFormattingEdits?: boolean; + } + export interface LanguageServiceDefaults { + readonly languageId: string; + readonly modeConfiguration: ModeConfiguration; + readonly onDidChange: IEvent; + readonly options: Options; + setOptions(options: Options): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; + } + export const htmlLanguageService: LanguageServiceRegistration; + export const htmlDefaults: LanguageServiceDefaults; + export const handlebarLanguageService: LanguageServiceRegistration; + export const handlebarDefaults: LanguageServiceDefaults; + export const razorLanguageService: LanguageServiceRegistration; + export const razorDefaults: LanguageServiceDefaults; + export interface LanguageServiceRegistration extends IDisposable { + readonly defaults: LanguageServiceDefaults; + } + /** + * Registers a new HTML language service for the languageId. + * Note: 'html', 'handlebar' and 'razor' are registered by default. + * + * Use this method to register additional language ids with a HTML service. + * The language server has to be registered before an editor model is opened. + */ + export function registerHTMLLanguageService(languageId: string, options?: Options, modeConfiguration?: ModeConfiguration): LanguageServiceRegistration; + export interface HTMLDataConfiguration { + /** + * Defines whether the standard HTML tags and attributes are shown + */ + readonly useDefaultDataProvider?: boolean; + /** + * Provides a set of custom data providers. + */ + readonly dataProviders?: { + [providerId: string]: HTMLDataV1; + }; + } + /** + * Custom HTML tags attributes and attribute values + * https://github.com/microsoft/vscode-html-languageservice/blob/main/docs/customData.md + */ + export interface HTMLDataV1 { + readonly version: 1 | 1.1; + readonly tags?: ITagData[]; + readonly globalAttributes?: IAttributeData[]; + readonly valueSets?: IValueSet[]; + } + export interface IReference { + readonly name: string; + readonly url: string; + } + export interface ITagData { + readonly name: string; + readonly description?: string | MarkupContent; + readonly attributes: IAttributeData[]; + readonly references?: IReference[]; + } + export interface IAttributeData { + readonly name: string; + readonly description?: string | MarkupContent; + readonly valueSet?: string; + readonly values?: IValueData[]; + readonly references?: IReference[]; + } + export interface IValueData { + readonly name: string; + readonly description?: string | MarkupContent; + readonly references?: IReference[]; + } + export interface IValueSet { + readonly name: string; + readonly values: IValueData[]; + } + export interface MarkupContent { + readonly kind: MarkupKind; + readonly value: string; + } + export type MarkupKind = 'plaintext' | 'markdown'; +} + +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare namespace monaco.languages.json { + export interface DiagnosticsOptions { + /** + * If set, the validator will be enabled and perform syntax and schema based validation, + * unless `DiagnosticsOptions.schemaValidation` is set to `ignore`. + */ + readonly validate?: boolean; + /** + * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. + * `DiagnosticsOptions.allowComments` will override this setting. + */ + readonly allowComments?: boolean; + /** + * A list of known schemas and/or associations of schemas to file names. + */ + readonly schemas?: { + /** + * The URI of the schema, which is also the identifier of the schema. + */ + readonly uri: string; + /** + * A list of glob patterns that describe for which file URIs the JSON schema will be used. + * '*' and '**' wildcards are supported. Exclusion patterns start with '!'. + * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'. + * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'. + */ + readonly fileMatch?: string[]; + /** + * The schema for the given URI. + */ + readonly schema?: any; + }[]; + /** + * If set, the schema service would load schema content on-demand with 'fetch' if available + */ + readonly enableSchemaRequest?: boolean; + /** + * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used. + */ + readonly schemaValidation?: SeverityLevel; + /** + * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used. + */ + readonly schemaRequest?: SeverityLevel; + /** + * The severity of reported trailing commas. If not set, trailing commas will be reported as errors. + */ + readonly trailingCommas?: SeverityLevel; + /** + * The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors. + */ + readonly comments?: SeverityLevel; + } + export type SeverityLevel = 'error' | 'warning' | 'ignore'; + export interface ModeConfiguration { + /** + * Defines whether the built-in documentFormattingEdit provider is enabled. + */ + readonly documentFormattingEdits?: boolean; + /** + * Defines whether the built-in documentRangeFormattingEdit provider is enabled. + */ + readonly documentRangeFormattingEdits?: boolean; + /** + * Defines whether the built-in completionItemProvider is enabled. + */ + readonly completionItems?: boolean; + /** + * Defines whether the built-in hoverProvider is enabled. + */ + readonly hovers?: boolean; + /** + * Defines whether the built-in documentSymbolProvider is enabled. + */ + readonly documentSymbols?: boolean; + /** + * Defines whether the built-in tokens provider is enabled. + */ + readonly tokens?: boolean; + /** + * Defines whether the built-in color provider is enabled. + */ + readonly colors?: boolean; + /** + * Defines whether the built-in foldingRange provider is enabled. + */ + readonly foldingRanges?: boolean; + /** + * Defines whether the built-in diagnostic provider is enabled. + */ + readonly diagnostics?: boolean; + /** + * Defines whether the built-in selection range provider is enabled. + */ + readonly selectionRanges?: boolean; + } + export interface LanguageServiceDefaults { + readonly languageId: string; + readonly onDidChange: IEvent; + readonly diagnosticsOptions: DiagnosticsOptions; + readonly modeConfiguration: ModeConfiguration; + setDiagnosticsOptions(options: DiagnosticsOptions): void; + setModeConfiguration(modeConfiguration: ModeConfiguration): void; + } + export const jsonDefaults: LanguageServiceDefaults; +} + /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -7520,452 +7969,3 @@ declare namespace monaco.languages.typescript { export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise>; } - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare namespace monaco.languages.css { - export interface Options { - readonly validate?: boolean; - readonly lint?: { - readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error'; - readonly vendorPrefix?: 'ignore' | 'warning' | 'error'; - readonly duplicateProperties?: 'ignore' | 'warning' | 'error'; - readonly emptyRules?: 'ignore' | 'warning' | 'error'; - readonly importStatement?: 'ignore' | 'warning' | 'error'; - readonly boxModel?: 'ignore' | 'warning' | 'error'; - readonly universalSelector?: 'ignore' | 'warning' | 'error'; - readonly zeroUnits?: 'ignore' | 'warning' | 'error'; - readonly fontFaceProperties?: 'ignore' | 'warning' | 'error'; - readonly hexColorLength?: 'ignore' | 'warning' | 'error'; - readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error'; - readonly unknownProperties?: 'ignore' | 'warning' | 'error'; - readonly ieHack?: 'ignore' | 'warning' | 'error'; - readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error'; - readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error'; - readonly important?: 'ignore' | 'warning' | 'error'; - readonly float?: 'ignore' | 'warning' | 'error'; - readonly idSelector?: 'ignore' | 'warning' | 'error'; - }; - /** - * Configures the CSS data types known by the langauge service. - */ - readonly data?: CSSDataConfiguration; - } - export interface ModeConfiguration { - /** - * Defines whether the built-in completionItemProvider is enabled. - */ - readonly completionItems?: boolean; - /** - * Defines whether the built-in hoverProvider is enabled. - */ - readonly hovers?: boolean; - /** - * Defines whether the built-in documentSymbolProvider is enabled. - */ - readonly documentSymbols?: boolean; - /** - * Defines whether the built-in definitions provider is enabled. - */ - readonly definitions?: boolean; - /** - * Defines whether the built-in references provider is enabled. - */ - readonly references?: boolean; - /** - * Defines whether the built-in references provider is enabled. - */ - readonly documentHighlights?: boolean; - /** - * Defines whether the built-in rename provider is enabled. - */ - readonly rename?: boolean; - /** - * Defines whether the built-in color provider is enabled. - */ - readonly colors?: boolean; - /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; - /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; - /** - * Defines whether the built-in selection range provider is enabled. - */ - readonly selectionRanges?: boolean; - } - export interface LanguageServiceDefaults { - readonly languageId: string; - readonly onDidChange: IEvent; - readonly modeConfiguration: ModeConfiguration; - readonly options: Options; - setOptions(options: Options): void; - setModeConfiguration(modeConfiguration: ModeConfiguration): void; - /** @deprecated Use options instead */ - readonly diagnosticsOptions: DiagnosticsOptions; - /** @deprecated Use setOptions instead */ - setDiagnosticsOptions(options: DiagnosticsOptions): void; - } - /** @deprecated Use Options instead */ - export type DiagnosticsOptions = Options; - export const cssDefaults: LanguageServiceDefaults; - export const scssDefaults: LanguageServiceDefaults; - export const lessDefaults: LanguageServiceDefaults; - export interface CSSDataConfiguration { - /** - * Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown. - */ - useDefaultDataProvider?: boolean; - /** - * Provides a set of custom data providers. - */ - dataProviders?: { - [providerId: string]: CSSDataV1; - }; - } - /** - * Custom CSS properties, at-directives, pseudoClasses and pseudoElements - * https://github.com/microsoft/vscode-css-languageservice/blob/main/docs/customData.md - */ - export interface CSSDataV1 { - version: 1 | 1.1; - properties?: IPropertyData[]; - atDirectives?: IAtDirectiveData[]; - pseudoClasses?: IPseudoClassData[]; - pseudoElements?: IPseudoElementData[]; - } - export type EntryStatus = 'standard' | 'experimental' | 'nonstandard' | 'obsolete'; - export interface IReference { - name: string; - url: string; - } - export interface IPropertyData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - restrictions?: string[]; - status?: EntryStatus; - syntax?: string; - values?: IValueData[]; - references?: IReference[]; - relevance?: number; - } - export interface IAtDirectiveData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface IPseudoClassData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface IPseudoElementData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface IValueData { - name: string; - description?: string | MarkupContent; - browsers?: string[]; - status?: EntryStatus; - references?: IReference[]; - } - export interface MarkupContent { - kind: MarkupKind; - value: string; - } - export type MarkupKind = 'plaintext' | 'markdown'; -} - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare namespace monaco.languages.json { - export interface DiagnosticsOptions { - /** - * If set, the validator will be enabled and perform syntax and schema based validation, - * unless `DiagnosticsOptions.schemaValidation` is set to `ignore`. - */ - readonly validate?: boolean; - /** - * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. - * `DiagnosticsOptions.allowComments` will override this setting. - */ - readonly allowComments?: boolean; - /** - * A list of known schemas and/or associations of schemas to file names. - */ - readonly schemas?: { - /** - * The URI of the schema, which is also the identifier of the schema. - */ - readonly uri: string; - /** - * A list of glob patterns that describe for which file URIs the JSON schema will be used. - * '*' and '**' wildcards are supported. Exclusion patterns start with '!'. - * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'. - * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'. - */ - readonly fileMatch?: string[]; - /** - * The schema for the given URI. - */ - readonly schema?: any; - }[]; - /** - * If set, the schema service would load schema content on-demand with 'fetch' if available - */ - readonly enableSchemaRequest?: boolean; - /** - * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used. - */ - readonly schemaValidation?: SeverityLevel; - /** - * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used. - */ - readonly schemaRequest?: SeverityLevel; - /** - * The severity of reported trailing commas. If not set, trailing commas will be reported as errors. - */ - readonly trailingCommas?: SeverityLevel; - /** - * The severity of reported comments. If not set, 'DiagnosticsOptions.allowComments' defines whether comments are ignored or reported as errors. - */ - readonly comments?: SeverityLevel; - } - export type SeverityLevel = 'error' | 'warning' | 'ignore'; - export interface ModeConfiguration { - /** - * Defines whether the built-in documentFormattingEdit provider is enabled. - */ - readonly documentFormattingEdits?: boolean; - /** - * Defines whether the built-in documentRangeFormattingEdit provider is enabled. - */ - readonly documentRangeFormattingEdits?: boolean; - /** - * Defines whether the built-in completionItemProvider is enabled. - */ - readonly completionItems?: boolean; - /** - * Defines whether the built-in hoverProvider is enabled. - */ - readonly hovers?: boolean; - /** - * Defines whether the built-in documentSymbolProvider is enabled. - */ - readonly documentSymbols?: boolean; - /** - * Defines whether the built-in tokens provider is enabled. - */ - readonly tokens?: boolean; - /** - * Defines whether the built-in color provider is enabled. - */ - readonly colors?: boolean; - /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; - /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; - /** - * Defines whether the built-in selection range provider is enabled. - */ - readonly selectionRanges?: boolean; - } - export interface LanguageServiceDefaults { - readonly languageId: string; - readonly onDidChange: IEvent; - readonly diagnosticsOptions: DiagnosticsOptions; - readonly modeConfiguration: ModeConfiguration; - setDiagnosticsOptions(options: DiagnosticsOptions): void; - setModeConfiguration(modeConfiguration: ModeConfiguration): void; - } - export const jsonDefaults: LanguageServiceDefaults; -} - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare namespace monaco.languages.html { - export interface HTMLFormatConfiguration { - readonly tabSize: number; - readonly insertSpaces: boolean; - readonly wrapLineLength: number; - readonly unformatted: string; - readonly contentUnformatted: string; - readonly indentInnerHtml: boolean; - readonly preserveNewLines: boolean; - readonly maxPreserveNewLines: number | undefined; - readonly indentHandlebars: boolean; - readonly endWithNewline: boolean; - readonly extraLiners: string; - readonly wrapAttributes: 'auto' | 'force' | 'force-aligned' | 'force-expand-multiline'; - } - export interface CompletionConfiguration { - readonly [providerId: string]: boolean; - } - export interface Options { - /** - * If set, comments are tolerated. If set to false, syntax errors will be emitted for comments. - */ - readonly format?: HTMLFormatConfiguration; - /** - * A list of known schemas and/or associations of schemas to file names. - */ - readonly suggest?: CompletionConfiguration; - /** - * Configures the HTML data types known by the HTML langauge service. - */ - readonly data?: HTMLDataConfiguration; - } - export interface ModeConfiguration { - /** - * Defines whether the built-in completionItemProvider is enabled. - */ - readonly completionItems?: boolean; - /** - * Defines whether the built-in hoverProvider is enabled. - */ - readonly hovers?: boolean; - /** - * Defines whether the built-in documentSymbolProvider is enabled. - */ - readonly documentSymbols?: boolean; - /** - * Defines whether the built-in definitions provider is enabled. - */ - readonly links?: boolean; - /** - * Defines whether the built-in references provider is enabled. - */ - readonly documentHighlights?: boolean; - /** - * Defines whether the built-in rename provider is enabled. - */ - readonly rename?: boolean; - /** - * Defines whether the built-in color provider is enabled. - */ - readonly colors?: boolean; - /** - * Defines whether the built-in foldingRange provider is enabled. - */ - readonly foldingRanges?: boolean; - /** - * Defines whether the built-in diagnostic provider is enabled. - */ - readonly diagnostics?: boolean; - /** - * Defines whether the built-in selection range provider is enabled. - */ - readonly selectionRanges?: boolean; - /** - * Defines whether the built-in documentFormattingEdit provider is enabled. - */ - readonly documentFormattingEdits?: boolean; - /** - * Defines whether the built-in documentRangeFormattingEdit provider is enabled. - */ - readonly documentRangeFormattingEdits?: boolean; - } - export interface LanguageServiceDefaults { - readonly languageId: string; - readonly modeConfiguration: ModeConfiguration; - readonly onDidChange: IEvent; - readonly options: Options; - setOptions(options: Options): void; - setModeConfiguration(modeConfiguration: ModeConfiguration): void; - } - export const htmlLanguageService: LanguageServiceRegistration; - export const htmlDefaults: LanguageServiceDefaults; - export const handlebarLanguageService: LanguageServiceRegistration; - export const handlebarDefaults: LanguageServiceDefaults; - export const razorLanguageService: LanguageServiceRegistration; - export const razorDefaults: LanguageServiceDefaults; - export interface LanguageServiceRegistration extends IDisposable { - readonly defaults: LanguageServiceDefaults; - } - /** - * Registers a new HTML language service for the languageId. - * Note: 'html', 'handlebar' and 'razor' are registered by default. - * - * Use this method to register additional language ids with a HTML service. - * The language server has to be registered before an editor model is opened. - */ - export function registerHTMLLanguageService(languageId: string, options?: Options, modeConfiguration?: ModeConfiguration): LanguageServiceRegistration; - export interface HTMLDataConfiguration { - /** - * Defines whether the standard HTML tags and attributes are shown - */ - readonly useDefaultDataProvider?: boolean; - /** - * Provides a set of custom data providers. - */ - readonly dataProviders?: { - [providerId: string]: HTMLDataV1; - }; - } - /** - * Custom HTML tags attributes and attribute values - * https://github.com/microsoft/vscode-html-languageservice/blob/main/docs/customData.md - */ - export interface HTMLDataV1 { - readonly version: 1 | 1.1; - readonly tags?: ITagData[]; - readonly globalAttributes?: IAttributeData[]; - readonly valueSets?: IValueSet[]; - } - export interface IReference { - readonly name: string; - readonly url: string; - } - export interface ITagData { - readonly name: string; - readonly description?: string | MarkupContent; - readonly attributes: IAttributeData[]; - readonly references?: IReference[]; - } - export interface IAttributeData { - readonly name: string; - readonly description?: string | MarkupContent; - readonly valueSet?: string; - readonly values?: IValueData[]; - readonly references?: IReference[]; - } - export interface IValueData { - readonly name: string; - readonly description?: string | MarkupContent; - readonly references?: IReference[]; - } - export interface IValueSet { - readonly name: string; - readonly values: IValueData[]; - } - export interface MarkupContent { - readonly kind: MarkupKind; - readonly value: string; - } - export type MarkupKind = 'plaintext' | 'markdown'; -}