Recent

Author Topic: TSynAutoComplete  (Read 12055 times)

Sora-Kun

  • Full Member
  • ***
  • Posts: 162
  • I can smell your presence ...
    • Sora-Kun
TSynAutoComplete
« on: August 24, 2010, 01:09:41 pm »
Hello,
Please, can any one tell me how to use the TSynAutoComplete ?
Thanks  ;D
if nothing suites you, make it your self!
The Revolution, Genesis. The next generation IDE.
If you want to help, PM me.

Made in Lazarus.
Soon, in The WWW.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9869
  • Debugger - SynEdit - and more
    • wiki
Re: TSynAutoComplete
« Reply #1 on: August 24, 2010, 01:41:04 pm »
If you want completion, like in the Lazarus IDE, that is TSynCompletion

You need to configure it in your code, I don't think it has a icon for the designer.


IIRC

TSynAutoComplete .AutoCompleteList=

TokenToMatch
=Expansion1
=Expansion2
OtherTokenToMatch
=OtherExpansion
...

not sure.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9869
  • Debugger - SynEdit - and more
    • wiki
Re: TSynAutoComplete
« Reply #2 on: August 24, 2010, 02:59:15 pm »
I committed an example to SVN

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: TSynAutoComplete
« Reply #3 on: August 24, 2010, 09:34:45 pm »
it says TSynRightGutterPartList missing, is it only working with the svn latest build?
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9869
  • Debugger - SynEdit - and more
    • wiki
Re: TSynAutoComplete
« Reply #4 on: August 24, 2010, 10:29:19 pm »
It compiles fine here.
(I have a separate checkout, so I am not accidentally using a modified version for testing)

You may have to "clean all". Possibly find all *.ppu and *.o files and delete them yourself.

--
Edit:
The example was created with todays SVN, so the LFM is created with all the properties of the latest SVN.
You need at least a recent (max couple of days old) Snapshot.

Or you remove the property by hand from the LFM. Should do no harm
« Last Edit: August 24, 2010, 11:24:09 pm by Martin_fr »

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: TSynAutoComplete
« Reply #5 on: August 26, 2010, 04:41:20 pm »
It didn't compile for me,
so i made a new example,

implementing SQL highlighter and autocompletion on 571 SQL keywords.

Enjoy :)

« Last Edit: August 26, 2010, 05:45:45 pm by Dr4x »
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: TSynAutoComplete
« Reply #6 on: August 26, 2010, 05:46:27 pm »
I added a screenshot so you can see what it does fastly.

Now you can use it Linkos, you have no excuses =)

I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

Sora-Kun

  • Full Member
  • ***
  • Posts: 162
  • I can smell your presence ...
    • Sora-Kun
Re: TSynAutoComplete
« Reply #7 on: August 26, 2010, 08:35:29 pm »
youuuuuuuuuupi !!! Thanx ;) that's awsome !!!
if nothing suites you, make it your self!
The Revolution, Genesis. The next generation IDE.
If you want to help, PM me.

Made in Lazarus.
Soon, in The WWW.

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TSynAutoComplete
« Reply #8 on: November 10, 2010, 07:33:25 am »
I committed an example to SVN

Compiles well, but there is a bug in this example - try to start typing "c" and get the pop up menu opened with ctrl+space (you will get two lines -- computer and constable), then type some letter other than "o" - the list becomes empty - now press enter - the application crashes.

I looked into it and found that the solution is that in "DoSearchPosition" procedure, you should change the last line "APosition := 0;" with these lines:
Code: [Select]
 if SynCompletion.ItemList.Count > 0 then
    APosition := 0
  else
    APosition := -1;

The same applies to FabienWang's example too. :)
« Last Edit: November 10, 2010, 07:55:18 am by Zoran »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9869
  • Debugger - SynEdit - and more
    • wiki
Re: TSynAutoComplete
« Reply #9 on: November 10, 2010, 09:51:00 am »
Thanks, fixed in rev 28176

In future better create a bug report, on the forum it is to easy to miss

As a result now there is:
http://bugs.freepascal.org/view.php?id=17895

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TSynAutoComplete
« Reply #10 on: November 10, 2010, 11:43:23 am »
Thanks, fixed in rev 28176

In future better create a bug report, on the forum it is to easy to miss

Sorry.

And... I found a new problem with TSynCompletion already: http://bugs.freepascal.org/view.php?id=17898.

 

TinyPortal © 2005-2018