Author Topic: Highlight function  (Read 9926 times)

Offline perento

  • Multiple posting newcomer
  • *
  • Posts: 47
Highlight function
« 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 :(

Offline perento

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Highlight function
« Reply #1 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Highlight function
« Reply #2 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.
(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!]

Offline perento

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Highlight function
« Reply #3 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Highlight function
« Reply #4 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...
(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!]

Offline perento

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Highlight function
« Reply #5 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.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Highlight function
« Reply #6 on: May 12, 2012, 12:47:41 am »
Try 'settings->editor->syntax highlighting->keywords'.

Offline perento

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Highlight function
« Reply #7 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Highlight function
« Reply #8 on: May 12, 2012, 01:04:32 am »
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!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Highlight function
« Reply #9 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. ;/

Offline perento

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Highlight function
« Reply #10 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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Highlight function
« Reply #11 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

Offline perento

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Highlight function
« Reply #12 on: May 12, 2012, 10:34:30 am »
Thanks for leading me to this thread, ill be following it.