Recent

Author Topic: [SOLVED] SynFacilCompletion  (Read 3037 times)

scons

  • Full Member
  • ***
  • Posts: 141
[SOLVED] SynFacilCompletion
« on: January 02, 2017, 02:05:00 pm »
Hi all,

When I use this code in the language xml
Code: XML  [Select][+][-]
  1.   <Completion OpenOnKeyUp="false">
  2.     <List IconIndex='3'>
  3.       <Include Attribute="Keyword1"></Include>
  4.     </List>
  5.    </Completion>
  6. ...
  7. <Attribute Name="KEYWORD1" ForeCol="Black" Bold="True"> </Attribute>
  8. ...
  9.   <Identifiers CharsStart= "A..Za..z_" Content = "A..Za..z0..9_">
  10.     <token attribute="Keyword1">
  11.         ADD ABS RAB KAB WC_ELM TC_ELM
  12.     </token>
  13.    </Identifiers>
  14.  
The keywords are not recognized as defined in the token attribute part. Nothing is shown in the completion pop-up.

But when I use this, they do get recognized:
Code: XML  [Select][+][-]
  1.   <Completion OpenOnKeyUp="false">
  2.       <Include Attribute="Keyword1"></Include>
  3.    </Completion>
  4. ...
  5. <Attribute Name="KEYWORD1" ForeCol="Black" Bold="True"> </Attribute>
  6. ...
  7.   <Identifiers CharsStart= "A..Za..z_" Content = "A..Za..z0..9_">
  8.     <token attribute="Keyword1">
  9.         ADD ABS RAB KAB WC_ELM TC_ELM
  10.     </token>
  11.    </Identifiers>
  12.  

If I do this, the Icons nicely show up:
Code: XML  [Select][+][-]
  1.   <Completion OpenOnKeyUp="false">
  2.      <List IconIndex='3'>
  3.          ADD ABS RAB KAB WC_ELM TC_ELM
  4.      </List>
  5.    </Completion>
  6. ...
  7. <Attribute Name="KEYWORD1" ForeCol="Black" Bold="True"> </Attribute>
  8. ...
  9.   <Identifiers CharsStart= "A..Za..z_" Content = "A..Za..z0..9_">
  10.     <token attribute="Keyword1">
  11.         ADD ABS RAB KAB WC_ELM TC_ELM
  12.     </token>
  13.    </Identifiers>
  14.  

Am I doing something wrong in the first code ? (This would be the preferred choice)
I want to show Icons, and use "Keyword1" elements as defined in the token attribute list.

Thanks
« Last Edit: January 02, 2017, 10:29:40 pm by scons »
Windows 10-64bit Lazarus 2.0.12 + FPC 3.2.0

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: SynFacilCompletion
« Reply #1 on: January 02, 2017, 05:42:13 pm »
The tag <Include> is supposed to support IconIndex. Let me check.

Recently I had a philosophical conflict in my thoughts: "To List or To include" that's the dilemma. That's because I am not sure what is the best way to include keywords. If using: <List><include> </list>  or just: <include/>.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: SynFacilCompletion
« Reply #2 on: January 02, 2017, 05:59:55 pm »
Well, the preferred form is using: <OpenOn>  and <include>:

Code: Pascal  [Select][+][-]
  1.   <Completion>
  2.      <OpenOn>
  3.         <Include Attribute="Keyword1" IconIndex='2'></Include>
  4.      </OpenOn>
  5.   </Completion>
  6.  

This work for me.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

scons

  • Full Member
  • ***
  • Posts: 141
Re: [SOLVED] SynFacilCompletion
« Reply #3 on: January 02, 2017, 10:31:02 pm »
Yes, this way it works.

Great component(s) btw !

Thanks
Windows 10-64bit Lazarus 2.0.12 + FPC 3.2.0

 

TinyPortal © 2005-2018