Add `onDidChangeMarkers` (fixes microsoft/monaco-editor#313)

上级 de3b3ac5
......@@ -182,6 +182,14 @@ export function getModelMarkers(filter: { owner?: string, resource?: URI, take?:
return StaticServices.markerService.get().read(filter);
}
/**
* Emitted when markers change for a model.
* @event
*/
export function onDidChangeMarkers(listener: (e: readonly URI[]) => void): IDisposable {
return StaticServices.markerService.get().onMarkerChanged(listener);
}
/**
* Get the model that has `uri` if it exists.
*/
......@@ -339,6 +347,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor {
setModelLanguage: <any>setModelLanguage,
setModelMarkers: <any>setModelMarkers,
getModelMarkers: <any>getModelMarkers,
onDidChangeMarkers: <any>onDidChangeMarkers,
getModels: <any>getModels,
getModel: <any>getModel,
onDidCreateModel: <any>onDidCreateModel,
......
......@@ -898,6 +898,12 @@ declare namespace monaco.editor {
take?: number;
}): IMarker[];
/**
* Emitted when markers change for a model.
* @event
*/
export function onDidChangeMarkers(listener: (e: readonly Uri[]) => void): IDisposable;
/**
* Get the model that has `uri` if it exists.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册