提交 e19a65aa 编写于 作者: R Roman Safronov 提交者: rsafronov

Added API to access markers

As of now there is no public API to access markers. This PR adds method `editor.getModelMarkers`. Should resolve
https://github.com/Microsoft/monaco-editor/issues/30.
上级 5e6464f0
......@@ -194,6 +194,15 @@ export function setModelMarkers(model: editorCommon.IModel, owner: string, marke
}
}
/**
* Get markers for owner ant/or resource
* @returns {IMarkerData[]} list of markers
* @param filter
*/
export function getModelMarkers(filter: { owner?: string, resource?: URI, take?: number }): IMarkerData[] {
return StaticServices.markerService.get().read(filter);
}
/**
* Get the model that has `uri` if it exists.
*/
......@@ -331,6 +340,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor {
createModel: createModel,
setModelLanguage: setModelLanguage,
setModelMarkers: setModelMarkers,
getModelMarkers: getModelMarkers,
getModels: getModels,
getModel: getModel,
onDidCreateModel: onDidCreateModel,
......
......@@ -833,6 +833,17 @@ declare module monaco.editor {
*/
export function setModelMarkers(model: IModel, owner: string, markers: IMarkerData[]): void;
/**
* Get markers for owner ant/or resource
* @returns {IMarkerData[]} list of markers
* @param filter
*/
export function getModelMarkers(filter: {
owner?: string;
resource?: Uri;
take?: number;
}): IMarkerData[];
/**
* 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.
先完成此消息的编辑!
想要评论请 注册