synhighlightersql with SQLite support. lazarus / 31-LCL ---------------------------------------------------------------------- taazz · 2012-06-13 15:45 I've extended synhighlightersql.pas file and added support for the Sqlite 3 dialect. I'm attaching the complete unit. as far as I have tested it works as expected. ---------------------------------------------------------------------- Martin_fr · 2012-06-13 19:00 I will take a look at it and comment soon/later. ---------------------------------------------------------------------- JuhaManninen · 2012-06-13 19:08 Quote from: taazz on June 13, 2012, 05:45:54 pmI've extended synhighlightersql.pas file and added support for the Sqlite 3 dialect. I'm attaching the complete unit. A patch would be still better. It makes inspecting and applying your changes easier. Juha ---------------------------------------------------------------------- taazz · 2012-06-13 20:07 Quote from: JuhaManninen on June 13, 2012, 09:08:58 pm A patch would be still better. It makes inspecting and applying your changes easier. Juha I thought so, I'm new to lazarus I haven't used any patch utility in my life and I didn't want to wait until I find some time to learn to post my changes. I might do that too when I have more experience with the patch process probably on different changes though. ---------------------------------------------------------------------- JuhaManninen · 2012-06-13 20:30 http://wiki.lazarus.freepascal.org/Creating_A_Patch ---------------------------------------------------------------------- Martin_fr · 2012-06-15 01:35 From a first glance, it looks ok. Why did you add "{$IFNDEF SYN_CPPB_1}" in: Code: [Select]    {$IFNDEF SYN_CPPB_1} class {$ENDIF}     function GetLanguageName: string; override; There is one other rule: If you submit a patch (or in your case replacement file) for one thing (in your case adding a sql dialect), then avoid any unrelated change. The reason that is important in this case is: http://bugs.freepascal.org/view.php?id=22186 Just in the process to loose all the IFDEF (they have not been maintained, and many do not work anyway). -------------- Anyway in this case it's no problem. I removed the IFDEF part, and applied the rest to my working copy. It looks fine. I will test asap, and then commit it. (May be a couple of days, before I get to it) Thanks for your work ---------------------------------------------------------------------- Martin_fr · 2012-06-15 01:41 Actually... Not sure you added that.... Some of those IFDEF where removed a week or 2 ago. If your copy is from before that change, then it would still contain the old stuff. That's why patches are preferred. Never mind. ---------------------------------------------------------------------- taazz · 2012-06-15 03:19 I haven't add any ifdefs just added one item to the TSQLDialect set the consts and 3 lines of code to populate the internal structures in InitializeKeywordLists method.  Thank you for the link Juha. I will do my best to avoid complete units from now on, although I do not use SVN only the latest installer that has been published this makes it a bit difficult for me to supply patches. I'm sorry for any inconvenience. ---------------------------------------------------------------------- BigChimp · 2012-06-15 05:48 Just a hint: I'd suggest setting up a separate Lazarus+FPC install using SVN (e.g. Lazarus trunk + the fixes 2.6 branch for FPC if doing Lazarus development work). Don't forget to use a separate --primary-config-path so as not to intermingle your "normal" and SVN Lazarus settings (which includes compiler location). (Hint: you can use the fpcup tool *cough* that ludob & I wrote *cough* to make that easy - both installing and keeping up to date; see the third party announcements section on the forum) This way you can submit patches; also, there are a lot of changes/improvements compared to the current release, so that avoids duplicate work (and developers having to figure out how to apply patches to code that may have changed a lot). Thanks a lot for your contribution! ---------------------------------------------------------------------- TheBlackSheep · 2012-06-15 07:17 Hi Martin_fr Sorry for hijacking this thread - I just thought that whilst you're making these changes you could fix this ommision. I needed to write a program to keep code snippets from various sources (pascal, php, SQL, VBA, javascript etc) the other day and noticed that the javascript highlighter isn't shown on the Lazarus Synedit tab (at least in the latest CodeTyphon version which I assume is the same as in the standard sources) - the highlighter source file is there it just isn't registered and doesn't have an icon so I've designed one and it's attached (it just needs adding to the lrs file and the following registration adding to the syneditlazdsgn.pas file;   RegisterUnit('SynHighlighterJScript',@RegisterSynHighlighterJScript); Hopefully whilst you're making the changes for the SQLite addition here you could make these adjustments as well. TheBlackSheep ---------------------------------------------------------------------- Martin_fr · 2012-06-15 10:25 @taazz: Simply keep a backup of the original file. Then use "WinMerge" to compare them and generate a patch @TheBlackSheep: I will look at it. (I will do from this forum thread) In general it is preferred to use the bug tracker for this. That ensures things will not be forgotten (as even if things are real simple, sometimes they need to wait). Imagine I had to keep track of dozens of  forum threads.... As for the original (taazz's) issue, it was ok. Doing code changes there is a point of first asking if it goes in the right direction. If I had not picked it up now, I would have asked to make it a bug entry. ---------------------------------------------------------------------- TheBlackSheep · 2012-06-15 11:05 thanks Martin I was going to finish the application, publish it and then submit the changes to the bugtracker but as you were monitoring this thread (and making some changes anyway)... If I come across anything else I'll submit them via the bugtacker - apologies for short-cutting the system and thanks... TheBlackSheep