Recent

Author Topic: SynFacilCompletion highlighter  (Read 18070 times)

Edson

  • Hero Member
  • *****
  • Posts: 1301
SynFacilCompletion highlighter
« on: November 01, 2017, 12:08:32 am »
SynfacilCompletion https://github.com/t-edson/SynFacilCompletion is a SynEdit syntax highlighter with completion code feature.

It' based in SynFacilSyn https://github.com/t-edson/SynFacilSyn and works in the same way, using an external XML file, or programmatically.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: SynFacilCompletion highlighter
« Reply #1 on: November 01, 2017, 07:09:47 pm »
Looks cool, can it do dot completion for SQL that has schemas?
I.e. in postgresql you can define schemas and each schema has it's own tables etc and has a default one called public.

Can it be set to compete on something like public.   where it would then show a list of all the objects in that schema?  with a table icon for tables, function icon for functions etc.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #2 on: November 01, 2017, 07:43:37 pm »
Can it be set to compete on something like public.   where it would then show a list of all the objects in that schema?  with a table icon for tables, function icon for functions etc.

Yes. Just you need a way to indicate the schema to the highlighter.
The completion can be done:
* Using a XML file. In this case the completion lists are static, but can be context aware.
* Implemented by code. So it is free of doing some more complex scan.

Icons can be defined individually for each item.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: SynFacilCompletion highlighter
« Reply #3 on: November 01, 2017, 11:25:25 pm »
looking good. Does it require your highlighter or its included?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #4 on: November 02, 2017, 12:22:58 am »
looking good. Does it require your highlighter or its included?
It's included. The highlighter is a subclass of SynFacilHighlighter.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: SynFacilCompletion highlighter
« Reply #5 on: November 02, 2017, 03:12:14 pm »
Do you have a english versrion of the word documentation file?

Also would you happen to have any SQL completion examples?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: SynFacilCompletion highlighter
« Reply #6 on: November 02, 2017, 04:22:27 pm »
looking good. Does it require your highlighter or its included?
It's included. The highlighter is a subclass of SynFacilHighlighter.
thank you.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: SynFacilCompletion highlighter
« Reply #7 on: November 02, 2017, 04:54:34 pm »
Thanks for sharing.  8)
keep it simple

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #8 on: November 02, 2017, 09:55:54 pm »
Do you have a english versrion of the word documentation file?

Sorry. Just spanish. Maybe someone can translate it.

Also would you happen to have any SQL completion examples?

There is a Syntax File for ORACLE in https://github.com/t-edson/SynFacilUtils/blob/1.21/languages/SQLOracle.xml
It's just static completion. For dynamic completion (like table name or column name) it must be implemented programmatically.

Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

edwinyzh

  • New Member
  • *
  • Posts: 43
Re: SynFacilCompletion highlighter
« Reply #9 on: November 06, 2017, 05:15:15 am »
Great! Well done!

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #10 on: December 30, 2017, 07:34:15 am »
При большом размере файла крах всей программы(( как исправить?
PS: SynEdit Создаю динамически.

With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

//configure highlighter
  hlt := TSynFacilComplet.Create(Self);  //my highlighter
  rSynEdit.Highlighter := hlt;  //optional if we are going to use SelectEditor()
  hlt.LoadFromFile('UnrealScript.xml');  //load syntax
  hlt.SelectEditor(rSynEdit);  //assign to editor
  hlt.IconList := ImageList1;       
« Last Edit: December 30, 2017, 07:41:53 am by BIT »

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #11 on: December 30, 2017, 04:25:15 pm »
With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

What OS/Version are you using?
What Lazarus/FPC version are you using?
What SynFacilCompletion version are you using?

Would you please include a sample project to verify?
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #12 on: December 30, 2017, 07:35:32 pm »
With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

What OS/Version are you using?
What Lazarus/FPC version are you using?
What SynFacilCompletion version are you using?

Would you please include a sample project to verify?
What OS/Version are you using? = Windows 7 64bit
What Lazarus/FPC version are you using? = 1.8.0 32bit
What SynFacilCompletion version are you using? 1.20

Attached a test project http://rgho.st/7JpzWjKln Poured here if you fail to download offer your hosting
« Last Edit: December 30, 2017, 08:01:31 pm by BIT »

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #13 on: December 30, 2017, 10:24:34 pm »
With a large file size, the collapse of the entire program(( how to fix?
PS: SynEdit Create dynamically.

What OS/Version are you using?
What Lazarus/FPC version are you using?
What SynFacilCompletion version are you using?

Would you please include a sample project to verify?

Вообщем ошибка не в размере файла а в символе # где он файле встречает происходит ошибка! Теперь как это исправить?)

In General, the error in size of file and the # symbol where it encounters a file error occurs! Now how to fix it?)

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #14 on: December 31, 2017, 04:01:51 am »
I can see. But the only problem I detect is in the definition of DIRECTIVES, no about the file size.

It seems to be a bug. I need to check it more.

By the moment, you can avoid the crash, including the definition of the attribute DIRECTIVE in the XML file:

Code: XML  [Select][+][-]
  1.    <Attribute Name="DIRECTIVE" ForeCol="#a1a130"></Attribute>
  2.  

And for a better highlighter, modify the definition for DIRECTIVES:

Code: XML  [Select][+][-]
  1.   <Token Start="#" End="" Attribute='DIRECTIVE'> </Token>
  2.  

« Last Edit: December 31, 2017, 04:35:09 am by Edson »
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018