Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Semantic highlight
daniloz:
--- Quote from: mistar on June 06, 2012, 12:02:29 am ---Hi guys!
I'm almost done with the very basic real-time semantic highlighter (first parsing is quite slow, that is, 4s but next ones highlight sources quite fast, i.e., below 0.5s on my Pentium Dual-Core machine). The plugin crashes sometimes so I'm not going to attach the sources, but I'm working on it ;)
...
--- End quote ---
I'm looking forward to try it...
perento:
Its still very earlier to ask but this just pop in my mind and wondered what do you think.
So..what you think on highlighting a member variables and is it possible? Keep the work, please.
mistar:
--- Quote from: perento on June 08, 2012, 02:23:36 am ---Its still very earlier to ask but this just pop in my mind and wondered what do you think.
So..what you think on highlighting a member variables and is it possible? Keep the work, please.
--- End quote ---
It will be possible to highlight differently all different (semantic) kinds of variables, i.e., global, local, member (public/private/static/non-static/...), parameter variables, and similarly for functions.
I have little time now, so my work on SH will be delayed a little bit.
mistar:
Simple question: how to check whether C::B startup is completed? Is there any function for this?
I know there is EVT_APP_STARTUP_DONE event but I need to check whether I am after this event.
For example when I load my plugin via Plugins->Manage plugins, C::B is ready in my OnAttach, but when C::B is loading my plugin on startup, C::B is not ready.
I need this check because:
1. the current C::B version doesn't post EVT_EDITOR_ACTIVATED for all recently-opened editors
2. wxExecute messes up GUI layout when called from within OnEditorActivated (I don't know why) on C::B startup.
mistar:
OK ;)
Sources of the very-very-very preliminary version of SemanticHighlight plugin are attached.
But be warned:
1. The plugin crashes sometimes as I've already mentioned. I suspect that this happens when SH does highlighting on a control and simultaneously the user types some text to that control. I don't know whether there is some way to lock the control during highlighting process, but maybe you know ;) So please, do not use the plugin in its present form while doing important things in C::B!
2. If you change compile options of some target and/or project, SH doesn't notice those changes. It will when we add an event posted on such changes (EVT_PROJECT_TARGETS_MODIFIED is NOT posted on such changes though, in fact there is currently no event posted!).
3. There is no configuration panel yet.
4. On C::B startup, the GUI can be messed a little bit (wxExecute on EVT_EDITOR_ACTIVATED), but if you click on a boundary between panels everything returns to the correct layout.
5. Lines 301 and 302 of SemanticHighlight.cpp have to be adjusted according to your gcc configuration. Otherwise the plugin will work but some identifiers won't be highlighted correctly. These lines are needed in some gcc configurations as libclang doesn't include them in default search directories and then some fatal errors prevent libclang's parser to do entire job.
6. The plugin should work under Windows, but I didn't test it.
7. Please, check your compiler and linker options (libraries may have different names on your system).
Any questions and comments will be appreciated.
EDIT: I forgot: recall that the first parsing process may be quite long (about 4s on my machine).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version