At the moment Scintilla V5 is still regarded as unstable, IIUC it will be V5.1 thats stable "soon".
This issue is to discuss how we should approach the Scintilla V5 changes, the API changes, the Lexilla/Scintilla split, how to make the process scalable, massive single commits are simply not viable.
Then there needs to be a discussion about importing Scintilla/Lexilla it will be done in Geany after the changes to separate Scintilla and Lexilla.
To be blunt, the mechanics of getting the parts Geany uses from the Scintilla repos is the least of a Scintilla upgrade, be it git subprojects or a bash/Python script doesn't matter, its a minor part of the work needed for the upgrade, even now Scintilla and Lexilla are separate. So the simplest for everyone to understand is the best.
The main part of a Scintilla upgrade is the manual work for each lexer:
1. checking if any of the syntactic elements from the lexers have changed, 2. changing the mapping of those to Geany entities in `highlightingmappings.h` 3. adding them to `filetypes.xxx`, 4. checking for any lexer properties that need to be added or removed.
These are manual actions at the moment and make up most of the work creating and reviewing a Scintilla upgrade and are why the upgrades take so long.
IIUC there are some additional scripts or similar that come with Scintilla/Lexilla 5 that may make at least part of that work automatic, identifying changes at least. That needs to be explored to allow supporting the current number of languages to remain viable.
ATM its just too much work and nobody has the time.
Also potentially making Lexilla changes separate from Scintilla would help, IIUC Neil will be issuing them as separate releases in the future, and even better if each filetype could be done by itself. Then whoever is interested in a language can submit a smallish PR that would be easy to review and commit.
Huge commit bombs are simply not viable into the future, thoughts anyone?
I have started working on this. The lexilla split is complicating things though but shouldn't be too much headaches.
Regarding your thoughts, I think I'll do the mechanical part first, then we can see the situation in a v5 world and see how we can improve the import process further. I will need some assistance since I haven't performed a wholesale scintilla upgrade yet.
I would agree with your suggestion to just manually upgrading from Scintilla 3 to Scintilla 5 first, without any changes to process.
Don't even worry about changing the upgrade scripts and stuff to do that major upgrade, its only happening once, just get the first Scintilla 5 Geany working manually, then modify/create scripts to suit a process of small upgrades, hopefully huge upgrades like this will be rare (pending Neil adopting C++20 :open_mouth: )
I am not sure if I will be personally much help, having never done a Scintilla upgrade either, but will try time permitting, and hopefully more experienced heads will chime in.
There's one more twist. SCLEX_* IDs are deprecated, lexers should be instantiated by name. Maybe we can use the deprecated `LexerNameFromID()` function short term but we need to switch to names eventually.
Yeah, I have only had a quick look, but setting lexers by ID is no longer even supported, needs the `ilexer5*` pointer AFAICT. Thats awkward with the big switches in `highlighting.c`. Maybe as you said we can map from id to name to pointer and fill that in using `LexerNameFromID()` and `CreateLexer()` for now, but in the longer term probably need to store the name of the lexer and our internal id (for the switches) in the filetype struct and use that instead of SCILEX_* IDs.
Probably should store the Ilexer5 pointer in the filetype structure with the lexer id after the lexer is constructed.
Closed #2824 via #2867.
github-comments@lists.geany.org