Recent

Author Topic: SynEdit Highlighter: Copy and modify?  (Read 1450 times)

Hen3ry

  • Newbie
  • Posts: 4
SynEdit Highlighter: Copy and modify?
« on: August 28, 2021, 08:44:34 pm »
Hi,

I try to adapt the file synhighlightervb.pas to another BASIC dialect. I do not need it in the IDE, just want to make my own version for the direct use in my application. I copied the renamed file to my project and replaced all "SynVBSyn"  with "SynXBSyn", the new BASIC. I adjusted the include "SynEdit.inc" to the full path in the SynEdit directory.

When I try to compile the otherwise unchanged file I get:

uSynHighlighterXB.pas(53,3) Error: Cannot find LCLIntf used by uSynHighlighterXB. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=C:\Data\lazarus\lcl\units\x86_64-win64\lclintf.ppu. Clean up package "LCLBase"..

Any hints of what I should do? I looks like my whole approach is wrong ...

Thank you
Stefan


jamie

  • Hero Member
  • *****
  • Posts: 6813
Re: SynEdit Highlighter: Copy and modify?
« Reply #1 on: August 28, 2021, 09:54:58 pm »
Yes, so you have discovered that isn't the way to go.

You don't want to be changing paths within files that get used by other code, leave the INC file alone..

Make a copy of the Higher lighter file, name the file something else along with the name of the class so not to touch the original one.

In the project inspector include copy with its new file name and altered class name in the list of required files.

In your project include that new file (unit) in the uses list

 Or you could use the "Any" highlighter and make it the way you want/
The only true wisdom is knowing you know nothing

Edson

  • Hero Member
  • *****
  • Posts: 1322
Re: SynEdit Highlighter: Copy and modify?
« Reply #2 on: August 29, 2021, 02:00:52 am »
Or you can use SynFacilSyn: https://github.com/t-edson/SynFacilSyn

Using it, it's easy to create a new highlighter, including code-folding.

And if you want to include completion-code in your highlighter, use https://github.com/t-edson/SynFacilCompletion
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018