[TxMt] C bundle: Functions with multi-line argument lists

Allan Odgaard throw-away-1 at macromates.com
Sat Jun 9 08:29:39 UTC 2007


On 8. Jun 2007, at 18:51, John Kooker wrote:

> wow, not even for 2.0?

No, not even for 2.0. As said, this is a technical limitation!

If you allow patterns to match more than a single line, you have a  
situation where a change, no matter where it is done in the document,  
can affect every other part of the document.

 From a performance perspective this is bad because technically TM  
would then have to re-parse your entire document, each time you do a  
single change.

Other text editors can live with this, that is, they may re-parse  
from 5 lines above the caret, then after .5s of idle time, re-parse  
the full document, or sometimes they may just leave it to the user to  
fix out-of-sync syntax highlight.

In TextMate the parser is used for more than syntax highlighting, it  
is for example used to decide how to interpret your key strokes, that  
means if the current line is not parsed, TM cannot decode your key  
stroke -- in practice it could rely on outdated information, but that  
leads to a situation where the exact same key sequence can give  
different results (depending on whether or not the parser finished in  
time, or whether or not the outdated information is “good enough”).

Maybe some good heuristics for this can be created, but 2.0 is not  
going to be the “fix all problems ever reported”-release, which your  
reply seems to imply it is.



> On Jun 8, 2007, at 12:40 AM, Allan Odgaard wrote:
>> On 8. Jun 2007, at 02:10, John Kooker wrote:
>>
>>> My C/C++ code doesn't always get parsed correctly, and I think  
>>> I've narrowed the problem down: the bundle doesn't seem to like  
>>> it when my parentheses are on separate lines. An example:
>> Function prototypes are only matched when they are on a single  
>> line. This is a technical limitation of the parser, and unlikely  
>> to go away.





More information about the textmate mailing list