337: Detect script's language for syntax highlighting from #! line.

zhi****@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
1701
I've noticed that reviewboard doesn't detect the language of a script from
the #! line -- it appears to rely on the file extension. Would it be
possible to use the #! line to detect the language type for syntax
highlighting?
chipx86
#1 chipx86
We use Pygments for our syntax highlighting. We can either tell it to guess the type
(in which case it'll likely look at #!) or by file extension. We use the file
extension because Pygments used to be horribly slow with some file types (XML, for
example). I'm not sure if this has since been fixed. We can certainly experiment with
it, but I'd like to add caching of the lexer type for the highlighting before we do
that, so we only have to guess it once.
  • -Type-Defect
    -Priority-Medium
    +Type-Enhancement
    +Priority-Low
    +Component-DiffViewer
chipx86
#2 chipx86
  • +Milestone-Release2.0
david
#3 david
  • +Confirmed
david
#5 david
  • -Milestone-Release2.0
david
#6 david
  • -Confirmed
    +PendingReview
  • +david
david
#7 david

Fixed in release-2.0.x (944a86d). This will ship in 2.0.21 and 2.5. Thanks!

  • -PendingReview
    +Fixed