On Tue, 22 May 2007 16:56:00 +0800
Paul Ishenin <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner wrote:
> > On Tue, 22 May 2007 09:53:07 +0200
> > "Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:
> > 
> >> Hi,
> >>
> >> I want to try and implement that feature mentioned in the "New
> >> since Delphi 7..." article.
> >>
> >> When you type 'begin' and press enter, the editor automatically
> >> inserts the blank line and the closing 'end;' keyword. Also it will
> >> use the correct indentation.
> >>
> >> Now I have never done Code Generation with CodeTools, so might need
> >> some hints... I gather CodeTools has the capability for something
> >> like this? 
> > 
> > For simple things like begin/end, class/end we don't need the
> > codetools, but simple text code templates. For more complex tasks
> > you can use macro functions, which can trigger anything including
> > the codetools. See for example $ProcName().
> > 
> > 
> >> I know it must can via Ctrl+J, but can the keyword completion
> >> be triggered automatically?
> > 
> > Not yet. But this is easy to implement. 
> > The above examples (being/end) are triggered by pressing 'return'.
> > Of course not all templates should be triggered by pressing
> > 'return', so every template need an own set of triggers.
> > What about other triggers? For example space, tab, semicolon, ...
> 
> Maybe better to look how delphi store this templates and if possible
> to use that template file. There I think we can find what actions can 
> trigger template insertion.

I only took a short look at some examples, and it seems they invented a
xml format with lots of Delphi IDE specific things. If lazarus tries to
support that, then it needs to add a lot of workarounds and it needs to
add somehow its own functions. IMHO it will be easier to convert the
Delphi templates, then to support the xml format.
Of course we can switch from the current dci text format to some xml
format.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to