Lazarus 1.6.4
FPC 3.0.2
Apple macOS 10.12.5 Sierra
Hello, I am currently working on a code preview utility for the Golang language. As far as I can tell, there is not yet a Syntax component written for Golang, so I have been using the TSynAnySyn component with the Golang keywords loaded, as this works very well. I do play to convert this into a TSynGolangSyn component at some stage, but first things first!
In an attempt to make my application user-friendly, I am adding the ability to edit the foreground and background colours of the various attribute types: CommentAttri, IdentifierAttri and so on. I am now trying to decide how to store and transfer this data as a single data structure. I have noticed in the source of TSynAnySyn, that there is a method called LoadHighlighter which loads the attribute information from a file. However, there is no corresponding SaveHighlighter method to perform the reverse operation. I see also in the ancestor component TSynCustomHighlighter that there are LoadFromFile and SaveToFile methods which could be useful.
The problem I have is that these methods tie me into a particular way of storing the data on disk, whereas what I need is a way of saving the attribute data to an in-memory structure which I can then choose to save in a method of my choosing. Actually, in the course of writing this message, I think I have talked myself out of trying to use the built-in methods, and instead, I think I will roll my own config mechanism. This makes sense because I am already using JSON for some other config information, so it would be neat to use the same approach for the attribute data.
I'm interested to hear anyone's thoughts on this, assuming you've made it through my ramblings!
Thanks,
Carl Caulkett