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

Pavan Gunupudi pavan at doe.carleton.ca
Mon Jun 11 16:03:15 UTC 2007


On 9-Jun-07, at 4:29 AM, Allan Odgaard wrote:

> 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”).
>

This is very interesting. But thinking out aloud, what stops TextMate  
from say having two parsers. One to deal with what's on the current  
line and decoding keystrokes etc and another one that runs on the  
whole file during idle time to update information collected from  
function identification and similar things. For example, in Xcode, if  
you break a function declaration into separate lines, it takes a  
short while before that function is added back to the selection list.  
That to me indicates that Xcode could be parsing the whole file when  
it identifies idle time.

Pavan

> 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.
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>
> -- 
> BEGIN-ANTISPAM-VOTING-LINKS
> ------------------------------------------------------
>
> Teach CanIt if this mail (ID 2351690) is spam:
> Spam:        http://134.117.9.7/canit/b.php? 
> i=2351690&m=224725910aff&c=s
> Not spam:    http://134.117.9.7/canit/b.php? 
> i=2351690&m=224725910aff&c=n
> Forget vote: http://134.117.9.7/canit/b.php? 
> i=2351690&m=224725910aff&c=f
> ------------------------------------------------------
> END-ANTISPAM-VOTING-LINKS




More information about the textmate mailing list