News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Highlight function

Started by perento, May 09, 2012, 10:21:37 PM

Previous topic - Next topic

perento

How to highlight a function declaration/call? I see when i use code tags in forums, the function prototype names are highlighited but i cant see it in the code::blocks :(

perento

I noticed its hard to hightlight such functions, so ill ask straight away, is it possible yet?
If not i have to deal with it, if yes, please take the time to answer.

PS: Sorry for the double post

oBFusCATed

What do you mean? Please try to explain better what is the problem and what are you trying to do.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

perento

int Set_foo (int val){
     foo = val;
}

int main(){
     Set_foo (10); //highlight here

     return 0;
}


is it possible any call of Set_foo to be highlighted? Or any pre-defined library functions?
I seen a forums that use to highlight function names inside code tags, is this possible in Code::Blocks?

I was leaded to a wiki page (scintilla) of how to set .xml file to highlight but i didnt read anything for the functions or similliar.

oBFusCATed

Still not pretty clear, but I guess you want semantic highlight and this is not possible at the moment...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

perento

Jut like the 'x' character are highlighted, or the data types, the numbers etc. This is what i ment, please excuse my english is not my main one.
I was leaded to this thread but cant really tell what is doing exactly.

scarphin

Try 'settings->editor->syntax highlighting->keywords'.

perento

For keywords are okay. I was wondering if the IDE can recognize function names/calls like the keywords, and highlight them when called or writing a function.

oBFusCATed

Are you talking about code-completion?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

scarphin

It's like solving a puzzle but I think he's talking about assigning a color to functions in the editor, like keywords and others. ;/

perento

Yes, thank you. Can the IDE recognize when i write/call a function and add a color to it, like when i type for example "while" turning the keyword in blue, same when i write a function to turn the function name in some color.

Again, please forgive my english

Jenna

Quote from: perento on May 12, 2012, 02:14:57 AM
Yes, thank you. Can the IDE recognize when i write/call a function and add a color to it, like when i type for example "while" turning the keyword in blue, same when i write a function to turn the function name in some color.

Again, please forgive my english
That's what is called semantic highlighting, and no, it's not supported directly, we use scintilla as editor component and it uses lexer based syntax highlighting.

But there is a user who started to develop a plugin that can do it, but it's not yet ready.
See: http://forums.next.codeblocks.org/index.php/topic,16249.msg109954.html#msg109954

perento

Thanks for leading me to this thread, ill be following it.