Showing D Coverage Results as Overlays in Source Buffer

风格不统一 提交于 2019-12-23 03:32:22

问题


The D language compiler DMD outputs its coverage analysis in a file containing the original source as

| inout(Ix)[] prefix() inout | { 2037| assert(!keys.empty); 2037| final switch (keys.length) | { 000000000| case 1: 000000000| return keys.at!0[]; 2037| case 2: | import std.algorithm.searching : commonPrefix; 2037| return commonPrefix(keys.at!0[], keys.at!1[]); | } | }

that is, the original source where each line has been prefixed by a 10-character column containing the execution count (if relevant).

When opened in Emacs I would like this file to be presented as a read-only version of the original source buffer with an green overlay for the lines exercised at least once and with red overlay for the lines never exercised.

How is this most conveniently implemented in Emacs-Lisp? For instance is there a way to efficiently hide the first 10 characters of each line in a buffer?

See also: https://github.com/flycheck/flycheck/issues/1074

来源:https://stackoverflow.com/questions/39418669/showing-d-coverage-results-as-overlays-in-source-buffer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!