Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: perento on May 09, 2012, 10:21:37 pm

Title: Highlight function
Post by: perento on May 09, 2012, 10:21:37 pm
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 :(
Title: Re: Highlight function
Post by: perento on May 10, 2012, 09:55:56 pm
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
Title: Re: Highlight function
Post by: oBFusCATed on May 10, 2012, 10:40:11 pm
What do you mean? Please try to explain better what is the problem and what are you trying to do.
Title: Re: Highlight function
Post by: perento on May 11, 2012, 01:48:22 am
Code
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.
Title: Re: Highlight function
Post by: oBFusCATed on May 11, 2012, 09:44:41 am
Still not pretty clear, but I guess you want semantic highlight and this is not possible at the moment...
Title: Re: Highlight function
Post by: perento on May 11, 2012, 10:16:08 pm
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.
Title: Re: Highlight function
Post by: scarphin on May 12, 2012, 12:47:41 am
Try 'settings->editor->syntax highlighting->keywords'.
Title: Re: Highlight function
Post by: perento on May 12, 2012, 01:02:55 am
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.
Title: Re: Highlight function
Post by: oBFusCATed on May 12, 2012, 01:04:32 am
Are you talking about code-completion?
Title: Re: Highlight function
Post by: scarphin on May 12, 2012, 02:03:35 am
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. ;/
Title: Re: Highlight function
Post by: 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
Title: Re: Highlight function
Post by: Jenna on May 12, 2012, 08:39:42 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.codeblocks.org/index.php/topic,16249.msg109954.html#msg109954 (http://forums.codeblocks.org/index.php/topic,16249.msg109954.html#msg109954)
Title: Re: Highlight function
Post by: perento on May 12, 2012, 10:34:30 am
Thanks for leading me to this thread, ill be following it.