Opened 14 years ago
Last modified 10 years ago
#9655 new enhancement
Source code navigation in browser
Reported by: | Itamar Oren | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | version control/browser | Version: | |
Severity: | normal | Keywords: | mimeview postprocessing |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
It would be very cool if when viewing source code in Trac source browser, it will render the language elements (e.g. functions, methods, classes, module imports / includes) as links to where they are defined (like most IDEs).
The lacking of this is the only reason that my team uses SlickEdit for code-reviews, and not Trac browser. (well, this and the ability to annotate the reviewed code with comments, but that's another enhancement request).
Now, I assume this is a heavy feature (language awareness?!), but thought I'd raise it anyway. Maybe it can be done partially using other libraries (I guess Pygments is doing something similar, syntax-analysis or something of that sort).
Attachments (1)
Change History (5)
comment:1 by , 14 years ago
Milestone: | → 0.13 |
---|
by , 14 years ago
Attachment: | 9655-proof-of-concept.patch added |
---|
to follow up on comment:1 and get this started…
comment:2 by , 14 years ago
Owner: | set to |
---|
comment:3 by , 14 years ago
Milestone: | 0.13 → next-major-0.1X |
---|
I have a more advanced patch but I hit the limitations of this approach. Lexical analysis as done by Pygments can only provide you with a list of identifiers, and this is only half-way useful (i.e. you get no robust class / method relationship for example).
So to implement that "for real", we'd need to have components able to do syntactic analysis (and eventually cache the result).
comment:4 by , 10 years ago
Owner: | removed |
---|
That's a very cool idea … and I thought about doing exactly that myself a few dozen times already :-) So let's get around to it.
Using Pygments would indeed be the most logical way. We would just need to put something back in the mimeview Context hints (say a "tableofcontent" entry containing the already formatted TOC… or even just the structured tree with links, so that we could reuse it for other purposes), and add ids in the output as appropriate.