[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] Autocompletion list in the commit dialog

From: Toby Johnson <toby_at_etjohnson.us>
Date: 2005-02-16 23:44:17 CET

Eric J. Smith wrote:

>>So how should we decide which one(s) to use then? I mean the group 0
>>always returns the entire match, not the groups within (and that's
>>sometimes what people want with the regex string). Is there any
>>indication in the string itself what should be used?
>>
>>Maybe we should still add another option to the autolist.txt file. One
>>that tells TSVN to use either the whole match or the individual groups.
>>
>>
>
>I suppose you could add an option to tell it whether to use the full match
>or the groups inside of the match for the auto-complete members, but you
>could also just make them add parens around their entire regex and it should
>work fine.
>
>(\b\w+\b) (Should result in group 0 and group 1 being the exact same
>thing.)
>
>I personally can't think of any syntax where you aren't going to need to
>check some sort of context around what you are trying to get added to the
>auto-complete list, but I guess it's a possibility. I personally wouldn't
>make it an option, but that is up to you.
>
>Also, another thing to note here is that when using captured groups in your
>regex, if you need to do a group (maybe for alternation or something) and
>you don't want it to be captured, then you need to use "(?:". Here is an
>example:
>
>(?:public|private|internal)\s+(\w+)
>
>
I pretty much agree with everything stated here. Simply capture all
non-0 groups into the autocomplete list. No options, no having to parse
the parsed text... regexes are hard enough for some people to wrap their
heads around without complicating it any more!

BTW, if using this strategy (and the MULTILINE flag), the regex for Perl
files becomes simply:

.pl, .pm, .cgi = ^\s*sub\s+(\w+)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed Feb 16 23:45:04 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.