www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - github syntax hilighting

reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
Anyone have any clue why this file is properly syntax-aware:

https://github.com/D-Programming-Language/druntime/blob/master/src/rt/lifetime.d

but this file isn't

https://github.com/D-Programming-Language/druntime/blob/master/src/core/thread.d

I'm still not familiar at all with git or github...

-Steve
Jan 26 2011
next sibling parent Jesse Phillips <jessekphillips+D gmail.com> writes:
Well I found this, but it says the bug was fixed:

http://support.github.com/discussions/site/157-syntax-highlighting-not-working-for-one-file

Steven Schveighoffer Wrote:

 Anyone have any clue why this file is properly syntax-aware:
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/rt/lifetime.d
 
 but this file isn't
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/core/thread.d
 
 I'm still not familiar at all with git or github...
 
 -Steve
Jan 26 2011
prev sibling next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Wednesday, January 26, 2011 07:13:38 Steven Schveighoffer wrote:
 Anyone have any clue why this file is properly syntax-aware:
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/rt/lifet
 ime.d
 
 but this file isn't
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/core/thr
 ead.d
 
 I'm still not familiar at all with git or github...
I don't know, but I've had vim decide that .d files shouldn't be syntax highlighted as D files (and IIRC that's actually somewhat extension-based, so that's just downright weird). Maybe github is having similar issues where it just decides for some reason that a particular file isn't of a particular type an so isn't syntax highlighted. Certainly, I don't see any obvious reason why they're not both properly syntax highlighted. - Jonathan M Davis
Jan 26 2011
prev sibling next sibling parent Brad Roberts <braddr puremagic.com> writes:
On 1/26/2011 7:13 AM, Steven Schveighoffer wrote:
 Anyone have any clue why this file is properly syntax-aware:
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/rt/lifetime.d
 
 but this file isn't
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/core/thread.d
 
 I'm still not familiar at all with git or github...
 
 -Steve
I'm going to guess it's filesize. Totally a guess, but consider that adding highlighting costs additional markup. The file that's not highlighted is over 100k, the file that is is only(!) 62k.
Jan 26 2011
prev sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Wednesday, January 26, 2011 11:21:55 Brad Roberts wrote:
 On 1/26/2011 7:13 AM, Steven Schveighoffer wrote:
 Anyone have any clue why this file is properly syntax-aware:
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/rt/lif
 etime.d
 
 but this file isn't
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/core/t
 hread.d
 
 I'm still not familiar at all with git or github...
 
 -Steve
I'm going to guess it's filesize. Totally a guess, but consider that adding highlighting costs additional markup. The file that's not highlighted is over 100k, the file that is is only(!) 62k.
LOL. It won't even _show_ std.datetime. You may be on to something there. - Jonathan M Davis
Jan 26 2011
parent reply Jacob Carlborg <doob me.com> writes:
On 2011-01-26 20:30, Jonathan M Davis wrote:
 On Wednesday, January 26, 2011 11:21:55 Brad Roberts wrote:
 On 1/26/2011 7:13 AM, Steven Schveighoffer wrote:
 Anyone have any clue why this file is properly syntax-aware:

 https://github.com/D-Programming-Language/druntime/blob/master/src/rt/lif
 etime.d

 but this file isn't

 https://github.com/D-Programming-Language/druntime/blob/master/src/core/t
 hread.d

 I'm still not familiar at all with git or github...

 -Steve
I'm going to guess it's filesize. Totally a guess, but consider that adding highlighting costs additional markup. The file that's not highlighted is over 100k, the file that is is only(!) 62k.
LOL. It won't even _show_ std.datetime. You may be on to something there. - Jonathan M Davis
If github even won't show the file you clearly has too much in one file. More than 34k lines of code (looking at the latest svn), are you kidding me. That's insane, std.datetimem should clearly be a package. I don't know why Andrei and Walter keeps insisting on having so much code in one file It takes about 10 seconds to get syntax highlighting at the bottom of the file in TextMate. -- /Jacob Carlborg
Jan 26 2011
next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 1/26/11, Jacob Carlborg <doob me.com> wrote:
 It takes about 10 seconds to get syntax highlighting at the bottom of
 the file in TextMate.
Takes half a second in Scite, and in Vim I'm not noticing any delays. Incidentally I think I've seen the longest line count per file in Vim's codebase (close to 100k if my memory serves me right).
Jan 26 2011
parent reply Jacob Carlborg <doob me.com> writes:
On 2011-01-26 23:10, Andrej Mitrovic wrote:
 On 1/26/11, Jacob Carlborg<doob me.com>  wrote:
 It takes about 10 seconds to get syntax highlighting at the bottom of
 the file in TextMate.
Takes half a second in Scite, and in Vim I'm not noticing any delays. Incidentally I think I've seen the longest line count per file in Vim's codebase (close to 100k if my memory serves me right).
I would guess it takes 10 seconds because it processes the file as a whole. I would guess vim doesn't do that, but I don't know. -- /Jacob Carlborg
Jan 27 2011
next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 1/27/11, Jacob Carlborg <doob me.com> wrote:
 I would guess it takes 10 seconds because it processes the file as a
 whole. I would guess vim doesn't do that, but I don't know.
