cbpporter Messages: 1406 Registered: September 2007
Ultimate Contributor
So I registered my extension using RegisterCSyntax, added a new entry to the enum and added keywords and identifier names with LoadSyntax within CSyntax::InitKeywords() and...
somehow magically all my sources are highlighted with the proper keywords! I have no idea how it matches the registered extension with the keywords set, but I suspect that out of coincidence the indexes all match up...
I wont be able to use CSyntax forever so it ma be time to inherit form it.
And I need to figure out how colors are loaded, because me using code to overwrite colors only works one time because of the ONCELOCK and then when switching tabs the colors are restored to default.
cbpporter Messages: 1406 Registered: September 2007
Ultimate Contributor
I feel like I need to congratulate you on CodeEditor. It is a very strong and powerful class that has greatly simplified my work. Which isn't surprising in the very least, since U++ components are always good and useful, maybe sometimes not completely intuitive .
I managed to create a minimal yet relatively feature full IDE in 700 lines of code, and this including a custom TreeCtrl::Paint. This IDE does not have the features of a 700 project but of one with thousands of lines of code and this is thanks to CodeEditor! Sure, the code will become larger when I move from enhancing CSyntax to adding a fully new Syntax class for my needs.
This is a slow burning project, but eventually I will need to add things like code browsers, got to/inspect and code completion.
Adding support for life update when changing the using statements (the #include equivalents) will be quite difficult and I'm thinking threads...
unodgs Messages: 1366 Registered: November 2005 Location: Poland
Ultimate Contributor
I'm not worried, just curious I hope you'll post some screenshot here when it's ready.
PS: I tried once to write eclipse plugin - never finished, never tried again
cbpporter Messages: 1406 Registered: September 2007
Ultimate Contributor
Sure, screenshots and eventually opensourced.
The goal of it is not for it to be the greatest IDE ever. It is to offer a relatively high entry standard: not to force people to use random editors and command line, but have a full featured IDE. Eventually someone else might make a better IDE and that's fine!
But until screenshots, it looks like TheIDE . I guess there is no escaping the fact for now .
cbpporter Messages: 1406 Registered: September 2007
Ultimate Contributor
So I finished my first version of the bare bones IDE and of syntax highlighting.
But there is one more feature I need to add: dynamic class name highlighting.
Currently I'm using the UPPNAME colors to highlight class names, but the list of known classes for each tab is different based on which classes you are using.
I need to find a way to:
1. change the list of classes for each tab based on a scan operation done on tab open
2. find some hooks in CodeEditor that would allow me to determine if a "using" statement has been changed and recolor the current tab efficiently.
cbpporter Messages: 1406 Registered: September 2007
Ultimate Contributor
BTW, since CodeEditor is capable of highlighting pretty much everything at various qualities, I suppose it is meant to highlight universal external sources, not U++ sources which are mostly C++.
So it needs to be updated to properly handle BOM files, together with saving the BOM bytes on each save if present at load time.
cbpporter Messages: 1406 Registered: September 2007
Ultimate Contributor
Another thing I did not manage to figure out: when editing things like .h, pairs of #ifdef #endif are joined together by a vertical blue line.
But if I change the extension of the file, the blue line is no longer shown, but the pseudocomment detailing what macro what closed (// #ifdef foo) still appears.
What controls the decision to render the blue line or not.
BTW, since CodeEditor is capable of highlighting pretty much everything at various qualities, I suppose it is meant to highlight universal external sources, not U++ sources which are mostly C++.
So it needs to be updated to properly handle BOM files, together with saving the BOM bytes on each save if present at load time.
I'm going to try and implement this next.
Actually, there is already RM entry for that #1049
Another thing I did not manage to figure out: when editing things like .h, pairs of #ifdef #endif are joined together by a vertical blue line.
But if I change the extension of the file, the blue line is no longer shown, but the pseudocomment detailing what macro what closed (// #ifdef foo) still appears.
What controls the decision to render the blue line or not.
Unfortunately, this part is hardwired into
EditorBar::Paint(Draw& w)
(getting CodeEditor ready for client use was not the primary concern when virtualizing highlighting)
just now spend 10 minutes looking for 'code folding' custom/preference option ...
(after fixing changes I made in wrong function)
it sure would be very handy
would it help if I name myself General Demand, and say I'm high?