* @param id A unique identifier to the view zone, as returned by the `addZone` call.
*/
removeZone(id: string): void;
/**
* Change a zone's position.
* The editor will rescan the `afterLineNumber` and `afterColumn` properties of a view zone.
*/
layoutZone(id: string): void;
}
/**
* A positioning preference for rendering content widgets.
*/
export enum ContentWidgetPositionPreference {
/**
* Place the content widget exactly at a position
*/
EXACT = 0,
/**
* Place the content widget above a position
*/
ABOVE = 1,
/**
* Place the content widget below a position
*/
BELOW = 2
}
/**
* A position for rendering content widgets.
*/
export interface IContentWidgetPosition {
/**
* Desired position for the content widget.
* `preference` will also affect the placement.
*/
position: IPosition | null;
/**
* Optionally, a range can be provided to further
* define the position of the content widget.
*/
range?: IRange | null;
/**
* Placement preference for position, in order of preference.
*/
preference: ContentWidgetPositionPreference[];
}
/**
* A content widget renders inline with the text and can be easily placed 'near' an editor position.
*/
export interface IContentWidget {
/**
* Render this content widget in a location where it could overflow the editor's view dom node.
*/
allowEditorOverflow?: boolean;
suppressMouseDown?: boolean;
/**
* Get a unique identifier of the content widget.
*/
getId(): string;
/**
* Get the dom node of the content widget.
*/
getDomNode(): HTMLElement;
/**
* Get the placement of the content widget.
* If null is returned, the content widget will be placed off screen.
*/
getPosition(): IContentWidgetPosition | null;
/**
* Optional function that is invoked before rendering
* the content widget. If a dimension is returned the editor will
* attempt to use it.
*/
beforeRender?(): IDimension | null;
/**
* Optional function that is invoked after rendering the content
* widget. Is being invoked with the selected position preference
* or `null` if not rendered.
*/
afterRender?(position: ContentWidgetPositionPreference | null): void;
}
/**
* A positioning preference for rendering overlay widgets.
*/
export enum OverlayWidgetPositionPreference {
/**
* Position the overlay widget in the top right corner
*/
TOP_RIGHT_CORNER = 0,
/**
* Position the overlay widget in the bottom right corner
*/
BOTTOM_RIGHT_CORNER = 1,
/**
* Position the overlay widget in the top center
*/
TOP_CENTER = 2
}
/**
* A position for rendering overlay widgets.
*/
export interface IOverlayWidgetPosition {
/**
* The position preference for the overlay widget.
*/
preference: OverlayWidgetPositionPreference | null;
}
/**
* An overlay widgets renders on top of the text.
*/
export interface IOverlayWidget {
/**
* Get a unique identifier of the overlay widget.
*/
getId(): string;
/**
* Get the dom node of the overlay widget.
*/
getDomNode(): HTMLElement;
/**
* Get the placement of the overlay widget.
* If null is returned, the overlay widget is responsible to place itself.
*/
getPosition(): IOverlayWidgetPosition | null;
}
/**
* Type of hit element with the mouse in the editor.
*/
export enum MouseTargetType {
/**
* Mouse is on top of an unknown element.
*/
UNKNOWN = 0,
/**
* Mouse is on top of the textarea used for input.
*/
TEXTAREA = 1,
/**
* Mouse is on top of the glyph margin
*/
GUTTER_GLYPH_MARGIN = 2,
/**
* Mouse is on top of the line numbers
*/
GUTTER_LINE_NUMBERS = 3,
/**
* Mouse is on top of the line decorations
*/
GUTTER_LINE_DECORATIONS = 4,
/**
* Mouse is on top of the whitespace left in the gutter by a view zone.
*/
GUTTER_VIEW_ZONE = 5,
/**
* Mouse is on top of text in the content.
*/
CONTENT_TEXT = 6,
/**
* Mouse is on top of empty space in the content (e.g. after line text or below last line)
*/
CONTENT_EMPTY = 7,
/**
* Mouse is on top of a view zone in the content.
*/
CONTENT_VIEW_ZONE = 8,
/**
* Mouse is on top of a content widget.
*/
CONTENT_WIDGET = 9,
/**
* Mouse is on top of the decorations overview ruler.
*/
OVERVIEW_RULER = 10,
/**
* Mouse is on top of a scrollbar.
*/
SCROLLBAR = 11,
/**
* Mouse is on top of an overlay widget.
*/
OVERLAY_WIDGET = 12,
/**
* Mouse is outside of the editor.
*/
OUTSIDE_EDITOR = 13
}
/**
* Target hit with the mouse in the editor.
*/
export interface IMouseTarget {
/**
* The target element
*/
readonly element: Element | null;
/**
* The target type
*/
readonly type: MouseTargetType;
/**
* The 'approximate' editor position
*/
readonly position: Position | null;
/**
* Desired mouse column (e.g. when position.column gets clamped to text length -- clicking after text on a line).
*/
readonly mouseColumn: number;
/**
* The 'approximate' editor range
*/
readonly range: Range | null;
/**
* Some extra detail.
*/
readonly detail: any;
}
/**
* A mouse event originating from the editor.
*/
export interface IEditorMouseEvent {
readonly event: IMouseEvent;
readonly target: IMouseTarget;
}
export interface IPartialEditorMouseEvent {
readonly event: IMouseEvent;
readonly target: IMouseTarget | null;
}
/**
* A paste event originating from the editor.
*/
export interface IPasteEvent {
readonly range: Range;
readonly languageId: string | null;
}
export interface IEditorConstructionOptions extends IEditorOptions {
/**
* The initial editor dimension (to avoid measuring the container).
*/
dimension?: IDimension;
/**
* Place overflow widgets inside an external DOM node.
* Defaults to an internal DOM node.
*/
overflowWidgetsDomNode?: HTMLElement;
}
export interface IDiffEditorConstructionOptions extends IDiffEditorOptions {
/**
* The initial editor dimension (to avoid measuring the container).
*/
dimension?: IDimension;
/**
* Place overflow widgets inside an external DOM node.
* Defaults to an internal DOM node.
*/
overflowWidgetsDomNode?: HTMLElement;
/**
* Aria label for original editor.
*/
originalAriaLabel?: string;
/**
* Aria label for modified editor.
*/
modifiedAriaLabel?: string;
/**
* Is the diff editor inside another editor
* Defaults to false
*/
isInEmbeddedEditor?: boolean;
}
/**
* A rich code editor.
*/
export interface ICodeEditor extends IEditor {
/**
* An event emitted when the content of the current model has changed.
* @event
*/
onDidChangeModelContent: IEvent<IModelContentChangedEvent>;
/**
* An event emitted when the language of the current model has changed.
* @event
*/
onDidChangeModelLanguage: IEvent<IModelLanguageChangedEvent>;
/**
* An event emitted when the language configuration of the current model has changed.
* @event
*/
onDidChangeModelLanguageConfiguration: IEvent<IModelLanguageConfigurationChangedEvent>;
/**
* An event emitted when the options of the current model has changed.
* @event
*/
onDidChangeModelOptions: IEvent<IModelOptionsChangedEvent>;
/**
* An event emitted when the configuration of the editor has changed. (e.g. `editor.updateOptions()`)
* @event
*/
onDidChangeConfiguration: IEvent<ConfigurationChangedEvent>;
/**
* An event emitted when the cursor position has changed.
* @event
*/
onDidChangeCursorPosition: IEvent<ICursorPositionChangedEvent>;
/**
* An event emitted when the cursor selection has changed.
* @event
*/
onDidChangeCursorSelection: IEvent<ICursorSelectionChangedEvent>;
/**
* An event emitted when the model of this editor has changed (e.g. `editor.setModel()`).
* @event
*/
onDidChangeModel: IEvent<IModelChangedEvent>;
/**
* An event emitted when the decorations of the current model have changed.
* @event
*/
onDidChangeModelDecorations: IEvent<IModelDecorationsChangedEvent>;
/**
* An event emitted when the text inside this editor gained focus (i.e. cursor starts blinking).
* @event
*/
onDidFocusEditorText(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor lost focus (i.e. cursor stops blinking).
* @event
*/
onDidBlurEditorText(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor or an editor widget gained focus.
* @event
*/
onDidFocusEditorWidget(listener: () => void): IDisposable;
/**
* An event emitted when the text inside this editor or an editor widget lost focus.
* @event
*/
onDidBlurEditorWidget(listener: () => void): IDisposable;
/**
* An event emitted after composition has started.
*/
onDidCompositionStart(listener: () => void): IDisposable;
/**
* An event emitted after composition has ended.
*/
onDidCompositionEnd(listener: () => void): IDisposable;
/**
* An event emitted when editing failed because the editor is read-only.
* @event
*/
onDidAttemptReadOnlyEdit(listener: () => void): IDisposable;
/**
* An event emitted when users paste text in the editor.
* @event
*/
onDidPaste: IEvent<IPasteEvent>;
/**
* An event emitted on a "mouseup".
* @event
*/
onMouseUp: IEvent<IEditorMouseEvent>;
/**
* An event emitted on a "mousedown".
* @event
*/
onMouseDown: IEvent<IEditorMouseEvent>;
/**
* An event emitted on a "contextmenu".
* @event
*/
onContextMenu: IEvent<IEditorMouseEvent>;
/**
* An event emitted on a "mousemove".
* @event
*/
onMouseMove: IEvent<IEditorMouseEvent>;
/**
* An event emitted on a "mouseleave".
* @event
*/
onMouseLeave: IEvent<IPartialEditorMouseEvent>;
/**
* An event emitted on a "keyup".
* @event
*/
onKeyUp: IEvent<IKeyboardEvent>;
/**
* An event emitted on a "keydown".
* @event
*/
onKeyDown: IEvent<IKeyboardEvent>;
/**
* An event emitted when the layout of the editor has changed.
* @event
*/
onDidLayoutChange: IEvent<EditorLayoutInfo>;
/**
* An event emitted when the content width or content height in the editor has changed.
* @event
*/
onDidContentSizeChange: IEvent<IContentSizeChangedEvent>;
/**
* An event emitted when the scroll in the editor has changed.
* @event
*/
onDidScrollChange: IEvent<IScrollEvent>;
/**
* An event emitted when hidden areas change in the editor (e.g. due to folding).
* @event
*/
onDidChangeHiddenAreas: IEvent<void>;
/**
* Saves current view state of the editor in a serializable object.
*/
saveViewState(): ICodeEditorViewState | null;
/**
* Restores the view state of the editor from a serializable object generated by `saveViewState`.
*/
restoreViewState(state: ICodeEditorViewState): void;
/**
* Returns true if the text inside this editor or an editor widget has focus.
*/
hasWidgetFocus(): boolean;
/**
* Get a contribution of this editor.
* @id Unique identifier of the contribution.
* @return The contribution or null if contribution not found.
*/
getContribution<T extends IEditorContribution>(id: string): T;
/**
* Type the getModel() of IEditor.
*/
getModel(): ITextModel | null;
/**
* Sets the current model attached to this editor.
* If the previous model was created by the editor via the value key in the options
* literal object, it will be destroyed. Otherwise, if the previous model was set
* via setModel, or the model key in the options literal object, the previous model
* will not be destroyed.
* It is safe to call setModel(null) to simply detach the current model from the editor.
*/
setModel(model: ITextModel | null): void;
/**
* Gets all the editor computed options.
*/
getOptions(): IComputedEditorOptions;
/**
* Gets a specific editor option.
*/
getOption<T extends EditorOption>(id: T): FindComputedEditorOptionValueById<T>;
/**
* Returns the editor's configuration (without any validation or defaults).
*/
getRawOptions(): IEditorOptions;
/**
* Get value of the current model attached to this editor.
* @see {@link ITextModel.getValue}
*/
getValue(options?: {
preserveBOM: boolean;
lineEnding: string;
}): string;
/**
* Set the value of the current model attached to this editor.
* @see {@link ITextModel.setValue}
*/
setValue(newValue: string): void;
/**
* Get the width of the editor's content.
* This is information that is "erased" when computing `scrollWidth = Math.max(contentWidth, width)`
*/
getContentWidth(): number;
/**
* Get the scrollWidth of the editor's viewport.
*/
getScrollWidth(): number;
/**
* Get the scrollLeft of the editor's viewport.
*/
getScrollLeft(): number;
/**
* Get the height of the editor's content.
* This is information that is "erased" when computing `scrollHeight = Math.max(contentHeight, height)`
*/
getContentHeight(): number;
/**
* Get the scrollHeight of the editor's viewport.
*/
getScrollHeight(): number;
/**
* Get the scrollTop of the editor's viewport.
*/
getScrollTop(): number;
/**
* Change the scrollLeft of the editor's viewport.
*/
setScrollLeft(newScrollLeft: number, scrollType?: ScrollType): void;
/**
* Change the scrollTop of the editor's viewport.
*/
setScrollTop(newScrollTop: number, scrollType?: ScrollType): void;
/**
* Change the scroll position of the editor's viewport.
*/
setScrollPosition(position: INewScrollPosition, scrollType?: ScrollType): void;
/**
* Get an action that is a contribution to this editor.
* @id Unique identifier of the contribution.
* @return The action or null if action not found.
*/
getAction(id: string): IEditorAction;
/**
* Execute a command on the editor.
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
* @param source The source of the call.
* @param command The command to execute
*/
executeCommand(source: string | null | undefined, command: ICommand): void;
/**
* Create an "undo stop" in the undo-redo stack.
*/
pushUndoStop(): boolean;
/**
* Remove the "undo stop" in the undo-redo stack.
*/
popUndoStop(): boolean;
/**
* Execute edits on the editor.
* The edits will land on the undo-redo stack, but no "undo stop" will be pushed.
* @param source The source of the call.
* @param edits The edits to execute.
* @param endCursorState Cursor state after the edits were applied.
*/
executeEdits(source: string | null | undefined, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean;
/**
* Execute multiple (concomitant) commands on the editor.
* @param source The source of the call.
* @param command The commands to execute
*/
executeCommands(source: string | null | undefined, commands: (ICommand | null)[]): void;
/**
* Get all the decorations on a line (filtering out decorations from other editors).
*/
getLineDecorations(lineNumber: number): IModelDecoration[] | null;
/**
* All decorations added through this call will get the ownerId of this editor.
* @see {@link ITextModel.deltaDecorations}
*/
deltaDecorations(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[];
/**
* Get the layout info for the editor.
*/
getLayoutInfo(): EditorLayoutInfo;
/**
* Returns the ranges that are currently visible.
* Does not account for horizontal scrolling.
*/
getVisibleRanges(): Range[];
/**
* Get the vertical position (top offset) for the line w.r.t. to the first line.
*/
getTopForLineNumber(lineNumber: number): number;
/**
* Get the vertical position (top offset) for the position w.r.t. to the first line.
*/
getTopForPosition(lineNumber: number, column: number): number;
/**
* Returns the editor's container dom node
*/
getContainerDomNode(): HTMLElement;
/**
* Returns the editor's dom node
*/
getDomNode(): HTMLElement | null;
/**
* Add a content widget. Widgets must have unique ids, otherwise they will be overwritten.
*/
addContentWidget(widget: IContentWidget): void;
/**
* Layout/Reposition a content widget. This is a ping to the editor to call widget.getPosition()
* and update appropriately.
*/
layoutContentWidget(widget: IContentWidget): void;
/**
* Remove a content widget.
*/
removeContentWidget(widget: IContentWidget): void;
/**
* Add an overlay widget. Widgets must have unique ids, otherwise they will be overwritten.
*/
addOverlayWidget(widget: IOverlayWidget): void;
/**
* Layout/Reposition an overlay widget. This is a ping to the editor to call widget.getPosition()
* and update appropriately.
*/
layoutOverlayWidget(widget: IOverlayWidget): void;
/**
* Remove an overlay widget.
*/
removeOverlayWidget(widget: IOverlayWidget): void;
/**
* Change the view zones. View zones are lost when a new model is attached to the editor.
*/
changeViewZones(callback: (accessor: IViewZoneChangeAccessor) => void): void;
/**
* Get the horizontal position (left offset) for the column w.r.t to the beginning of the line.
* This method works only if the line `lineNumber` is currently rendered (in the editor's viewport).
* Use this method with caution.
*/
getOffsetForColumn(lineNumber: number, column: number): number;
/**
* Force an editor render now.
*/
render(forceRedraw?: boolean): void;
/**
* Get the hit test target at coordinates `clientX` and `clientY`.
* The coordinates are relative to the top-left of the viewport.
*
* @returns Hit test target or null if the coordinates fall outside the editor or the editor has no model.
*/
getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null;
/**
* Get the visible position for `position`.
* The result position takes scrolling into account and is relative to the top left corner of the editor.
* Explanation 1: the results of this method will change for the same `position` if the user scrolls the editor.
* Explanation 2: the results of this method will not change if the container of the editor gets repositioned.
* Warning: the results of this method are inaccurate for positions that are outside the current editor viewport.
*/
getScrolledVisiblePosition(position: IPosition): {
top: number;
left: number;
height: number;
} | null;
/**
* Apply the same font settings as the editor to `target`.
*/
applyFontInfo(target: HTMLElement): void;
setBanner(bannerDomNode: HTMLElement | null, height: number): void;
}
/**
* Information about a line in the diff editor
*/
export interface IDiffLineInformation {
readonly equivalentLineNumber: number;
}
/**
* A rich diff editor.
*/
export interface IDiffEditor extends IEditor {
/**
* @see {@link ICodeEditor.getDomNode}
*/
getDomNode(): HTMLElement;
/**
* An event emitted when the diff information computed by this diff editor has been updated.
* @event
*/
onDidUpdateDiff(listener: () => void): IDisposable;
/**
* Saves current view state of the editor in a serializable object.
*/
saveViewState(): IDiffEditorViewState | null;
/**
* Restores the view state of the editor from a serializable object generated by `saveViewState`.
*/
restoreViewState(state: IDiffEditorViewState): void;
/**
* Type the getModel() of IEditor.
*/
getModel(): IDiffEditorModel | null;
/**
* Sets the current model attached to this editor.
* If the previous model was created by the editor via the value key in the options
* literal object, it will be destroyed. Otherwise, if the previous model was set
* via setModel, or the model key in the options literal object, the previous model
* will not be destroyed.
* It is safe to call setModel(null) to simply detach the current model from the editor.
*/
setModel(model: IDiffEditorModel | null): void;
/**
* Get the `original` editor.
*/
getOriginalEditor(): ICodeEditor;
/**
* Get the `modified` editor.
*/
getModifiedEditor(): ICodeEditor;
/**
* Get the computed diff information.
*/
getLineChanges(): ILineChange[] | null;
/**
* Get information based on computed diff about a line number from the original model.
* If the diff computation is not finished or the model is missing, will return null.
*/
getDiffLineInformationForOriginal(lineNumber: number): IDiffLineInformation | null;
/**
* Get information based on computed diff about a line number from the modified model.
* If the diff computation is not finished or the model is missing, will return null.
*/
getDiffLineInformationForModified(lineNumber: number): IDiffLineInformation | null;
/**
* Update the editor's options after the editor has been created.
*/
updateOptions(newOptions: IDiffEditorOptions): void;
}
export class FontInfo extends BareFontInfo {
readonly _editorStylingBrand: void;
readonly version: number;
readonly isTrusted: boolean;
readonly isMonospace: boolean;
readonly typicalHalfwidthCharacterWidth: number;
readonly typicalFullwidthCharacterWidth: number;
readonly canUseHalfwidthRightwardsArrow: boolean;
readonly spaceWidth: number;
readonly middotWidth: number;
readonly wsmiddotWidth: number;
readonly maxDigitWidth: number;
}
export class BareFontInfo {
readonly _bareFontInfoBrand: void;
readonly zoomLevel: number;
readonly pixelRatio: number;
readonly fontFamily: string;
readonly fontWeight: string;
readonly fontSize: number;
readonly fontFeatureSettings: string;
readonly lineHeight: number;
readonly letterSpacing: number;
}
//compatibility:
export type IReadOnlyModel = ITextModel;
export type IModel = ITextModel;
}
declare namespace monaco.languages {
/**
* Register information about a new language.
*/
export function register(language: ILanguageExtensionPoint): void;
/**
* Get the information of all the registered languages.
*/
export function getLanguages(): ILanguageExtensionPoint[];
export function getEncodedLanguageId(languageId: string): number;
/**
* An event emitted when a language is first time needed (e.g. a model has it set).
* @event
*/
export function onLanguage(languageId: string, callback: () => void): IDisposable;
/**
* Set the editing configuration for a language.
*/
export function setLanguageConfiguration(languageId: string, configuration: LanguageConfiguration): IDisposable;
/**
* A token.
*/
export interface IToken {
startIndex: number;
scopes: string;
}
/**
* The result of a line tokenization.
*/
export interface ILineTokens {
/**
* The list of tokens on the line.
*/
tokens: IToken[];
/**
* The tokenization end state.
* A pointer will be held to this and the object should not be modified by the tokenizer after the pointer is returned.
*/
endState: IState;
}
/**
* The result of a line tokenization.
*/
export interface IEncodedLineTokens {
/**
* The tokens on the line in a binary, encoded format. Each token occupies two array indices. For token i:
* - at offset 2*i => startIndex
* - at offset 2*i + 1 => metadata
* Meta data is in binary format:
* - -------------------------------------------
* 3322 2222 2222 1111 1111 1100 0000 0000
* 1098 7654 3210 9876 5432 1098 7654 3210
* - -------------------------------------------
* bbbb bbbb bfff ffff ffFF FTTT LLLL LLLL
* - -------------------------------------------
* - L = EncodedLanguageId (8 bits): Use `getEncodedLanguageId` to get the encoded ID of a language.
* - T = StandardTokenType (3 bits): Other = 0, Comment = 1, String = 2, RegEx = 4.
* - F = FontStyle (3 bits): None = 0, Italic = 1, Bold = 2, Underline = 4.
* - f = foreground ColorId (9 bits)
* - b = background ColorId (9 bits)
* - The color value for each colorId is defined in IStandaloneThemeData.customTokenColors:
* e.g. colorId = 1 is stored in IStandaloneThemeData.customTokenColors[1]. Color id = 0 means no color,
* id = 1 is for the default foreground color, id = 2 for the default background.
*/
tokens: Uint32Array;
/**
* The tokenization end state.
* A pointer will be held to this and the object should not be modified by the tokenizer after the pointer is returned.
*/
endState: IState;
}
/**
* A "manual" provider of tokens.
*/
export interface TokensProvider {
/**
* The initial state of a language. Will be the state passed in to tokenize the first line.
*/
getInitialState(): IState;
/**
* Tokenize a line given the state at the beginning of the line.
*/
tokenize(line: string, state: IState): ILineTokens;
}
/**
* A "manual" provider of tokens, returning tokens in a binary form.
*/
export interface EncodedTokensProvider {
/**
* The initial state of a language. Will be the state passed in to tokenize the first line.
*/
getInitialState(): IState;
/**
* Tokenize a line given the state at the beginning of the line.
*/
tokenizeEncoded(line: string, state: IState): IEncodedLineTokens;
/**
* Tokenize a line given the state at the beginning of the line.
*/
tokenize?(line: string, state: IState): ILineTokens;
}
/**
* Change the color map that is used for token colors.
* Supported formats (hex): #RRGGBB, $RRGGBBAA, #RGB, #RGBA
*/
export function setColorMap(colorMap: string[] | null): void;
/**
* Set the tokens provider for a language (manual implementation).
*/
export function setTokensProvider(languageId: string, provider: TokensProvider | EncodedTokensProvider | Thenable<TokensProvider | EncodedTokensProvider>): IDisposable;
/**
* Set the tokens provider for a language (monarch implementation).
*/
export function setMonarchTokensProvider(languageId: string, languageDef: IMonarchLanguage | Thenable<IMonarchLanguage>): IDisposable;
/**
* Register a reference provider (used by e.g. reference search).
*/
export function registerReferenceProvider(languageId: string, provider: ReferenceProvider): IDisposable;
/**
* Register a rename provider (used by e.g. rename symbol).
*/
export function registerRenameProvider(languageId: string, provider: RenameProvider): IDisposable;
/**
* Register a signature help provider (used by e.g. parameter hints).
*/
export function registerSignatureHelpProvider(languageId: string, provider: SignatureHelpProvider): IDisposable;
/**
* Register a hover provider (used by e.g. editor hover).
*/
export function registerHoverProvider(languageId: string, provider: HoverProvider): IDisposable;
/**
* Register a document symbol provider (used by e.g. outline).
*/
export function registerDocumentSymbolProvider(languageId: string, provider: DocumentSymbolProvider): IDisposable;
/**
* Register a document highlight provider (used by e.g. highlight occurrences).
*/
export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable;
/**
* Register an linked editing range provider.
*/
export function registerLinkedEditingRangeProvider(languageId: string, provider: LinkedEditingRangeProvider): IDisposable;
/**
* Register a definition provider (used by e.g. go to definition).
*/
export function registerDefinitionProvider(languageId: string, provider: DefinitionProvider): IDisposable;
/**
* Register a implementation provider (used by e.g. go to implementation).
*/
export function registerImplementationProvider(languageId: string, provider: ImplementationProvider): IDisposable;
/**
* Register a type definition provider (used by e.g. go to type definition).
*/
export function registerTypeDefinitionProvider(languageId: string, provider: TypeDefinitionProvider): IDisposable;
/**
* Register a code lens provider (used by e.g. inline code lenses).
*/
export function registerCodeLensProvider(languageId: string, provider: CodeLensProvider): IDisposable;
/**
* Register a code action provider (used by e.g. quick fix).
*/
export function registerCodeActionProvider(languageId: string, provider: CodeActionProvider, metadata?: CodeActionProviderMetadata): IDisposable;
/**
* Register a formatter that can handle only entire models.
*/
export function registerDocumentFormattingEditProvider(languageId: string, provider: DocumentFormattingEditProvider): IDisposable;
/**
* Register a formatter that can handle a range inside a model.
*/
export function registerDocumentRangeFormattingEditProvider(languageId: string, provider: DocumentRangeFormattingEditProvider): IDisposable;
/**
* Register a formatter than can do formatting as the user types.
*/
export function registerOnTypeFormattingEditProvider(languageId: string, provider: OnTypeFormattingEditProvider): IDisposable;
/**
* Register a link provider that can find links in text.
*/
export function registerLinkProvider(languageId: string, provider: LinkProvider): IDisposable;
/**
* Register a completion item provider (use by e.g. suggestions).
*/
export function registerCompletionItemProvider(languageId: string, provider: CompletionItemProvider): IDisposable;
/**
* Register a document color provider (used by Color Picker, Color Decorator).
*/
export function registerColorProvider(languageId: string, provider: DocumentColorProvider): IDisposable;
/**
* Register a folding range provider
*/
export function registerFoldingRangeProvider(languageId: string, provider: FoldingRangeProvider): IDisposable;
/**
* Register a declaration provider
*/
export function registerDeclarationProvider(languageId: string, provider: DeclarationProvider): IDisposable;
/**
* Register a selection range provider
*/
export function registerSelectionRangeProvider(languageId: string, provider: SelectionRangeProvider): IDisposable;
/**
* Register a document semantic tokens provider
*/
export function registerDocumentSemanticTokensProvider(languageId: string, provider: DocumentSemanticTokensProvider): IDisposable;
/**
* Register a document range semantic tokens provider
*/
export function registerDocumentRangeSemanticTokensProvider(languageId: string, provider: DocumentRangeSemanticTokensProvider): IDisposable;
/**
* Register an inline completions provider.
*/
export function registerInlineCompletionsProvider(languageId: string, provider: InlineCompletionsProvider): IDisposable;
/**
* Register an inlay hints provider.
*/
export function registerInlayHintsProvider(languageId: string, provider: InlayHintsProvider): 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[];
/**
* Requested kind of actions to return.
*/
readonly only?: string;
}
/**
* 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.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult<CodeActionList>;
/**
* Given a code action fill in the edit. Will only invoked when missing.
*/
resolveCodeAction?(codeAction: CodeAction, token: CancellationToken): ProviderResult<CodeAction>;
}
/**
* Metadata about the type of code actions that a {@link CodeActionProvider} provides.
*/
export interface CodeActionProviderMetadata {
/**
* List of code action kinds that a {@link CodeActionProvider} may return.
*
* This list is used to determine if a given `CodeActionProvider` should be invoked or not.
* To avoid unnecessary computation, every `CodeActionProvider` should list use `providedCodeActionKinds`. The
* list of kinds may either be generic, such as `["quickfix", "refactor", "source"]`, or list out every kind provided,
* such as `["quickfix.removeLine", "source.fixAll" ...]`.
*/
readonly providedCodeActionKinds?: readonly string[];
}
/**
* Describes how comments for a language work.
*/
export interface CommentRule {
/**
* The line comment token, like `// this is a comment`
*/
lineComment?: string | null;
/**
* The block comment character pair, like `/* block comment */`
*/
blockComment?: CharacterPair | null;
}
/**
* The language configuration interface defines the contract between extensions and
* various editor features, like automatic bracket insertion, automatic indentation etc.
*/
export interface LanguageConfiguration {
/**
* The language's comment settings.
*/
comments?: CommentRule;
/**
* The language's brackets.
* This configuration implicitly affects pressing Enter around these brackets.
*/
brackets?: CharacterPair[];
/**
* The language's word definition.
* If the language supports Unicode identifiers (e.g. JavaScript), it is preferable
* to provide a word definition that uses exclusion of known separators.
* e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number):
* /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
*/
wordPattern?: RegExp;
/**
* The language's indentation settings.
*/
indentationRules?: IndentationRule;
/**
* The language's rules to be evaluated when pressing Enter.
*/
onEnterRules?: OnEnterRule[];
/**
* The language's auto closing pairs. The 'close' character is automatically inserted with the
* 'open' character is typed. If not set, the configured brackets will be used.
*/
autoClosingPairs?: IAutoClosingPairConditional[];
/**
* The language's surrounding pairs. When the 'open' character is typed on a selection, the
* selected string is surrounded by the open and close characters. If not set, the autoclosing pairs
* settings will be used.
*/
surroundingPairs?: IAutoClosingPair[];
/**
* Defines a list of bracket pairs that are colorized depending on their nesting level.
* If not set, the configured brackets will be used.
*/
colorizedBracketPairs?: CharacterPair[];
/**
* Defines what characters must be after the cursor for bracket or quote autoclosing to occur when using the \'languageDefined\' autoclosing setting.
*
* This is typically the set of characters which can not start an expression, such as whitespace, closing brackets, non-unary operators, etc.
*/
autoCloseBefore?: string;
/**
* The language's folding rules.
*/
folding?: FoldingRules;
/**
* **Deprecated** Do not use.
*
* @deprecated Will be replaced by a better API soon.
*/
__electricCharacterSupport?: {
docComment?: IDocComment;
};
}
/**
* Describes indentation rules for a language.
*/
export interface IndentationRule {
/**
* If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).
*/
decreaseIndentPattern: RegExp;
/**
* If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).
*/
increaseIndentPattern: RegExp;
/**
* If a line matches this pattern, then **only the next line** after it should be indented once.
*/
indentNextLinePattern?: RegExp | null;
/**
* If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.
*/
unIndentedLinePattern?: RegExp | null;
}
/**
* Describes language specific folding markers such as '#region' and '#endregion'.
* The start and end regexes will be tested against the contents of all lines and must be designed efficiently:
* - the regex should start with '^'
* - regexp flags (i, g) are ignored
*/
export interface FoldingMarkers {
start: RegExp;
end: RegExp;
}
/**
* Describes folding rules for a language.
*/
export interface FoldingRules {
/**
* Used by the indentation based strategy to decide whether empty lines belong to the previous or the next block.
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
* If not set, `false` is used and empty lines belong to the previous block.
*/
offSide?: boolean;
/**
* Region markers used by the language.
*/
markers?: FoldingMarkers;
}
/**
* Describes a rule to be evaluated when pressing Enter.
*/
export interface OnEnterRule {
/**
* This rule will only execute if the text before the cursor matches this regular expression.
*/
beforeText: RegExp;
/**
* This rule will only execute if the text after the cursor matches this regular expression.
*/
afterText?: RegExp;
/**
* This rule will only execute if the text above the this line matches this regular expression.
*/
previousLineText?: RegExp;
/**
* The action to execute.
*/
action: EnterAction;
}
/**
* Definition of documentation comments (e.g. Javadoc/JSdoc)
*/
export interface IDocComment {
/**
* The string that starts a doc comment (e.g. '/**')
*/
open: string;
/**
* The string that appears on the last line and closes the doc comment (e.g. ' * /').
*/
close?: string;
}
/**
* A tuple of two characters, like a pair of
* opening and closing brackets.
*/
export type CharacterPair = [string, string];
export interface IAutoClosingPair {
open: string;
close: string;
}
export interface IAutoClosingPairConditional extends IAutoClosingPair {
notIn?: string[];
}
/**
* Describes what to do with the indentation when pressing Enter.
*/
export enum IndentAction {
/**
* Insert new line and copy the previous line's indentation.
*/
None = 0,
/**
* Insert new line and indent once (relative to the previous line's indentation).
*/
Indent = 1,
/**
* Insert two new lines:
* - the first one indented which will hold the cursor
* - the second one at the same indentation level
*/
IndentOutdent = 2,
/**
* Insert new line and outdent once (relative to the previous line's indentation).
*/
Outdent = 3
}
/**
* Describes what to do when pressing Enter.
*/
export interface EnterAction {
/**
* Describe what to do with the indentation.
*/
indentAction: IndentAction;
/**
* Describes text to be appended after the new line and after the indentation.
*/
appendText?: string;
/**
* Describes the number of characters to remove from the new line's indentation.
*/
removeText?: number;
}
/**
* The state of the tokenizer between two lines.
* It is useful to store flags such as in multiline comment, etc.
* The model will clone the previous line's state and pass it in to tokenize the next line.
*/
export interface IState {
clone(): IState;
equals(other: IState): boolean;
}
/**
* A provider result represents the values a provider, like the {@link HoverProvider},
* may return. For once this is the actual result type `T`, like `Hover`, or a thenable that resolves
* to that type `T`. In addition, `null` and `undefined` can be returned - either directly or from a
* thenable.
*/
export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
/**
* A hover represents additional information for a symbol or word. Hovers are
* rendered in a tooltip-like widget.
*/
export interface Hover {
/**
* The contents of this hover.
*/
contents: IMarkdownString[];
/**
* The range to which this hover applies. When missing, the
* editor will use the range at the current position or the
* current position itself.
*/
range?: IRange;
}
/**
* The hover provider interface defines the contract between extensions and
* the [hover](https://code.visualstudio.com/docs/editor/intellisense)-feature.
*/
export interface HoverProvider {
/**
* Provide a hover for the given position and document. Multiple hovers at the same
* position will be merged by the editor. A hover can have a range which defaults
* to the word range at the position when omitted.
*/
provideHover(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Hover>;
}
export enum CompletionItemKind {
Method = 0,
Function = 1,
Constructor = 2,
Field = 3,
Variable = 4,
Class = 5,
Struct = 6,
Interface = 7,
Module = 8,
Property = 9,
Event = 10,
Operator = 11,
Unit = 12,
Value = 13,
Constant = 14,
Enum = 15,
EnumMember = 16,
Keyword = 17,
Text = 18,
Color = 19,
File = 20,
Reference = 21,
Customcolor = 22,
Folder = 23,
TypeParameter = 24,
User = 25,
Issue = 26,
Snippet = 27
}
export interface CompletionItemLabel {
label: string;
detail?: string;
description?: string;
}
export enum CompletionItemTag {
Deprecated = 1
}
export enum CompletionItemInsertTextRule {
/**
* Adjust whitespace/indentation of multiline insert texts to
* match the current line indentation.
*/
KeepWhitespace = 1,
/**
* `insertText` is a snippet.
*/
InsertAsSnippet = 4
}
export interface CompletionItemRanges {
insert: IRange;
replace: IRange;
}
/**
* A completion item represents a text snippet that is
* proposed to complete text that is being typed.
*/
export interface CompletionItem {
/**
* The label of this completion item. By default
* this is also the text that is inserted when selecting
* this completion.
*/
label: string | CompletionItemLabel;
/**
* The kind of this completion item. Based on the kind
* an icon is chosen by the editor.
*/
kind: CompletionItemKind;
/**
* A modifier to the `kind` which affect how the item
* is rendered, e.g. Deprecated is rendered with a strikeout
*/
tags?: ReadonlyArray<CompletionItemTag>;
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
*/
detail?: string;
/**
* A human-readable string that represents a doc-comment.
*/
documentation?: string | IMarkdownString;
/**
* A string that should be used when comparing this item
* with other items. When `falsy` the {@link CompletionItem.label label}
* is used.
*/
sortText?: string;
/**
* A string that should be used when filtering a set of
* completion items. When `falsy` the {@link CompletionItem.label label}
* is used.
*/
filterText?: string;
/**
* Select this item when showing. *Note* that only one completion item can be selected and
* that the editor decides which item that is. The rule is that the *first* item of those
* that match best is selected.
*/
preselect?: boolean;
/**
* A string or snippet that should be inserted in a document when selecting
* this completion.
*/
insertText: string;
/**
* Additional rules (as bitmask) that should be applied when inserting
* this completion.
*/
insertTextRules?: CompletionItemInsertTextRule;
/**
* A range of text that should be replaced by this completion item.
*
* Defaults to a range from the start of the {@link TextDocument.getWordRangeAtPosition current word} to the
* current position.
*
* *Note:* The range must be a {@link Range.isSingleLine single line} and it must
* {@link Range.contains contain} the position at which completion has been {@link CompletionItemProvider.provideCompletionItems requested}.
*/
range: IRange | CompletionItemRanges;
/**
* An optional set of characters that when pressed while this completion is active will accept it first and
* then type that character. *Note* that all commit characters should have `length=1` and that superfluous
* characters will be ignored.
*/
commitCharacters?: string[];
/**
* An optional array of additional text edits that are applied when
* selecting this completion. Edits must not overlap with the main edit
* nor with themselves.
*/
additionalTextEdits?: editor.ISingleEditOperation[];
/**
* A command that should be run upon acceptance of this item.
*/
command?: Command;
}
export interface CompletionList {
suggestions: CompletionItem[];
incomplete?: boolean;
dispose?(): void;
}
/**
* How a suggest provider was triggered.
*/
export enum CompletionTriggerKind {
Invoke = 0,
TriggerCharacter = 1,
TriggerForIncompleteCompletions = 2
}
/**
* Contains additional information about the context in which
* {@link CompletionItemProvider.provideCompletionItems completion provider} is triggered.
*/
export interface CompletionContext {
/**
* How the completion was triggered.
*/
triggerKind: CompletionTriggerKind;
/**
* Character that triggered the completion item provider.
*
* `undefined` if provider was not triggered by a character.
*/
triggerCharacter?: string;
}
/**
* The completion item provider interface defines the contract between extensions and
* the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).
*
* When computing *complete* completion items is expensive, providers can optionally implement
* the `resolveCompletionItem`-function. In that case it is enough to return completion
* items with a {@link CompletionItem.label label} from the
* {@link CompletionItemProvider.provideCompletionItems provideCompletionItems}-function. Subsequently,
* when a completion item is shown in the UI and gains focus this provider is asked to resolve
* the item, like adding {@link CompletionItem.documentation doc-comment} or {@link CompletionItem.detail details}.
*/
export interface CompletionItemProvider {
triggerCharacters?: string[];
/**
* Provide completion items for the given position and document.
*/
provideCompletionItems(model: editor.ITextModel, position: Position, context: CompletionContext, token: CancellationToken): ProviderResult<CompletionList>;
/**
* Given a completion item fill in more data, like {@link CompletionItem.documentation doc-comment}
* or {@link CompletionItem.detail details}.
*
* The editor will only resolve a completion item once.
*/
resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;
}
/**
* How an {@link InlineCompletionsProvider inline completion provider} was triggered.
*/
export enum InlineCompletionTriggerKind {
/**
* Completion was triggered automatically while editing.
* It is sufficient to return a single completion item in this case.
*/
Automatic = 0,
/**
* Completion was triggered explicitly by a user gesture.
* Return multiple completion items to enable cycling through them.
*/
Explicit = 1
}
export interface InlineCompletionContext {
/**
* How the completion was triggered.
*/
readonly triggerKind: InlineCompletionTriggerKind;
readonly selectedSuggestionInfo: SelectedSuggestionInfo | undefined;
}
export interface SelectedSuggestionInfo {
range: IRange;
text: string;
isSnippetText: boolean;
completionKind: CompletionItemKind;
}
export interface InlineCompletion {
/**
* The text to insert.
* If the text contains a line break, the range must end at the end of a line.
* If existing text should be replaced, the existing text must be a prefix of the text to insert.
*/
readonly text: string;
/**
* The range to replace.
* Must begin and end on the same line.
*/
readonly range?: IRange;
readonly command?: Command;
}
export interface InlineCompletions<TItem extends InlineCompletion = InlineCompletion> {
readonly items: readonly TItem[];
}
export interface InlineCompletionsProvider<T extends InlineCompletions = InlineCompletions> {
provideInlineCompletions(model: editor.ITextModel, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<T>;
/**
* Will be called when an item is shown.
*/
handleItemDidShow?(completions: T, item: T['items'][number]): void;
/**
* Will be called when a completions list is no longer in use and can be garbage-collected.
*/
freeInlineCompletions(completions: T): void;
}
export interface CodeAction {
title: string;
command?: Command;
edit?: WorkspaceEdit;
diagnostics?: editor.IMarkerData[];
kind?: string;
isPreferred?: boolean;
disabled?: string;
}
export interface CodeActionList extends IDisposable {
readonly actions: ReadonlyArray<CodeAction>;
}
/**
* Represents a parameter of a callable-signature. A parameter can
* have a label and a doc-comment.
*/
export interface ParameterInformation {
/**
* The label of this signature. Will be shown in
* the UI.
*/
label: string | [number, number];
/**
* The human-readable doc-comment of this signature. Will be shown
* in the UI but can be omitted.
*/
documentation?: string | IMarkdownString;
}
/**
* Represents the signature of something callable. A signature
* can have a label, like a function-name, a doc-comment, and
* a set of parameters.
*/
export interface SignatureInformation {
/**
* The label of this signature. Will be shown in
* the UI.
*/
label: string;
/**
* The human-readable doc-comment of this signature. Will be shown
* in the UI but can be omitted.
*/
documentation?: string | IMarkdownString;
/**
* The parameters of this signature.
*/
parameters: ParameterInformation[];
/**
* Index of the active parameter.
*
* If provided, this is used in place of `SignatureHelp.activeSignature`.
*/
activeParameter?: number;
}
/**
* Signature help represents the signature of something
* callable. There can be multiple signatures but only one
* active and only one active parameter.
*/
export interface SignatureHelp {
/**
* One or more signatures.
*/
signatures: SignatureInformation[];
/**
* The active signature.
*/
activeSignature: number;
/**
* The active parameter of the active signature.
*/
activeParameter: number;
}
export interface SignatureHelpResult extends IDisposable {
value: SignatureHelp;
}
export enum SignatureHelpTriggerKind {
Invoke = 1,
TriggerCharacter = 2,
ContentChange = 3
}
export interface SignatureHelpContext {
readonly triggerKind: SignatureHelpTriggerKind;
readonly triggerCharacter?: string;
readonly isRetrigger: boolean;
readonly activeSignatureHelp?: SignatureHelp;
}
/**
* The signature help provider interface defines the contract between extensions and
* the [parameter hints](https://code.visualstudio.com/docs/editor/intellisense)-feature.
*/
export interface SignatureHelpProvider {
readonly signatureHelpTriggerCharacters?: ReadonlyArray<string>;
readonly signatureHelpRetriggerCharacters?: ReadonlyArray<string>;
/**
* Provide help for the signature at the given position and document.
*/
provideSignatureHelp(model: editor.ITextModel, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelpResult>;
}
/**
* A document highlight kind.
*/
export enum DocumentHighlightKind {
/**
* A textual occurrence.
*/
Text = 0,
/**
* Read-access of a symbol, like reading a variable.
*/
Read = 1,
/**
* Write-access of a symbol, like writing to a variable.
*/
Write = 2
}
/**
* A document highlight is a range inside a text document which deserves
* special attention. Usually a document highlight is visualized by changing
* the background color of its range.
*/
export interface DocumentHighlight {
/**
* The range this highlight applies to.
*/
range: IRange;
/**
* The highlight kind, default is {@link DocumentHighlightKind.Text text}.
*/
kind?: DocumentHighlightKind;
}
/**
* The document highlight provider interface defines the contract between extensions and
* the word-highlight-feature.
*/
export interface DocumentHighlightProvider {
/**
* Provide a set of document highlights, like all occurrences of a variable or
* all exit-points of a function.
*/
provideDocumentHighlights(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;
}
/**
* The linked editing range provider interface defines the contract between extensions and
* the linked editing feature.
*/
export interface LinkedEditingRangeProvider {
/**
* Provide a list of ranges that can be edited together.
*/
provideLinkedEditingRanges(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;
}
/**
* Represents a list of ranges that can be edited together along with a word pattern to describe valid contents.
*/
export interface LinkedEditingRanges {
/**
* A list of ranges that can be edited together. The ranges must have
* identical length and text content. The ranges cannot overlap
*/
ranges: IRange[];
/**
* An optional word pattern that describes valid contents for the given ranges.
* If no pattern is provided, the language configuration's word pattern will be used.
*/
wordPattern?: RegExp;
}
/**
* Value-object that contains additional information when
* requesting references.
*/
export interface ReferenceContext {
/**
* Include the declaration of the current symbol.
*/
includeDeclaration: boolean;
}
/**
* The reference provider interface defines the contract between extensions and
* the [find references](https://code.visualstudio.com/docs/editor/editingevolved#_peek)-feature.
*/
export interface ReferenceProvider {
/**
* Provide a set of project-wide references for the given position and document.
*/
provideReferences(model: editor.ITextModel, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;
}
/**
* Represents a location inside a resource, such as a line
* inside a text file.
*/
export interface Location {
/**
* The resource identifier of this location.
*/
uri: Uri;
/**
* The document range of this locations.
*/
range: IRange;
}
export interface LocationLink {
/**
* A range to select where this link originates from.
*/
originSelectionRange?: IRange;
/**
* The target uri this link points to.
*/
uri: Uri;
/**
* The full range this link points to.
*/
range: IRange;
/**
* A range to select this link points to. Must be contained
* in `LocationLink.range`.
*/
targetSelectionRange?: IRange;
}
export type Definition = Location | Location[] | LocationLink[];
/**
* The definition provider interface defines the contract between extensions and
* the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)
* and peek definition features.
*/
export interface DefinitionProvider {
/**
* Provide the definition of the symbol at the given position and document.
*/
provideDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
* The definition provider interface defines the contract between extensions and
* the [go to definition](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition)
* and peek definition features.
*/
export interface DeclarationProvider {
/**
* Provide the declaration of the symbol at the given position and document.
*/
provideDeclaration(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
* The implementation provider interface defines the contract between extensions and
* the go to implementation feature.
*/
export interface ImplementationProvider {
/**
* Provide the implementation of the symbol at the given position and document.
*/
provideImplementation(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
* The type definition provider interface defines the contract between extensions and
* the go to type definition feature.
*/
export interface TypeDefinitionProvider {
/**
* Provide the type definition of the symbol at the given position and document.
*/
provideTypeDefinition(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<Definition | LocationLink[]>;
}
/**
* A symbol kind.
*/
export enum SymbolKind {
File = 0,
Module = 1,
Namespace = 2,
Package = 3,
Class = 4,
Method = 5,
Property = 6,
Field = 7,
Constructor = 8,
Enum = 9,
Interface = 10,
Function = 11,
Variable = 12,
Constant = 13,
String = 14,
Number = 15,
Boolean = 16,
Array = 17,
Object = 18,
Key = 19,
Null = 20,
EnumMember = 21,
Struct = 22,
Event = 23,
Operator = 24,
TypeParameter = 25
}
export enum SymbolTag {
Deprecated = 1
}
export interface DocumentSymbol {
name: string;
detail: string;
kind: SymbolKind;
tags: ReadonlyArray<SymbolTag>;
containerName?: string;
range: IRange;
selectionRange: IRange;
children?: DocumentSymbol[];
}
/**
* The document symbol provider interface defines the contract between extensions and
* the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_go-to-symbol)-feature.
*/
export interface DocumentSymbolProvider {
displayName?: string;
/**
* Provide symbol information for the given document.
*/
provideDocumentSymbols(model: editor.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
}
export type TextEdit = {
range: IRange;
text: string;
eol?: editor.EndOfLineSequence;
};
/**
* Interface used to format a model
*/
export interface FormattingOptions {
/**
* Size of a tab in spaces.
*/
tabSize: number;
/**
* Prefer spaces over tabs.
*/
insertSpaces: boolean;
}
/**
* The document formatting provider interface defines the contract between extensions and
* the formatting-feature.
*/
export interface DocumentFormattingEditProvider {
readonly displayName?: string;
/**
* Provide formatting edits for a whole document.
*/
provideDocumentFormattingEdits(model: editor.ITextModel, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}
/**
* The document formatting provider interface defines the contract between extensions and
* the formatting-feature.
*/
export interface DocumentRangeFormattingEditProvider {
readonly displayName?: string;
/**
* Provide formatting edits for a range in a document.
*
* The given range is a hint and providers can decide to format a smaller
* or larger range. Often this is done by adjusting the start and end
* of the range to full syntax nodes.
*/
provideDocumentRangeFormattingEdits(model: editor.ITextModel, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}
/**
* The document formatting provider interface defines the contract between extensions and
* the formatting-feature.
*/
export interface OnTypeFormattingEditProvider {
autoFormatTriggerCharacters: string[];
/**
* Provide formatting edits after a character has been typed.
*
* The given position and character should hint to the provider
* what range the position to expand to, like find the matching `{`
* when `}` has been entered.
*/
provideOnTypeFormattingEdits(model: editor.ITextModel, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}
/**
* A link inside the editor.
*/
export interface ILink {
range: IRange;
url?: Uri | string;
tooltip?: string;
}
export interface ILinksList {
links: ILink[];
dispose?(): void;
}
/**
* A provider of links.
*/
export interface LinkProvider {
provideLinks(model: editor.ITextModel, token: CancellationToken): ProviderResult<ILinksList>;
resolveLink?: (link: ILink, token: CancellationToken) => ProviderResult<ILink>;
}
/**
* A color in RGBA format.
*/
export interface IColor {
/**
* The red component in the range [0-1].
*/
readonly red: number;
/**
* The green component in the range [0-1].
*/
readonly green: number;
/**
* The blue component in the range [0-1].
*/
readonly blue: number;
/**
* The alpha component in the range [0-1].
*/
readonly alpha: number;
}
/**
* String representations for a color
*/
export interface IColorPresentation {
/**
* The label of this color presentation. It will be shown on the color
* picker header. By default this is also the text that is inserted when selecting
* this color presentation.
*/
label: string;
/**
* An {@link TextEdit edit} which is applied to a document when selecting
* this presentation for the color.
*/
textEdit?: TextEdit;
/**
* An optional array of additional {@link TextEdit text edits} that are applied when
* selecting this color presentation.
*/
additionalTextEdits?: TextEdit[];
}
/**
* A color range is a range in a text model which represents a color.
*/
export interface IColorInformation {
/**
* The range within the model.
*/
range: IRange;
/**
* The color represented in this range.
*/
color: IColor;
}
/**
* A provider of colors for editor models.
*/
export interface DocumentColorProvider {
/**
* Provides the color ranges for a specific model.
*/
provideDocumentColors(model: editor.ITextModel, token: CancellationToken): ProviderResult<IColorInformation[]>;
/**
* Provide the string representations for a color.
*/
provideColorPresentations(model: editor.ITextModel, colorInfo: IColorInformation, token: CancellationToken): ProviderResult<IColorPresentation[]>;
}
export interface SelectionRange {
range: IRange;
}
export interface SelectionRangeProvider {
/**
* Provide ranges that should be selected from the given position.
*/
provideSelectionRanges(model: editor.ITextModel, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[][]>;
}
export interface FoldingContext {
}
/**
* A provider of folding ranges for editor models.
*/
export interface FoldingRangeProvider {
/**
* An optional event to signal that the folding ranges from this provider have changed.
*/
onDidChange?: IEvent<this>;
/**
* Provides the folding ranges for a specific model.
*/
provideFoldingRanges(model: editor.ITextModel, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;
}
export interface FoldingRange {
/**
* The one-based start line of the range to fold. The folded area starts after the line's last character.
*/
start: number;
/**
* The one-based end line of the range to fold. The folded area ends with the line's last character.
*/
end: number;
/**
* Describes the {@link FoldingRangeKind Kind} of the folding range such as {@link FoldingRangeKind.Comment Comment} or
* {@link FoldingRangeKind.Region Region}. The kind is used to categorize folding ranges and used by commands
* like 'Fold all comments'. See
* {@link FoldingRangeKind} for an enumeration of standardized kinds.
*/
kind?: FoldingRangeKind;
}
export class FoldingRangeKind {
value: string;
/**
* Kind for folding range representing a comment. The value of the kind is 'comment'.
*/
static readonly Comment: FoldingRangeKind;
/**
* Kind for folding range representing a import. The value of the kind is 'imports'.
*/
static readonly Imports: FoldingRangeKind;
/**
* Kind for folding range representing regions (for example marked by `#region`, `#endregion`).
* The value of the kind is 'region'.
*/
static readonly Region: FoldingRangeKind;
/**
* Creates a new {@link FoldingRangeKind}.
*
* @param value of the kind.
*/
constructor(value: string);
}
export interface WorkspaceEditMetadata {
needsConfirmation: boolean;
label: string;
description?: string;
}
export interface WorkspaceFileEditOptions {
overwrite?: boolean;
ignoreIfNotExists?: boolean;
ignoreIfExists?: boolean;
recursive?: boolean;
copy?: boolean;
folder?: boolean;
skipTrashBin?: boolean;
maxSize?: number;
}
export interface WorkspaceFileEdit {
oldUri?: Uri;
newUri?: Uri;
options?: WorkspaceFileEditOptions;
metadata?: WorkspaceEditMetadata;
}
export interface WorkspaceTextEdit {
resource: Uri;
edit: TextEdit;
modelVersionId?: number;
metadata?: WorkspaceEditMetadata;
}
export interface WorkspaceEdit {
edits: Array<WorkspaceTextEdit | WorkspaceFileEdit>;
}
export interface Rejection {
rejectReason?: string;
}
export interface RenameLocation {
range: IRange;
text: string;
}
export interface RenameProvider {
provideRenameEdits(model: editor.ITextModel, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit & Rejection>;
resolveRenameLocation?(model: editor.ITextModel, position: Position, token: CancellationToken): ProviderResult<RenameLocation & Rejection>;
}
export interface Command {
id: string;
title: string;
tooltip?: string;
arguments?: any[];
}
export interface CodeLens {
range: IRange;
id?: string;
command?: Command;
}
export interface CodeLensList {
lenses: CodeLens[];
dispose(): void;
}
export interface CodeLensProvider {
onDidChange?: IEvent<this>;
provideCodeLenses(model: editor.ITextModel, token: CancellationToken): ProviderResult<CodeLensList>;
resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
}
export enum InlayHintKind {
Other = 0,
Type = 1,
Parameter = 2
}
export interface InlayHint {
text: string;
position: IPosition;
kind: InlayHintKind;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;
}
export interface InlayHintsProvider {
onDidChangeInlayHints?: IEvent<void>;
provideInlayHints(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<InlayHint[]>;
}
export interface SemanticTokensLegend {
readonly tokenTypes: string[];
readonly tokenModifiers: string[];
}
export interface SemanticTokens {
readonly resultId?: string;
readonly data: Uint32Array;
}
export interface SemanticTokensEdit {
readonly start: number;
readonly deleteCount: number;
readonly data?: Uint32Array;
}
export interface SemanticTokensEdits {
readonly resultId?: string;
readonly edits: SemanticTokensEdit[];
}
export interface DocumentSemanticTokensProvider {
onDidChange?: IEvent<void>;
getLegend(): SemanticTokensLegend;
provideDocumentSemanticTokens(model: editor.ITextModel, lastResultId: string | null, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
releaseDocumentSemanticTokens(resultId: string | undefined): void;
}
export interface DocumentRangeSemanticTokensProvider {
getLegend(): SemanticTokensLegend;
provideDocumentRangeSemanticTokens(model: editor.ITextModel, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
}
export interface ILanguageExtensionPoint {
id: string;
extensions?: string[];
filenames?: string[];
filenamePatterns?: string[];
firstLine?: string;
aliases?: string[];
mimetypes?: string[];
configuration?: Uri;
}
/**
* A Monarch language definition
*/
export interface IMonarchLanguage {
/**
* map from string to ILanguageRule[]
*/
tokenizer: {
[name: string]: IMonarchLanguageRule[];
};
/**
* is the language case insensitive?
*/
ignoreCase?: boolean;
/**
* is the language unicode-aware? (i.e., /\u{1D306}/)
*/
unicode?: boolean;
/**
* if no match in the tokenizer assign this token class (default 'source')
*/
defaultToken?: string;
/**
* for example [['{','}','delimiter.curly']]
*/
brackets?: IMonarchLanguageBracket[];
/**
* start symbol in the tokenizer (by default the first entry is used)
*/
start?: string;
/**
* attach this to every token class (by default '.' + name)
*/
tokenPostfix?: string;
/**
* include line feeds (in the form of a \n character) at the end of lines
* Defaults to false
*/
includeLF?: boolean;
/**
* Other keys that can be referred to by the tokenizer.
*/
[key: string]: any;
}
/**
* A rule is either a regular expression and an action
* shorthands: [reg,act] == { regex: reg, action: act}
* and : [reg,act,nxt] == { regex: reg, action: act{ next: nxt }}
*/
export type IShortMonarchLanguageRule1 = [string | RegExp, IMonarchLanguageAction];
export type IShortMonarchLanguageRule2 = [string | RegExp, IMonarchLanguageAction, string];
export interface IExpandedMonarchLanguageRule {
/**
* match tokens
*/
regex?: string | RegExp;
/**
* action to take on match
*/
action?: IMonarchLanguageAction;
/**
* or an include rule. include all rules from the included state
*/
include?: string;
}
export type IMonarchLanguageRule = IShortMonarchLanguageRule1 | IShortMonarchLanguageRule2 | IExpandedMonarchLanguageRule;
/**
* An action is either an array of actions...
* ... or a case statement with guards...
* ... or a basic action with a token value.
*/
export type IShortMonarchLanguageAction = string;
export interface IExpandedMonarchLanguageAction {
/**
* array of actions for each parenthesized match group
*/
group?: IMonarchLanguageAction[];
/**
* map from string to ILanguageAction
*/
cases?: Object;
/**
* token class (ie. css class) (or "@brackets" or "@rematch")
*/
token?: string;
/**
* the next state to push, or "@push", "@pop", "@popall"
*/
next?: string;
/**
* switch to this state
*/
switchTo?: string;
/**
* go back n characters in the stream
*/
goBack?: number;
/**
* @open or @close
*/
bracket?: string;
/**
* switch to embedded language (using the mimetype) or get out using "@pop"
*/
nextEmbedded?: string;
/**
* log a message to the browser console window
*/
log?: string;
}
export type IMonarchLanguageAction = IShortMonarchLanguageAction | IExpandedMonarchLanguageAction | IShortMonarchLanguageAction[] | IExpandedMonarchLanguageAction[];
/**
* This interface can be shortened as an array, ie. ['{','}','delimiter.curly']
*/
export interface IMonarchLanguageBracket {
/**
* open bracket
*/
open: string;
/**
* closing bracket
*/
close: string;
/**
* token class
*/
token: string;
}
}
declare namespace monaco.worker {
export interface IMirrorTextModel {
readonly version: number;
}
export interface IMirrorModel extends IMirrorTextModel {
readonly uri: Uri;
readonly version: number;
getValue(): string;
}
export interface IWorkerContext<H = undefined> {
/**
* A proxy to the main thread host object.
*/
host: H;
/**
* Get all available mirror models in this worker.
*/
getMirrorModels(): IMirrorModel[];
}
}
//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.typescript {
export enum ModuleKind {
None = 0,
CommonJS = 1,
AMD = 2,
UMD = 3,
System = 4,
ES2015 = 5,
ESNext = 99
}
export enum JsxEmit {
None = 0,
Preserve = 1,
React = 2,
ReactNative = 3,
ReactJSX = 4,
ReactJSXDev = 5
}
export enum NewLineKind {
CarriageReturnLineFeed = 0,
LineFeed = 1
}
export enum ScriptTarget {
ES3 = 0,
ES5 = 1,
ES2015 = 2,
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ES2019 = 6,
ES2020 = 7,
ESNext = 99,
JSON = 100,
Latest = 99
}
export enum ModuleResolutionKind {
Classic = 1,
NodeJs = 2
}
interface MapLike<T> {
[index: string]: T;
}
type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | null | undefined;
interface CompilerOptions {
allowJs?: boolean;
allowSyntheticDefaultImports?: boolean;
allowUmdGlobalAccess?: boolean;
allowUnreachableCode?: boolean;
allowUnusedLabels?: boolean;
alwaysStrict?: boolean;
baseUrl?: string;
charset?: string;
checkJs?: boolean;
declaration?: boolean;
declarationMap?: boolean;
emitDeclarationOnly?: boolean;
declarationDir?: string;
disableSizeLimit?: boolean;
disableSourceOfProjectReferenceRedirect?: boolean;
downlevelIteration?: boolean;
emitBOM?: boolean;
emitDecoratorMetadata?: boolean;
experimentalDecorators?: boolean;
forceConsistentCasingInFileNames?: boolean;
importHelpers?: boolean;
inlineSourceMap?: boolean;
inlineSources?: boolean;
isolatedModules?: boolean;
jsx?: JsxEmit;
keyofStringsOnly?: boolean;
lib?: string[];
locale?: string;
mapRoot?: string;
maxNodeModuleJsDepth?: number;
module?: ModuleKind;
moduleResolution?: ModuleResolutionKind;
newLine?: NewLineKind;
noEmit?: boolean;
noEmitHelpers?: boolean;
noEmitOnError?: boolean;
noErrorTruncation?: boolean;
noFallthroughCasesInSwitch?: boolean;
noImplicitAny?: boolean;
noImplicitReturns?: boolean;
noImplicitThis?: boolean;
noStrictGenericChecks?: boolean;
noUnusedLocals?: boolean;
noUnusedParameters?: boolean;
noImplicitUseStrict?: boolean;
noLib?: boolean;
noResolve?: boolean;
out?: string;
outDir?: string;
outFile?: string;
paths?: MapLike<string[]>;
preserveConstEnums?: boolean;
preserveSymlinks?: boolean;
project?: string;
reactNamespace?: string;
jsxFactory?: string;
composite?: boolean;
removeComments?: boolean;
rootDir?: string;
rootDirs?: string[];
skipLibCheck?: boolean;
skipDefaultLibCheck?: boolean;
sourceMap?: boolean;
sourceRoot?: string;
strict?: boolean;
strictFunctionTypes?: boolean;
strictBindCallApply?: boolean;
strictNullChecks?: boolean;
strictPropertyInitialization?: boolean;
stripInternal?: boolean;
suppressExcessPropertyErrors?: boolean;
suppressImplicitAnyIndexErrors?: boolean;
target?: ScriptTarget;
traceResolution?: boolean;
resolveJsonModule?: boolean;
types?: string[];
/** Paths used to compute primary types search locations */
typeRoots?: string[];
esModuleInterop?: boolean;
useDefineForClassFields?: boolean;
[option: string]: CompilerOptionsValue | undefined;
}
export interface DiagnosticsOptions {
noSemanticValidation?: boolean;
noSyntaxValidation?: boolean;
noSuggestionDiagnostics?: boolean;
/**
* Limit diagnostic computation to only visible files.
* Defaults to false.
*/
onlyVisible?: boolean;
diagnosticCodesToIgnore?: number[];
}
export interface WorkerOptions {
/** A full HTTP path to a JavaScript file which adds a function `customTSWorkerFactory` to the self inside a web-worker */
customWorkerPath?: string;
}
interface InlayHintsOptions {
readonly includeInlayParameterNameHints?: 'none' | 'literals' | 'all';
readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
readonly includeInlayFunctionParameterTypeHints?: boolean;
readonly includeInlayVariableTypeHints?: boolean;
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
readonly includeInlayEnumMemberValueHints?: boolean;
}
interface IExtraLib {
content: string;
version: number;
}
export interface IExtraLibs {
[path: string]: IExtraLib;
}
/**
* A linked list of formatted diagnostic messages to be used as part of a multiline message.
* It is built from the bottom up, leaving the head to be the "main" diagnostic.
*/
interface DiagnosticMessageChain {
messageText: string;
/** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
category: 0 | 1 | 2 | 3;
code: number;
next?: DiagnosticMessageChain[];
}
export interface Diagnostic extends DiagnosticRelatedInformation {
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
reportsUnnecessary?: {};
reportsDeprecated?: {};
source?: string;
relatedInformation?: DiagnosticRelatedInformation[];
}
export interface DiagnosticRelatedInformation {
/** Diagnostic category: warning = 0, error = 1, suggestion = 2, message = 3 */
category: 0 | 1 | 2 | 3;
code: number;
/** TypeScriptWorker removes all but the `fileName` property to avoid serializing circular JSON structures. */
file: {
fileName: string;
} | undefined;
start: number | undefined;
length: number | undefined;
messageText: string | DiagnosticMessageChain;
}
interface EmitOutput {
outputFiles: OutputFile[];
emitSkipped: boolean;
}
interface OutputFile {
name: string;
writeByteOrderMark: boolean;
text: string;
}
export interface LanguageServiceDefaults {
/**
* Event fired when compiler options or diagnostics options are changed.
*/
readonly onDidChange: IEvent<void>;
/**
* Event fired when extra libraries registered with the language service change.
*/
readonly onDidExtraLibsChange: IEvent<void>;
readonly workerOptions: WorkerOptions;
readonly inlayHintsOptions: InlayHintsOptions;
/**
* Get the current extra libs registered with the language service.
*/
getExtraLibs(): IExtraLibs;
/**
* Add an additional source file to the language service. Use this
* for typescript (definition) files that won't be loaded as editor
* documents, like `jquery.d.ts`.
*
* @param content The file content
* @param filePath An optional file path
* @returns A disposable which will remove the file from the
* language service upon disposal.
*/
addExtraLib(content: string, filePath?: string): IDisposable;
/**
* Remove all existing extra libs and set the additional source
* files to the language service. Use this for typescript definition
* files that won't be loaded as editor documents, like `jquery.d.ts`.
* @param libs An array of entries to register.
*/
setExtraLibs(libs: {
content: string;
filePath?: string;
}[]): void;
/**
* Get current TypeScript compiler options for the language service.
*/
getCompilerOptions(): CompilerOptions;
/**
* Set TypeScript compiler options.
*/
setCompilerOptions(options: CompilerOptions): void;
/**
* Get the current diagnostics options for the language service.
*/
getDiagnosticsOptions(): DiagnosticsOptions;
/**
* Configure whether syntactic and/or semantic validation should
* be performed
*/
setDiagnosticsOptions(options: DiagnosticsOptions): void;
/**
* Configure webworker options
*/
setWorkerOptions(options: WorkerOptions): void;
/**
* No-op.
*/
setMaximumWorkerIdleTime(value: number): void;
/**
* Configure if all existing models should be eagerly sync'd
* to the worker on start or restart.
*/
setEagerModelSync(value: boolean): void;
/**
* Get the current setting for whether all existing models should be eagerly sync'd
* to the worker on start or restart.
*/
getEagerModelSync(): boolean;
/**
* Configure inlay hints options.
*/
setInlayHintsOptions(options: InlayHintsOptions): void;
}
export interface TypeScriptWorker {
/**
* Get diagnostic messages for any syntax issues in the given file.
*/
getSyntacticDiagnostics(fileName: string): Promise<Diagnostic[]>;
/**
* Get diagnostic messages for any semantic issues in the given file.
*/
getSemanticDiagnostics(fileName: string): Promise<Diagnostic[]>;
/**
* Get diagnostic messages for any suggestions related to the given file.
*/
getSuggestionDiagnostics(fileName: string): Promise<Diagnostic[]>;
/**
* Get the content of a given file.
*/
getScriptText(fileName: string): Promise<string | undefined>;
/**
* Get diagnostic messages related to the current compiler options.
* @param fileName Not used
*/
getCompilerOptionsDiagnostics(fileName: string): Promise<Diagnostic[]>;
/**
* Get code completions for the given file and position.
* @returns `Promise<typescript.CompletionInfo | undefined>`
*/
getCompletionsAtPosition(fileName: string, position: number): Promise<any | undefined>;
/**
* Get code completion details for the given file, position, and entry.
* @returns `Promise<typescript.CompletionEntryDetails | undefined>`
*/
getCompletionEntryDetails(fileName: string, position: number, entry: string): Promise<any | undefined>;
/**
* Get signature help items for the item at the given file and position.
* @returns `Promise<typescript.SignatureHelpItems | undefined>`
*/
getSignatureHelpItems(fileName: string, position: number, options: any): Promise<any | undefined>;
/**
* Get quick info for the item at the given position in the file.
* @returns `Promise<typescript.QuickInfo | undefined>`
*/
getQuickInfoAtPosition(fileName: string, position: number): Promise<any | undefined>;
/**
* Get other ranges which are related to the item at the given position in the file (often used for highlighting).
* @returns `Promise<ReadonlyArray<typescript.ReferenceEntry> | undefined>`
*/
getOccurrencesAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
/**
* Get the definition of the item at the given position in the file.
* @returns `Promise<ReadonlyArray<typescript.DefinitionInfo> | undefined>`
*/
getDefinitionAtPosition(fileName: string, position: number): Promise<ReadonlyArray<any> | undefined>;
/**
* Get references to the item at the given position in the file.
* @returns `Promise<typescript.ReferenceEntry[] | undefined>`
*/
getReferencesAtPosition(fileName: string, position: number): Promise<any[] | undefined>;
/**
* Get outline entries for the item at the given position in the file.
* @returns `Promise<typescript.NavigationBarItem[]>`
*/
getNavigationBarItems(fileName: string): Promise<any[]>;
/**
* Get changes which should be applied to format the given file.
* @param options `typescript.FormatCodeOptions`
* @returns `Promise<typescript.TextChange[]>`
*/
getFormattingEditsForDocument(fileName: string, options: any): Promise<any[]>;
/**
* Get changes which should be applied to format the given range in the file.
* @param options `typescript.FormatCodeOptions`
* @returns `Promise<typescript.TextChange[]>`
*/
getFormattingEditsForRange(fileName: string, start: number, end: number, options: any): Promise<any[]>;
/**
* Get formatting changes which should be applied after the given keystroke.
* @param options `typescript.FormatCodeOptions`
* @returns `Promise<typescript.TextChange[]>`
*/
getFormattingEditsAfterKeystroke(fileName: string, postion: number, ch: string, options: any): Promise<any[]>;
/**
* Get other occurrences which should be updated when renaming the item at the given file and position.
* @returns `Promise<readonly typescript.RenameLocation[] | undefined>`
*/
findRenameLocations(fileName: string, positon: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename: boolean): Promise<readonly any[] | undefined>;
/**
* Get edits which should be applied to rename the item at the given file and position (or a failure reason).
* @param options `typescript.RenameInfoOptions`
* @returns `Promise<typescript.RenameInfo>`
*/
getRenameInfo(fileName: string, positon: number, options: any): Promise<any>;
/**
* Get transpiled output for the given file.
* @returns `typescript.EmitOutput`
*/
getEmitOutput(fileName: string): Promise<EmitOutput>;
/**
* Get possible code fixes at the given position in the file.
* @param formatOptions `typescript.FormatCodeOptions`
* @returns `Promise<ReadonlyArray<typescript.CodeFixAction>>`
*/
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: any): Promise<ReadonlyArray<any>>;
/**
* Get inlay hints in the range of the file.
* @param fileName
* @returns `Promise<typescript.InlayHint[]>`
*/
provideInlayHints(fileName: string, start: number, end: number): Promise<ReadonlyArray<any>>;
}
export const typescriptVersion: string;
export const typescriptDefaults: LanguageServiceDefaults;
export const javascriptDefaults: LanguageServiceDefaults;
export const getTypeScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
export const getJavaScriptWorker: () => Promise<(...uris: Uri[]) => Promise<TypeScriptWorker>>;
}
/*---------------------------------------------------------------------------------------------
* 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<LanguageServiceDefaults>;
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<LanguageServiceDefaults>;
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<LanguageServiceDefaults>;
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';
}


Smart Home Statistics
Dashboard
13/01/2015
Annotation Analysis
Event Analysis
Sign Up
Login
Morning
Day
Evening
Night
No Annotation Data


optr ConstructOptr( Handle han, ChunkHandle ch);
This macro constructs an optr type from the given handle (typically a MemHandle) and chunk handle.
See Also: HandleToOptr()
,
OptrToHandle()
,
OptrToChunk()
.
Boolean ContactCompareNumbers( TCHAR *number1, TCHAR *number2);
This function compares two phone number strings for equivalence. It ignores extraneous characters such as spaces. It returns zero if they are the same number, otherwise it returns a non-zero value.
Include: contdb.goh
MemHandle ContactCreateRecordFromTemplate( void );
This function creates a new Contact record in the Contacts database. It returns the handle of the new record. Make any desired changes to the record and then call
ContactSaveRecord()
to save the record or
FoamDBDiscardRecord()
to discard changes.
Include: contdb.goh
See Also: ContactSaveRecord()
,
ContactSetTemplateRecord()
.
FieldID ContactEnsureEmptyField( MemHandle record, optr fieldName, ContdbFieldType fieldType);
This function creates a field in a record, and clears the dat from the existing field of that name if one already existed. This function takes the following arguemnts:
FoamDBGetRecordFromID()
or
ContactCreateRecordFromTemplate()
.
NullOptr
to use the default name for the passed
ContdbFieldType
.Include: contdb.goh
See Also: ContactEnsureField()
,
FoamDBSetFieldData()
.
FieldID ContactEnsureField( MemHandle record, optr fieldName, ContdbFieldType fieldType);
This functionreturns the
FieldID
of a field within a record, or creates the field if it doesn't find it. This function takes the following arguemnts:
FoamDBGetRecordFromID()
or
ContactCreateRecordFromTemplate()
.
NullOptr
to use the default name for the passed
ContdbFieldType
.Include: contdb.goh
See Also: ContactEnsureEmptyField()
,
FoamDBSetFieldData()
.
ContactExportStatus ContactExportDBToTextFile( hptr fileExport, dword startElement, dword numOfRecords);
This function exports the Contact database's data as an ASCII file. On success, the function returns CES_NO_ERROR, otherwise it returns CES_FILE_ERROR. This function takes the following arguments:
RecordID
of the first record to export.To export all the records, pass a startElement of zero and a numOfRecords of CONTACT_EXPORT_ALL_RECORDS.
Include: contdb.goh
See Also: ContactExportDBToTextFile()
.


Hello g70WD cohort-mates (and instructors)! My name is Brian and I'm super excited to meet you all and work together over the next six months (or more)! I grew up in a small farming town in western Illinois, but have lived in Denver for the last twelve years. Though I love the mountains, I'm not much of a skier - I have no proficiency on the powder. I do enjoy a good visit to Blackhawk though. $$$
Over the years I have discovered a number of interests. Please check them out:
I've also been able to determine over the years some things that I do not like. Those include:
My husband and I traveled to China in late September and a few of the highlights we were able to experience are below: (each item is linked to its corresponding wikipedia article providing more information)


abstract datatype: lock()
abstract datatype: ownership()
trx_fun() = fun(() -> term())
| acquire_ownership/1 | |
| acquire_ownership/2 | |
| info/0 | |
| new/0 | |
| release_ownership/1 | |
| transaction/2 | |
| transaction/3 |
acquire_ownership(Lock::lock()) -> {ok, ownership()} | {error, timeout}
acquire_ownership(Lock::lock(), Timeout::timeout()) -> {ok, ownership()} | {error, timeout}
info() -> [{allocated_locks | allocated_ownerships | acquired_locks | contention, non_neg_integer()} | {has_lockfree_counters | has_lockfree_ownership, boolean()}, ...]
new() -> lock()
release_ownership(Ownership::ownership()) -> ok | {error, not_allowed} | {error, already_released}
transaction(Lock::lock(), Fun::trx_fun(), Timeout::timeout()) -> {ok, FunResult::term()} | {error, timeout}
Generated by EDoc, May 1 2017, 02:21:31.


| Current Rank | 10 (3000) |
|---|---|
| Best Rank | 5 (01-01-2010) |
| Most Rank Points | 5000 (01-01-2011) |
| Best Year-End Rank | 10 (2001, 2003) |
| Most Year-End Rank Points | 3450 (2001, 2003) |
| Most Frequent Rank | 10 (20 weeks) |
| Most Frequent Year-End Rank | 10 (3 years) |
| GOAT Rank |
|
| At No. 1 | 50 |
|---|---|
| In Top 5 | 100 |
| In Top 10 | 200 |
| In Top 20 | 300 |
| In Top 50 | 400 |
| In Top 100 | 500 |
| At No. 1 | 1 |
|---|---|
| In Top 5 | 1 |
| In Top 10 | 2 |
| In Top 20 | 3 |
| In Top 50 | 4 |
| In Top 100 | 5 |
| Current Elo Rank | 5 (2210) |
|---|---|
| Best Elo Rank | 5 (01-01-2010) |
| Highest Elo Rating | 2450 (01-01-2011) |
| Best Hard Elo Rank | 5 (01-01-2010) |
| Highest Hard Elo Rating | 2450 (01-01-2011) |
| Best Clay Elo Rank | 5 (01-01-2010) |
| Highest Clay Elo Rating | 2450 (01-01-2011) |
| Best Grass Elo Rank | 5 (01-01-2010) |
| Highest Grass Elo Rating | 2450 (01-01-2011) |
| Best Carpet Elo Rank | 5 (01-01-2010) |
| Highest Carpet Elo Rating | 2450 (01-01-2011) |


Notarize things!
Your request
The content to notarize:
Your token:
Acknowledged! This token was created on {{date}}.
This token does not prove anything.
{{error}}