Ian Bicking: the old part of his blog

Re: Doc Comments

This is a very encouraging implementation of a great idea. It's got a few bugs with setting the background color of an element to white when you start and cancel a comment - try commenting on a code snippet, or on the definitions followed by the dictionary terms.

What I'm really interested in seeing is something like this for a trac changeset in order to facilitate distributed (post-checkin) code reviews. How hard would it be to hook line numbers (or ranges) instead of element-ids?

Comment on Doc Comments
by Michael Urman


You should be able to comment on any block-level element. So if each line is a block level element, then you'd be set. They probably aren't block level elements, though. The comments use a Very Little Language to identify what element they were attached to, anchored on something that can be found globally and hopefully is stable (typically an element with an id). Right now when you double click it walks up the DOM tree to the first block-level element it can find; potentially that could be configurable so you could comment on smaller elements.

Another option would be for the path language to know about named anchors too (I've meant to add this anyway), and for it to also stop on named anchors even if it is looking for a block-level element. And then, if you put a named anchor in every line of your code (nice anyway) it can be commented on that way.

I've actually also thought about Trac as well, as this seems relevent to a lot of what Trac does. So I definitely hope they can work together in some fashion.

# Ian Bicking