I haven't thought of that! Actually Vim's syntax highlighting 'algorithm' is customizable. You can set it up to try highlighting the entire file, or it can do some magic and scan backwards N lines to figure out how to highlight the entire screen. Afaik the D syntax highlighting script doesn't scan the entire file at once, which probably explains the speed. :)
Jan 27 2011
parent Jacob Carlborg <doob me.com> writes:
On 2011-01-27 18:27, Andrej Mitrovic wrote:
 On 1/27/11, Jacob Carlborg<doob me.com>  wrote:
 I would guess it takes 10 seconds because it processes the file as a
 whole. I would guess vim doesn't do that, but I don't know.
I haven't thought of that! Actually Vim's syntax highlighting 'algorithm' is customizable. You can set it up to try highlighting the entire file, or it can do some magic and scan backwards N lines to figure out how to highlight the entire screen. Afaik the D syntax highlighting script doesn't scan the entire file at once, which probably explains the speed. :)
Hehe, is it anything in Vim that isn't customizable. -- /Jacob Carlborg
Jan 28 2011
prev sibling parent Jesse Phillips <jessekphillips+D gmail.com> writes:
Jacob Carlborg Wrote:

 On 2011-01-26 23:10, Andrej Mitrovic wrote:
 On 1/26/11, Jacob Carlborg<doob me.com>  wrote:
 It takes about 10 seconds to get syntax highlighting at the bottom of
 the file in TextMate.
Takes half a second in Scite, and in Vim I'm not noticing any delays. Incidentally I think I've seen the longest line count per file in Vim's codebase (close to 100k if my memory serves me right).
I would guess it takes 10 seconds because it processes the file as a whole. I would guess vim doesn't do that, but I don't know. -- /Jacob Carlborg
Yep, Vim's highlighting is set up to sync on comments, though there is more it could do, this does a pretty good job.
Jan 27 2011
prev sibling parent reply Don <nospam nospam.com> writes:
Jacob Carlborg wrote:
 On 2011-01-26 20:30, Jonathan M Davis wrote:
 On Wednesday, January 26, 2011 11:21:55 Brad Roberts wrote:
 On 1/26/2011 7:13 AM, Steven Schveighoffer wrote:
 Anyone have any clue why this file is properly syntax-aware:

 https://github.com/D-Programming-Language/druntime/blob/master/src/rt/lif 

 etime.d

 but this file isn't

 https://github.com/D-Programming-Language/druntime/blob/master/src/core/t 

 hread.d

 I'm still not familiar at all with git or github...

 -Steve
I'm going to guess it's filesize. Totally a guess, but consider that adding highlighting costs additional markup. The file that's not highlighted is over 100k, the file that is is only(!) 62k.
LOL. It won't even _show_ std.datetime. You may be on to something there. - Jonathan M Davis
If github even won't show the file you clearly has too much in one file. More than 34k lines of code (looking at the latest svn), are you kidding me. That's insane, std.datetimem should clearly be a package. I don't know why Andrei and Walter keeps insisting on having so much code in one file It takes about 10 seconds to get syntax highlighting at the bottom of the file in TextMate.
You can compile the whole of Phobos in that time... <g>
Jan 28 2011
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Friday, January 28, 2011 14:02:34 Don wrote:
 Jacob Carlborg wrote:
 On 2011-01-26 20:30, Jonathan M Davis wrote:
 On Wednesday, January 26, 2011 11:21:55 Brad Roberts wrote:
 On 1/26/2011 7:13 AM, Steven Schveighoffer wrote:
 Anyone have any clue why this file is properly syntax-aware:
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/rt/
 lif
 
 etime.d
 
 but this file isn't
 
 https://github.com/D-Programming-Language/druntime/blob/master/src/cor
 e/t
 
 hread.d
 
 I'm still not familiar at all with git or github...
 
 -Steve
I'm going to guess it's filesize. Totally a guess, but consider that adding highlighting costs additional markup. The file that's not highlighted is over 100k, the file that is is only(!) 62k.
LOL. It won't even _show_ std.datetime. You may be on to something there. - Jonathan M Davis
If github even won't show the file you clearly has too much in one file. More than 34k lines of code (looking at the latest svn), are you kidding me. That's insane, std.datetimem should clearly be a package. I don't know why Andrei and Walter keeps insisting on having so much code in one file It takes about 10 seconds to get syntax highlighting at the bottom of the file in TextMate.
You can compile the whole of Phobos in that time... <g>
LOL. Yeah. Well, I wrote it using gvim, and it handles it just fine. And honestly, in some respects, it's actually easier to deal with it all in one file than it would be if it were split it up. The unittests and documentation are probably 2/3 of the file anyway. So, yeah. It's large. But it works. - Jonathan M Davis
Jan 28 2011