This commit is contained in:
Alex Dima 2016-10-07 15:44:41 +02:00
parent a88225bcf0
commit 9ff02988e6
3 changed files with 225 additions and 123 deletions

View file

@ -1,5 +1,34 @@
# Monaco Editor Change log # Monaco Editor Change log
## [0.7.0]
- Adopted TypeScript 2.0 in all the repos (also reflected in `monaco.d.ts`).
- Added YAML colorization support.
- Brought back the ability to use `editor.addAction()` and have the action show in the context menu.
- Web workers now get a nice label next to the script name.
### API changes:
- settings:
- new values for `lineNumbers`: `'on' | 'off' | 'relative'`
- new values for `renderWhitespace`: `'none' | 'boundary' | 'all'`
- removed `model.setMode()`, as `IMode` will soon disappear from the API.
### Debt work
- Removed html, razor, php and handlebars from `monaco-editor-core`:
- the `monaco-editor-core` is now finally language agnostic.
- coloring for html, razor, php and handlebars is now coming in from `monaco-languages`.
- language smarts for html, razor and handlebars now comes from `monaco-html`.
- Packaging improvements:
- thanks to the removal of the old languages from `monaco-editor-core`, we could improve the bundling and reduce the number of .js files we ship.
- we are thinking about simplifying this further in the upcoming releases.
### Thank you
* [Sandy Armstrong (@sandyarmstrong)](https://github.com/sandyarmstrong): csharp: allow styling #r/#load [PR monaco-languages#9](https://github.com/Microsoft/monaco-languages/pull/9)
* [Nico Tonozzi (@nicot)](https://github.com/nicot): Go: add raw string literal syntax [PR monaco-languages#10](https://github.com/Microsoft/monaco-languages/pull/10)
* [Jason Killian (@JKillian)](https://github.com/JKillian): Add vmin and vmax CSS units [PR monaco-languages#11](https://github.com/Microsoft/monaco-languages/pull/11)
* [Jan Pilzer (@Hirse)](https://github.com/Hirse): YAML colorization [PR monaco-languages#12](https://github.com/Microsoft/monaco-languages/pull/12)
* [Sam El-Husseini (@microsoftsam)](https://github.com/microsoftsam): Using Cmd+Scroll to zoom on a mac [PR vscode#12477](https://github.com/Microsoft/vscode/pull/12477)
## [0.6.1] ## [0.6.1]
- Fixed regression where `editor.addCommand` was no longer working. - Fixed regression where `editor.addCommand` was no longer working.

View file

@ -1,7 +1,7 @@
{ {
"name": "monaco-editor", "name": "monaco-editor",
"private": true, "private": true,
"version": "0.6.1", "version": "0.7.0",
"description": "A browser based code editor", "description": "A browser based code editor",
"author": "Microsoft Corporation", "author": "Microsoft Corporation",
"license": "MIT", "license": "MIT",

View file

@ -75,17 +75,21 @@ declare module monaco {
public cancel(): void; public cancel(): void;
public static as<ValueType>(value: ValueType): Promise<ValueType>; public static as<ValueType>(value: ValueType): Promise<ValueType>;
public static is(value: any): value is Promise<any>; public static is(value: any): value is Thenable<any>;
public static timeout(delay: number): Promise<void>; public static timeout(delay: number): Promise<void>;
public static join<ValueType>(promises: Promise<ValueType>[]): Promise<ValueType[]>; public static join<ValueType>(promises: Promise<ValueType>[]): Promise<ValueType[]>;
public static join<ValueType>(promises: Thenable<ValueType>[]): Thenable<ValueType[]>; public static join<ValueType>(promises: Thenable<ValueType>[]): Thenable<ValueType[]>;
public static join<ValueType>(promises: { [n: string]: Promise<ValueType> }): Promise<{ [n: string]: ValueType }>; public static join<ValueType>(promises: { [n: string]: Promise<ValueType> }): Promise<{ [n: string]: ValueType }>;
public static any<ValueType>(promises: Promise<ValueType>[]): Promise<{ key: string; value: Promise<ValueType>; }>; public static any<ValueType>(promises: Promise<ValueType>[]): Promise<{ key: string; value: Promise<ValueType>; }>;
public static wrap<ValueType>(value: Thenable<ValueType>): Promise<ValueType>;
public static wrap<ValueType>(value: ValueType): Promise<ValueType>;
public static wrapError<ValueType>(error: any): Promise<ValueType>; public static wrapError<ValueType>(error: any): Promise<ValueType>;
} }
export class CancellationTokenSource { export class CancellationTokenSource {
token: CancellationToken; readonly token: CancellationToken;
cancel(): void; cancel(): void;
dispose(): void; dispose(): void;
} }
@ -112,36 +116,36 @@ declare module monaco {
*/ */
export class Uri { export class Uri {
static isUri(thing: any): thing is Uri; static isUri(thing: any): thing is Uri;
constructor(); protected constructor();
/** /**
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'. * scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.
* The part before the first colon. * The part before the first colon.
*/ */
scheme: string; readonly scheme: string;
/** /**
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'. * authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.
* The part between the first double slashes and the next slash. * The part between the first double slashes and the next slash.
*/ */
authority: string; readonly authority: string;
/** /**
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'. * path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.
*/ */
path: string; readonly path: string;
/** /**
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'. * query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.
*/ */
query: string; readonly query: string;
/** /**
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'. * fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.
*/ */
fragment: string; readonly fragment: string;
/** /**
* Returns a string representing the corresponding file system path of this Uri. * Returns a string representing the corresponding file system path of this Uri.
* Will handle UNC paths and normalize windows drive letters to lower-case. Also * Will handle UNC paths and normalize windows drive letters to lower-case. Also
* uses the platform specific path separator. Will *not* validate the path for * uses the platform specific path separator. Will *not* validate the path for
* invalid characters and semantics. Will *not* look at the scheme of this Uri. * invalid characters and semantics. Will *not* look at the scheme of this Uri.
*/ */
fsPath: string; readonly fsPath: string;
with(change: { with(change: {
scheme?: string; scheme?: string;
authority?: string; authority?: string;
@ -337,6 +341,7 @@ declare module monaco {
NUMPAD_DIVIDE = 108, NUMPAD_DIVIDE = 108,
/** /**
* Placed last to cover the length of the enum. * Placed last to cover the length of the enum.
* Please do not depend on this value!
*/ */
MAX_VALUE = 109, MAX_VALUE = 109,
} }
@ -740,14 +745,14 @@ declare module monaco.editor {
* `domElement` should be empty (not contain other dom nodes). * `domElement` should be empty (not contain other dom nodes).
* The editor will read the size of `domElement`. * The editor will read the size of `domElement`.
*/ */
export function create(domElement: HTMLElement, options?: IEditorConstructionOptions, services?: IEditorOverrideServices): IStandaloneCodeEditor; export function create(domElement: HTMLElement, options?: IEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneCodeEditor;
/** /**
* Create a new diff editor under `domElement`. * Create a new diff editor under `domElement`.
* `domElement` should be empty (not contain other dom nodes). * `domElement` should be empty (not contain other dom nodes).
* The editor will read the size of `domElement`. * The editor will read the size of `domElement`.
*/ */
export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorConstructionOptions, services?: IEditorOverrideServices): IStandaloneDiffEditor; export function createDiffEditor(domElement: HTMLElement, options?: IDiffEditorConstructionOptions, override?: IEditorOverrideServices): IStandaloneDiffEditor;
export interface IDiffNavigator { export interface IDiffNavigator {
canNavigate(): boolean; canNavigate(): boolean;
@ -808,6 +813,27 @@ declare module monaco.editor {
oldLanguage: string; oldLanguage: string;
}) => void): IDisposable; }) => void): IDisposable;
/**
* Create a new web worker that has model syncing capabilities built in.
* Specify an AMD module to load that will `create` an object that will be proxied.
*/
export function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T>;
/**
* Colorize the contents of `domNode` using attribute `data-lang`.
*/
export function colorizeElement(domNode: HTMLElement, options: IColorizerElementOptions): Promise<void>;
/**
* Colorize `text` using language `languageId`.
*/
export function colorize(text: string, languageId: string, options: IColorizerOptions): Promise<string>;
/**
* Colorize a line in a model.
*/
export function colorizeModelLine(model: IModel, lineNumber: number, tabSize?: number): string;
/** /**
* A web worker that can provide a proxy to an arbitrary file. * A web worker that can provide a proxy to an arbitrary file.
*/ */
@ -837,29 +863,12 @@ declare module monaco.editor {
* The data to send over when calling create on the module. * The data to send over when calling create on the module.
*/ */
createData?: any; createData?: any;
/**
* A label to be used to identify the web worker for debugging purposes.
*/
label?: string;
} }
/**
* Create a new web worker that has model syncing capabilities built in.
* Specify an AMD module to load that will `create` an object that will be proxied.
*/
export function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T>;
/**
* Colorize the contents of `domNode` using attribute `data-lang`.
*/
export function colorizeElement(domNode: HTMLElement, options: IColorizerElementOptions): Promise<void>;
/**
* Colorize `text` using language `languageId`.
*/
export function colorize(text: string, languageId: string, options: IColorizerOptions): Promise<string>;
/**
* Colorize a line in a model.
*/
export function colorizeModelLine(model: IModel, lineNumber: number, tabSize?: number): string;
/** /**
* The options to create an editor. * The options to create an editor.
*/ */
@ -1026,6 +1035,8 @@ declare module monaco.editor {
Indent = 2, Indent = 2,
} }
export type LineNumbersOption = 'on' | 'off' | 'relative' | ((lineNumber: number) => string);
/** /**
* Configuration options for the editor. * Configuration options for the editor.
*/ */
@ -1061,7 +1072,7 @@ declare module monaco.editor {
* Otherwise, line numbers will not be rendered. * Otherwise, line numbers will not be rendered.
* Defaults to true. * Defaults to true.
*/ */
lineNumbers?: any; lineNumbers?: LineNumbersOption;
/** /**
* Should the corresponding line be selected when clicking on the line number? * Should the corresponding line be selected when clicking on the line number?
* Defaults to true. * Defaults to true.
@ -1278,10 +1289,10 @@ declare module monaco.editor {
*/ */
folding?: boolean; folding?: boolean;
/** /**
* Enable rendering of leading whitespace. * Enable rendering of whitespace.
* Defaults to false. * Defaults to none.
*/ */
renderWhitespace?: boolean; renderWhitespace?: 'none' | 'boundary' | 'all';
/** /**
* Enable rendering of control characters. * Enable rendering of control characters.
* Defaults to false. * Defaults to false.
@ -1378,7 +1389,9 @@ declare module monaco.editor {
experimentalScreenReader: boolean; experimentalScreenReader: boolean;
rulers: number[]; rulers: number[];
ariaLabel: string; ariaLabel: string;
lineNumbers: any; renderLineNumbers: boolean;
renderCustomLineNumbers: (lineNumber: number) => string;
renderRelativeLineNumbers: boolean;
selectOnLineNumbers: boolean; selectOnLineNumbers: boolean;
glyphMargin: boolean; glyphMargin: boolean;
revealHorizontalRightPadding: number; revealHorizontalRightPadding: number;
@ -1391,7 +1404,7 @@ declare module monaco.editor {
scrollBeyondLastLine: boolean; scrollBeyondLastLine: boolean;
editorClassName: string; editorClassName: string;
stopRenderingLineAfter: number; stopRenderingLineAfter: number;
renderWhitespace: boolean; renderWhitespace: 'none' | 'boundary' | 'all';
renderControlCharacters: boolean; renderControlCharacters: boolean;
renderIndentGuides: boolean; renderIndentGuides: boolean;
renderLineHighlight: boolean; renderLineHighlight: boolean;
@ -1404,7 +1417,9 @@ declare module monaco.editor {
experimentalScreenReader: boolean; experimentalScreenReader: boolean;
rulers: boolean; rulers: boolean;
ariaLabel: boolean; ariaLabel: boolean;
lineNumbers: boolean; renderLineNumbers: boolean;
renderCustomLineNumbers: boolean;
renderRelativeLineNumbers: boolean;
selectOnLineNumbers: boolean; selectOnLineNumbers: boolean;
glyphMargin: boolean; glyphMargin: boolean;
revealHorizontalRightPadding: boolean; revealHorizontalRightPadding: boolean;
@ -1948,6 +1963,48 @@ declare module monaco.editor {
* Returns iff the model was disposed or not. * Returns iff the model was disposed or not.
*/ */
isDisposed(): boolean; isDisposed(): boolean;
/**
* Search the model.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchOnlyEditableRange Limit the searching to only search inside the editable range of the model.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @param limitResultCount Limit the number of results
* @return The ranges where the matches are. It is empty if not matches have been found.
*/
findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wholeWord: boolean, limitResultCount?: number): Range[];
/**
* Search the model.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchScope Limit the searching to only search inside this range.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @param limitResultCount Limit the number of results
* @return The ranges where the matches are. It is empty if no matches have been found.
*/
findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wholeWord: boolean, limitResultCount?: number): Range[];
/**
* Search the model for the next match. Loops to the beginning of the model if needed.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchStart Start the searching at the specified position.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @return The range where the next match is. It is null if no next match has been found.
*/
findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean): Range;
/**
* Search the model for the previous match. Loops to the end of the model if needed.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchStart Start the searching at the specified position.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @return The range where the previous match is. It is null if no previous match has been found.
*/
findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean): Range;
} }
export interface IReadOnlyModel extends ITextModel { export interface IReadOnlyModel extends ITextModel {
@ -1984,9 +2041,9 @@ declare module monaco.editor {
*/ */
getMode(): languages.IMode; getMode(): languages.IMode;
/** /**
* Set the current language mode associated with the model. * Get the language associated with this model.
*/ */
setMode(newMode: languages.IMode | Promise<languages.IMode>): void; getModeId(): string;
/** /**
* Get the word under or besides `position`. * Get the word under or besides `position`.
* @param position The position to look for a word. * @param position The position to look for a word.
@ -2163,48 +2220,6 @@ declare module monaco.editor {
* and make all necessary clean-up to release this object to the GC. * and make all necessary clean-up to release this object to the GC.
*/ */
dispose(): void; dispose(): void;
/**
* Search the model.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchOnlyEditableRange Limit the searching to only search inside the editable range of the model.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @param limitResultCount Limit the number of results
* @return The ranges where the matches are. It is empty if not matches have been found.
*/
findMatches(searchString: string, searchOnlyEditableRange: boolean, isRegex: boolean, matchCase: boolean, wholeWord: boolean, limitResultCount?: number): Range[];
/**
* Search the model.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchScope Limit the searching to only search inside this range.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @param limitResultCount Limit the number of results
* @return The ranges where the matches are. It is empty if no matches have been found.
*/
findMatches(searchString: string, searchScope: IRange, isRegex: boolean, matchCase: boolean, wholeWord: boolean, limitResultCount?: number): Range[];
/**
* Search the model for the next match. Loops to the beginning of the model if needed.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchStart Start the searching at the specified position.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @return The range where the next match is. It is null if no next match has been found.
*/
findNextMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean): Range;
/**
* Search the model for the previous match. Loops to the end of the model if needed.
* @param searchString The string used to search. If it is a regular expression, set `isRegex` to true.
* @param searchStart Start the searching at the specified position.
* @param isRegex Used to indicate that `searchString` is a regular expression.
* @param matchCase Force the matching to match lower/upper case exactly.
* @param wholeWord Force the matching to match entire words only.
* @return The range where the previous match is. It is null if no previous match has been found.
*/
findPreviousMatch(searchString: string, searchStart: IPosition, isRegex: boolean, matchCase: boolean, wholeWord: boolean): Range;
} }
/** /**
@ -2761,6 +2776,20 @@ declare module monaco.editor {
* An array of keybindings for the action. * An array of keybindings for the action.
*/ */
keybindings?: number[]; keybindings?: number[];
/**
* Control if the action should show up in the context menu and where.
* The context menu of the editor has these default:
* navigation - The navigation group comes first in all cases.
* 1_modification - This group comes next and contains commands that modify your code.
* 9_cutcopypaste - The last default group with the basic editing commands.
* You can also create your own group.
* Defaults to null (don't show in context menu).
*/
contextMenuGroupId?: string;
/**
* Control the order in the context menu group.
*/
contextMenuOrder?: number;
/** /**
* The keybinding rule. * The keybinding rule.
*/ */
@ -4018,8 +4047,8 @@ declare module monaco.languages {
*/ */
indentationRules?: IndentationRule; indentationRules?: IndentationRule;
/** /**
* The language's rules to be evaluated when pressing Enter. * The language's rules to be evaluated when pressing Enter.
*/ */
onEnterRules?: OnEnterRule[]; onEnterRules?: OnEnterRule[];
/** /**
* The language's auto closing pairs. The 'close' character is automatically inserted with the * The language's auto closing pairs. The 'close' character is automatically inserted with the
@ -4870,38 +4899,38 @@ declare module monaco.languages.typescript {
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
declare module monaco.languages.css { declare module monaco.languages.css {
export interface DiagnosticsOptions { export interface DiagnosticsOptions {
validate?: boolean; readonly validate?: boolean;
lint?: { readonly lint?: {
compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error', readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error',
vendorPrefix?: 'ignore' | 'warning' | 'error', readonly vendorPrefix?: 'ignore' | 'warning' | 'error',
duplicateProperties?: 'ignore' | 'warning' | 'error', readonly duplicateProperties?: 'ignore' | 'warning' | 'error',
emptyRules?: 'ignore' | 'warning' | 'error', readonly emptyRules?: 'ignore' | 'warning' | 'error',
importStatement?: 'ignore' | 'warning' | 'error', readonly importStatement?: 'ignore' | 'warning' | 'error',
boxModel?: 'ignore' | 'warning' | 'error', readonly boxModel?: 'ignore' | 'warning' | 'error',
universalSelector?: 'ignore' | 'warning' | 'error', readonly universalSelector?: 'ignore' | 'warning' | 'error',
zeroUnits?: 'ignore' | 'warning' | 'error', readonly zeroUnits?: 'ignore' | 'warning' | 'error',
fontFaceProperties?: 'ignore' | 'warning' | 'error', readonly fontFaceProperties?: 'ignore' | 'warning' | 'error',
hexColorLength?: 'ignore' | 'warning' | 'error', readonly hexColorLength?: 'ignore' | 'warning' | 'error',
argumentsInColorFunction?: 'ignore' | 'warning' | 'error', readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error',
unknownProperties?: 'ignore' | 'warning' | 'error', readonly unknownProperties?: 'ignore' | 'warning' | 'error',
ieHack?: 'ignore' | 'warning' | 'error', readonly ieHack?: 'ignore' | 'warning' | 'error',
unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error', readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error',
propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error', readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error',
important?: 'ignore' | 'warning' | 'error', readonly important?: 'ignore' | 'warning' | 'error',
float?: 'ignore' | 'warning' | 'error', readonly float?: 'ignore' | 'warning' | 'error',
idSelector?: 'ignore' | 'warning' | 'error' readonly idSelector?: 'ignore' | 'warning' | 'error'
} }
} }
export interface LanguageServiceDefaults { export interface LanguageServiceDefaults {
onDidChange: IEvent<LanguageServiceDefaults>; readonly onDidChange: IEvent<LanguageServiceDefaults>;
diagnosticsOptions: DiagnosticsOptions; readonly diagnosticsOptions: DiagnosticsOptions;
setDiagnosticsOptions(options: DiagnosticsOptions): void; setDiagnosticsOptions(options: DiagnosticsOptions): void;
} }
export var cssDefaults: LanguageServiceDefaults; export var cssDefaults: LanguageServiceDefaults;
export var lessDefaults: LanguageServiceDefaults; export var lessDefaults: LanguageServiceDefaults;
export var scssDefaults: LanguageServiceDefaults; export var scssDefaults: LanguageServiceDefaults;
} }
/*--------------------------------------------------------------------------------------------- /*---------------------------------------------------------------------------------------------
@ -4914,35 +4943,79 @@ declare module monaco.languages.json {
/** /**
* If set, the validator will be enabled and perform syntax validation as well as schema based validation. * If set, the validator will be enabled and perform syntax validation as well as schema based validation.
*/ */
validate?: boolean; readonly validate?: boolean;
/** /**
* If set, comments are tolerated. If set to false, syntax errors will be emmited for comments. * If set, comments are tolerated. If set to false, syntax errors will be emmited for comments.
*/ */
allowComments?: boolean; readonly allowComments?: boolean;
/** /**
* A list of known schemas and/or associations of schemas to file names. * A list of known schemas and/or associations of schemas to file names.
*/ */
schemas?: { readonly schemas?: {
/** /**
* The URI of the schema, which is also the identifier of the schema. * The URI of the schema, which is also the identifier of the schema.
*/ */
uri: string; readonly uri: string;
/** /**
* A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json' * A list of file names that are associated to the schema. The '*' wildcard can be used. For example '*.schema.json', 'package.json'
*/ */
fileMatch?: string[]; readonly fileMatch?: string[];
/** /**
* The schema for the given URI. * The schema for the given URI.
*/ */
schema?: any; readonly schema?: any;
}[]; }[];
} }
export interface LanguageServiceDefaults { export interface LanguageServiceDefaults {
onDidChange: IEvent<LanguageServiceDefaults>; readonly onDidChange: IEvent<LanguageServiceDefaults>;
diagnosticsOptions: DiagnosticsOptions; readonly diagnosticsOptions: DiagnosticsOptions;
setDiagnosticsOptions(options: DiagnosticsOptions): void; setDiagnosticsOptions(options: DiagnosticsOptions): void;
} }
export var jsonDefaults: LanguageServiceDefaults; export var 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 module monaco.languages.html {
export interface HTMLFormatConfiguration {
readonly tabSize: number;
readonly insertSpaces: boolean;
readonly wrapLineLength: number;
readonly unformatted: string;
readonly indentInnerHtml: boolean;
readonly preserveNewLines: boolean;
readonly maxPreserveNewLines: number;
readonly indentHandlebars: boolean;
readonly endWithNewline: boolean;
readonly extraLiners: string;
}
export interface CompletionConfiguration {
[provider: string]: boolean;
}
export interface Options {
/**
* If set, comments are tolerated. If set to false, syntax errors will be emmited for comments.
*/
readonly format?: HTMLFormatConfiguration;
/**
* A list of known schemas and/or associations of schemas to file names.
*/
readonly suggest?: CompletionConfiguration;
}
export interface LanguageServiceDefaults {
readonly onDidChange: IEvent<LanguageServiceDefaults>;
readonly options: Options;
setOptions(options: Options): void;
}
export var htmlDefaults: LanguageServiceDefaults;
export var handlebarDefaults: LanguageServiceDefaults;
export var razorDefaults: LanguageServiceDefaults;
} }