本文整理汇总了TypeScript中atom.DisplayMarkerLayer.getMarkerCount方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DisplayMarkerLayer.getMarkerCount方法的具体用法?TypeScript DisplayMarkerLayer.getMarkerCount怎么用?TypeScript DisplayMarkerLayer.getMarkerCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atom.DisplayMarkerLayer
的用法示例。
在下文中一共展示了DisplayMarkerLayer.getMarkerCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: findIssueTags
// HOVER LISTENER GH40
// TODO #40
// ISSUE TAG FINDER GH33
// search for issue tags in a TextBuffer and apply markers to them
function findIssueTags(
textToSearch: TextEditor,
issuetaglayer: DisplayMarkerLayer
) {
textToSearch.scan(regex1_gh, scanResult => {
var issue_number: number = parseInt(scanResult.match[1]);
// console.log("Found issue tag: " + scanResult.matchText);
// check if there already exists a marker on this layer:
var existing_markers = issuetaglayer.findMarkers({
intersectsBufferRange: scanResult.range
});
for (var marker_to_check of existing_markers) {
if (marker_to_check.isValid() == true) {
// still is valid? don't bother
// console.log(
// "Issue tag #" +
// issue_number +
// " already known: " +
// marker_to_check.getBufferRange()
// );
return;
} else {
// destroy the invalid marker:
marker_to_check.destroy();
}
}
// console.log("Creating marker on " + scanResult.range);
var new_marker = issuetaglayer.markBufferRange(scanResult.range, {
invalidate: "touch"
});
new_marker.setProperties({
minsky: issue_number
});
console.log(
"Created marker for issue #" +
issue_number +
": " +
new_marker.getStartBufferPosition
);
});
console.log(
"issuetaglayer currently has " + issuetaglayer.getMarkerCount() + " items!"
);
}