Home Download Buy Blog Forum Support

C++ stops highlighting

C++ stops highlighting

Postby voxmea on Fri Sep 21, 2012 7:48 pm

I've noticed highlighting stops with certain C++ files. For example, if I open llc.cpp from the llvm project it stops highlighting after line 131. Can anyone else reproduce this? Here's the source file:

http://llvm.org/viewvc/llvm-project/llv ... rev=156747

Not sure if it's a plugin issue or a syntax file issue or something else. I'm using build 2219 on Win7 and Win8. Thanks!
voxmea
 
Posts: 28
Joined: Fri Feb 04, 2011 10:02 pm

Re: C++ stops highlighting

Postby DAVe3283 on Wed Oct 03, 2012 3:15 pm

I am seeing this issue as well, but my highlighting stops on line 237 for the file you posted.

I have also seen this in Bash files. Typically the highlighting stops within +/- 50 lines of line 200.

However, I also have a few C++ files that are 3000+ lines in length, and they work fine. I can't immediately see a pattern as to what works and what does not.
DAVe3283
 
Posts: 1
Joined: Wed Oct 03, 2012 3:10 pm

Re: C++ stops highlighting

Postby voxmea on Wed Oct 03, 2012 7:08 pm

Thanks for confirming DAVe3283. I haven't noticed any specific syntax that seems to trigger the issue either.
voxmea
 
Posts: 28
Joined: Fri Feb 04, 2011 10:02 pm

Re: C++ stops highlighting

Postby dursly on Thu Oct 11, 2012 9:47 am

I'm having the same issue with a bash script. Syntax highlighting stops after line 351. I have some functions in the script and the highlighting seems to stop after the 15 function (func_bla). When I type anything but another function after that 15 function, the highlighting is still fine. When I insert some empty functions before that 15th function, it's still fine up until func_bla. I've tried changing several things in func_bla and the function after it, but haven't found a clear cause.

Greets,
Erwin
dursly
 
Posts: 1
Joined: Thu Oct 11, 2012 9:38 am

Re: C++ stops highlighting

Postby facelessuser on Thu Oct 11, 2012 5:23 pm

Usually issues like this are caused by the way a tmLanguage is defined. C/C++ Language does this recursion thing when looking at certain elements on a page. When the internal recursion limit gets hit in ST2, the syntax highlighting aborts.

That is why you are seeing it cut off. The file you referenced is the perfect file to show something like this:

So I grabbed the scope of the last highlighted element, and this is what it is:

Code: Select all
Scope:                    source.c++ meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c meta.parens.c meta.function.c entity.name.function.c


Notice the repeating scopes. This is simply because the tmLanguage is kind of poorly configured. I haven't had a chance to dig in and try and fix this yet, but I have fixed issues like this before in the C/C++ languages specifically.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: C++ stops highlighting

Postby voxmea on Wed Oct 17, 2012 1:02 am

Thanks facelessuser. If I have time, and can figure out a fix, I'll be sure to post it here.
voxmea
 
Posts: 28
Joined: Fri Feb 04, 2011 10:02 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 22 guests