Recent

Author Topic: How to color table aliases using TSynSQLSyn?  (Read 913 times)

LeoBruno

  • Jr. Member
  • **
  • Posts: 61
How to color table aliases using TSynSQLSyn?
« on: August 07, 2022, 04:15:22 pm »
Hi:

I'm trying to find the correct property to do this, but I'm not beeing able to do it.

Is this possible?

Please take a look at the Attached image.
Lazarus 2.2.2 FPC 3.2.2 Windows (qt5) Anchor Docking

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: How to color table aliases using TSynSQLSyn?
« Reply #1 on: August 07, 2022, 04:34:21 pm »
looks like you expect it to take place within the editor of the IDE ?

Those components are active at runtime.


Unless I missed something.
The only true wisdom is knowing you know nothing

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: How to color table aliases using TSynSQLSyn?
« Reply #2 on: August 07, 2022, 05:21:56 pm »
@Jamie: He has a form in the docked designer / look at the tabs

@LeoBruno:
Your best bet is to read the source code.
I didn't see an option, but only had a quick glance.

Code: Pascal  [Select][+][-]
  1.   TtkTokenKind = (tkComment, tkDatatype, tkDefaultPackage, tkException,         // DJLP 2000-08-11
  2.     tkFunction, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace, tkPLSQL,        // DJLP 2000-08-11
  3.     tkSQLPlus, tkString, tkSymbol, tkTableName, tkUnknown, tkVariable);         // DJLP 2000-08-11
  4.  
There isn't any entry that looks like it would be for aliases.


I take it, you don't want to add the alias to the "TableNames" property?

I mean it's the same thing: "select tablename.field" or "select alias.field".
The only diff is, when the alias is defined in the "from" clause.

LeoBruno

  • Jr. Member
  • **
  • Posts: 61
Re: How to color table aliases using TSynSQLSyn?
« Reply #3 on: August 07, 2022, 10:53:29 pm »
Hi:

Thank you for the answer.

It works at design time as well.

looks like you expect it to take place within the editor of the IDE ?

Those components are active at runtime.


Unless I missed something.
Lazarus 2.2.2 FPC 3.2.2 Windows (qt5) Anchor Docking

LeoBruno

  • Jr. Member
  • **
  • Posts: 61
Re: How to color table aliases using TSynSQLSyn?
« Reply #4 on: August 07, 2022, 10:56:07 pm »
Hi:

Thank you for the answer.

I was trying to get as close to an actual sql builder application, and is common to colorize the aliases differently.


@Jamie: He has a form in the docked designer / look at the tabs

@LeoBruno:
Your best bet is to read the source code.
I didn't see an option, but only had a quick glance.

Code: Pascal  [Select][+][-]
  1.   TtkTokenKind = (tkComment, tkDatatype, tkDefaultPackage, tkException,         // DJLP 2000-08-11
  2.     tkFunction, tkIdentifier, tkKey, tkNull, tkNumber, tkSpace, tkPLSQL,        // DJLP 2000-08-11
  3.     tkSQLPlus, tkString, tkSymbol, tkTableName, tkUnknown, tkVariable);         // DJLP 2000-08-11
  4.  
There isn't any entry that looks like it would be for aliases.


I take it, you don't want to add the alias to the "TableNames" property?

I mean it's the same thing: "select tablename.field" or "select alias.field".
The only diff is, when the alias is defined in the "from" clause.
Lazarus 2.2.2 FPC 3.2.2 Windows (qt5) Anchor Docking

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: How to color table aliases using TSynSQLSyn?
« Reply #5 on: August 08, 2022, 10:22:01 am »
well, you can modify the Highlighter ....

 

TinyPortal © 2005-2018