Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Semantic highlight
mistar:
--- Quote from: oBFusCATed on May 16, 2012, 10:21:37 pm ---A second for every key press? :)
--- End quote ---
A second after last key press.
In eclipse CDT it's not a problem; if it is done in separate thread then only visual results are delayed a bit.
Besides, there is no way to do this immediately. ;)
Anyway, in my opinion benefits surpass all the inconveniences.
ollydbg:
--- Quote from: mistar on May 16, 2012, 08:11:45 pm ---Hi guys!
Before my work on SemanticHighlight plugin goes on, let me introduce simple SHTool plugin I've just written
to demonstrate what can be achieved. The sources are attached.
This is a very simple tool plugin that colorize the syntax in a semantic way using hardcoded styles that I like
(see the sources).
To revert the styles to original ones just reopen the file.
I've tested it with C::B 10.05 and with latest svn version (with change of sdk version in manifest.xml to 1.13.2).
The plugin works best with project files (with all compiler options and search directories set up correctly).
The plugin links against libclang.so so you have to install clang first.
Also note that parsing a file from scratch takes some time (when editing a file there are some optimizations
so in the final version it should take no more than a second).
Have fun!
--- End quote ---
Hi, nice work.
I just build it under Windows. Here is what I do:
1, Put your source and package under:
--- Code: ---E:\code\cb\cb_trunk\src\plugins\contrib\SHTool
--- End code ---
2, I borrow the clang from Codelite source repo:
--- Code: ---https://codelite.svn.sourceforge.net/svnroot/codelite/trunk/sdk/clang
--- End code ---
And put the folder "clang" in the folder "SHTool"
3, I have create a cbp file for Windows called:SHTool_Win.cbp (see attachment)
4, open the SHTool_Win.cbp, and build it. (the output will be put in E:\code\cb\cb_trunk\src\devel)
5, run the Codeblocks under E:\code\cb\cb_trunk\src\devel, Make sure the clang.dll is in your PATH.
The problem is: I can't see this plugin works when I open a new project, I can see the SHTool plugin is loaded. :(
The editor is not highlighted by SHTool.
ollydbg:
--- Quote from: ollydbg on May 17, 2012, 03:29:14 am ---The problem is: I can't see this plugin works when I open a new project, I can see the SHTool plugin is loaded. :(
The editor is not highlighted by SHTool.
--- End quote ---
Ok, it works now, I need to click the Menu->Plugins->SHTool, it works really NICE.
See the screen shot with semantic highlight below:
Compared with normal editor
oBFusCATed:
Ollydbg: This is not a demonstration of semantic highlight... you have to show a function's body...
mistar:
--- Quote from: ollydbg on May 17, 2012, 03:40:15 am ---
--- Quote from: ollydbg on May 17, 2012, 03:29:14 am ---The problem is: I can't see this plugin works when I open a new project, I can see the SHTool plugin is loaded. :(
The editor is not highlighted by SHTool.
--- End quote ---
Ok, it works now, I need to click the Menu->Plugins->SHTool, it works really NICE.
--- End quote ---
Yes, now this is only a simple tool (when you want to highlight sources just Menu->Plugins->SHTool; I forgot to write it explicitly), not real-time highlighter.
Now it is time to design a framework for real-time SemanticHighlight plugin.
Just a couple of event handlers, provided the events are fired in right order and with all required data... ;)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version