mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 08:10:11 +01:00
Adopt core & plugins for 0.5.0
This commit is contained in:
parent
e61cf2c079
commit
18f953b747
10 changed files with 161 additions and 155 deletions
1
website/.gitignore
vendored
Normal file
1
website/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
node_modules/monaco-editor/dev
|
||||
|
|
@ -347,37 +347,24 @@ declare module monaco {
|
|||
static WinCtrl: number;
|
||||
static chord(firstPart: number, secondPart: number): number;
|
||||
}
|
||||
export interface IHTMLContentElementCode {
|
||||
/**
|
||||
* MarkedString can be used to render human readable text. It is either a markdown string
|
||||
* or a code-block that provides a language and a code snippet. Note that
|
||||
* markdown strings will be sanitized - that means html will be escaped.
|
||||
*/
|
||||
export type MarkedString = string | {
|
||||
language: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface IHTMLContentElement {
|
||||
/**
|
||||
* supports **bold**, __italics__, and [[actions]]
|
||||
*/
|
||||
formattedText?: string;
|
||||
text?: string;
|
||||
className?: string;
|
||||
style?: string;
|
||||
customStyle?: any;
|
||||
tagName?: string;
|
||||
children?: IHTMLContentElement[];
|
||||
isText?: boolean;
|
||||
role?: string;
|
||||
markdown?: string;
|
||||
code?: IHTMLContentElementCode;
|
||||
}
|
||||
};
|
||||
|
||||
export interface IKeyboardEvent {
|
||||
browserEvent: Event;
|
||||
browserEvent: KeyboardEvent;
|
||||
target: HTMLElement;
|
||||
ctrlKey: boolean;
|
||||
shiftKey: boolean;
|
||||
altKey: boolean;
|
||||
metaKey: boolean;
|
||||
keyCode: KeyCode;
|
||||
clone(): IKeyboardEvent;
|
||||
asKeybinding(): number;
|
||||
equals(keybinding: number): boolean;
|
||||
preventDefault(): void;
|
||||
|
|
@ -1499,13 +1486,9 @@ declare module monaco.editor {
|
|||
*/
|
||||
className?: string;
|
||||
/**
|
||||
* Message to be rendered when hovering over the decoration.
|
||||
* Array of MarkedString to render as the decoration message.
|
||||
*/
|
||||
hoverMessage?: string;
|
||||
/**
|
||||
* Array of IHTMLContentElements to render as the decoration message.
|
||||
*/
|
||||
htmlMessage?: IHTMLContentElement[];
|
||||
hoverMessage?: MarkedString | MarkedString[];
|
||||
/**
|
||||
* Should the decoration expand to encompass a whole line.
|
||||
*/
|
||||
|
|
@ -2115,11 +2098,6 @@ declare module monaco.editor {
|
|||
* A model.
|
||||
*/
|
||||
export interface IModel extends IReadOnlyModel, IEditableTextModel, ITextModelWithMarkers, ITokenizedModel, ITextModelWithTrackedRanges, ITextModelWithDecorations, IEditorModel {
|
||||
/**
|
||||
* @deprecated Please use `onDidChangeContent` instead.
|
||||
* An event emitted when the contents of the model have changed.
|
||||
*/
|
||||
onDidChangeRawContent(listener: (e: IModelContentChangedEvent) => void): IDisposable;
|
||||
/**
|
||||
* An event emitted when the contents of the model have changed.
|
||||
*/
|
||||
|
|
@ -2241,32 +2219,6 @@ declare module monaco.editor {
|
|||
isRedoing: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* An event describing a change in the text of a model.
|
||||
*/
|
||||
export interface IModelContentChangedEvent {
|
||||
/**
|
||||
* The event type. It can be used to detect the actual event type:
|
||||
* EditorCommon.EventType.ModelContentChangedFlush => IModelContentChangedFlushEvent
|
||||
* EditorCommon.EventType.ModelContentChangedLinesDeleted => IModelContentChangedLineChangedEvent
|
||||
* EditorCommon.EventType.ModelContentChangedLinesInserted => IModelContentChangedLinesDeletedEvent
|
||||
* EditorCommon.EventType.ModelContentChangedLineChanged => IModelContentChangedLinesInsertedEvent
|
||||
*/
|
||||
changeType: string;
|
||||
/**
|
||||
* The new version id the model has transitioned to.
|
||||
*/
|
||||
versionId: number;
|
||||
/**
|
||||
* Flag that indicates that this event was generated while undoing.
|
||||
*/
|
||||
isUndoing: boolean;
|
||||
/**
|
||||
* Flag that indicates that this event was generated while redoing.
|
||||
*/
|
||||
isRedoing: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The raw text backing a model.
|
||||
*/
|
||||
|
|
@ -2293,62 +2245,6 @@ declare module monaco.editor {
|
|||
options: ITextModelResolvedOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* An event describing that a model has been reset to a new value.
|
||||
*/
|
||||
export interface IModelContentChangedFlushEvent extends IModelContentChangedEvent {
|
||||
/**
|
||||
* The new text content of the model.
|
||||
*/
|
||||
detail: IRawText;
|
||||
}
|
||||
|
||||
/**
|
||||
* An event describing that a line has changed in a model.
|
||||
*/
|
||||
export interface IModelContentChangedLineChangedEvent extends IModelContentChangedEvent {
|
||||
/**
|
||||
* The line that has changed.
|
||||
*/
|
||||
lineNumber: number;
|
||||
/**
|
||||
* The new value of the line.
|
||||
*/
|
||||
detail: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An event describing that line(s) have been deleted in a model.
|
||||
*/
|
||||
export interface IModelContentChangedLinesDeletedEvent extends IModelContentChangedEvent {
|
||||
/**
|
||||
* At what line the deletion began (inclusive).
|
||||
*/
|
||||
fromLineNumber: number;
|
||||
/**
|
||||
* At what line the deletion stopped (inclusive).
|
||||
*/
|
||||
toLineNumber: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* An event describing that line(s) have been inserted in a model.
|
||||
*/
|
||||
export interface IModelContentChangedLinesInsertedEvent extends IModelContentChangedEvent {
|
||||
/**
|
||||
* Before what line did the insertion begin
|
||||
*/
|
||||
fromLineNumber: number;
|
||||
/**
|
||||
* `toLineNumber` - `fromLineNumber` + 1 denotes the number of lines that were inserted
|
||||
*/
|
||||
toLineNumber: number;
|
||||
/**
|
||||
* The text that was inserted
|
||||
*/
|
||||
detail: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decoration data associated with a model decorations changed event.
|
||||
*/
|
||||
|
|
@ -2915,11 +2811,6 @@ declare module monaco.editor {
|
|||
* An editor.
|
||||
*/
|
||||
export interface IEditor {
|
||||
/**
|
||||
* @deprecated. Please use `onDidChangeModelContent` instead.
|
||||
* An event emitted when the content of the current model has changed.
|
||||
*/
|
||||
onDidChangeModelRawContent(listener: (e: IModelContentChangedEvent) => void): IDisposable;
|
||||
/**
|
||||
* An event emitted when the content of the current model has changed.
|
||||
*/
|
||||
|
|
@ -3841,6 +3732,30 @@ declare module monaco.languages {
|
|||
*/
|
||||
export function registerCompletionItemProvider(languageId: string, provider: CompletionItemProvider): IDisposable;
|
||||
|
||||
/**
|
||||
* Contains additional diagnostic information about the context in which
|
||||
* a [code action](#CodeActionProvider.provideCodeActions) is run.
|
||||
*/
|
||||
export interface CodeActionContext {
|
||||
/**
|
||||
* An array of diagnostics.
|
||||
*
|
||||
* @readonly
|
||||
*/
|
||||
markers: editor.IMarkerData[];
|
||||
}
|
||||
|
||||
/**
|
||||
* The code action interface defines the contract between extensions and
|
||||
* the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature.
|
||||
*/
|
||||
export interface CodeActionProvider {
|
||||
/**
|
||||
* Provide commands for the given document and range.
|
||||
*/
|
||||
provideCodeActions(model: editor.IReadOnlyModel, range: Range, context: CodeActionContext, token: CancellationToken): CodeAction[] | Thenable<CodeAction[]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Completion item kinds.
|
||||
*/
|
||||
|
|
@ -4145,7 +4060,7 @@ declare module monaco.languages {
|
|||
/**
|
||||
* The contents of this hover.
|
||||
*/
|
||||
htmlContent: IHTMLContentElement[];
|
||||
contents: MarkedString[];
|
||||
/**
|
||||
* The range to which this hover applies. When missing, the
|
||||
* editor will use the range at the current position or the
|
||||
|
|
@ -4175,17 +4090,6 @@ declare module monaco.languages {
|
|||
score: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The code action interface defines the contract between extensions and
|
||||
* the [light bulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) feature.
|
||||
*/
|
||||
export interface CodeActionProvider {
|
||||
/**
|
||||
* Provide commands for the given document and range.
|
||||
*/
|
||||
provideCodeActions(model: editor.IReadOnlyModel, range: Range, token: CancellationToken): CodeAction[] | Thenable<CodeAction[]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a parameter of a callable-signature. A parameter can
|
||||
* have a label and a doc-comment.
|
||||
|
|
@ -4712,13 +4616,15 @@ declare module monaco.worker {
|
|||
export interface IMirrorModel {
|
||||
uri: Uri;
|
||||
version: number;
|
||||
getText(): string;
|
||||
getValue(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all available mirror models in this worker.
|
||||
*/
|
||||
export function getMirrorModels(): IMirrorModel[];
|
||||
export interface IWorkerContext {
|
||||
/**
|
||||
* Get all available mirror models in this worker.
|
||||
*/
|
||||
getMirrorModels(): IMirrorModel[];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -4830,3 +4736,43 @@ declare module monaco.languages.typescript {
|
|||
export var typescriptDefaults: LanguageServiceDefaults;
|
||||
export var javascriptDefaults: 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.css {
|
||||
export interface DiagnosticsOptions {
|
||||
validate?: boolean;
|
||||
lint?: {
|
||||
compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error',
|
||||
vendorPrefix?: 'ignore' | 'warning' | 'error',
|
||||
duplicateProperties?: 'ignore' | 'warning' | 'error',
|
||||
emptyRules?: 'ignore' | 'warning' | 'error',
|
||||
importStatement?: 'ignore' | 'warning' | 'error',
|
||||
boxModel?: 'ignore' | 'warning' | 'error',
|
||||
universalSelector?: 'ignore' | 'warning' | 'error',
|
||||
zeroUnits?: 'ignore' | 'warning' | 'error',
|
||||
fontFaceProperties?: 'ignore' | 'warning' | 'error',
|
||||
hexColorLength?: 'ignore' | 'warning' | 'error',
|
||||
argumentsInColorFunction?: 'ignore' | 'warning' | 'error',
|
||||
unknownProperties?: 'ignore' | 'warning' | 'error',
|
||||
ieHack?: 'ignore' | 'warning' | 'error',
|
||||
unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error',
|
||||
propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error',
|
||||
important?: 'ignore' | 'warning' | 'error',
|
||||
float?: 'ignore' | 'warning' | 'error',
|
||||
idSelector?: 'ignore' | 'warning' | 'error'
|
||||
}
|
||||
}
|
||||
|
||||
export interface LanguageServiceDefaults {
|
||||
onDidChange: IEvent<LanguageServiceDefaults>;
|
||||
diagnosticsOptions: DiagnosticsOptions;
|
||||
setDiagnosticsOptions(options: DiagnosticsOptions): void;
|
||||
}
|
||||
|
||||
export var cssDefaults: LanguageServiceDefaults;
|
||||
export var lessDefaults: LanguageServiceDefaults;
|
||||
export var scssDefaults: LanguageServiceDefaults;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue