Author Topic: finding variable declaration  (Read 5898 times)

Offline yaro

  • Single posting newcomer
  • *
  • Posts: 8
finding variable declaration
« on: January 23, 2007, 08:03:38 pm »
Does codeblocks support finding variable declaration?

When I select a text which is a function name then it is able to find function declaration/definition but it doesn't work for variables.
When the text is a variable then it says not found xyz.

My second question is whether code completion supports completion of struct members like in xyz. or xyz->

Thanks

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: finding variable declaration
« Reply #1 on: January 24, 2007, 06:20:09 am »
Yes it does. Although there is a patch that will improve the editor going to the correct line first time. It is Patch 1740.

Offline yaro

  • Single posting newcomer
  • *
  • Posts: 8
Re: finding variable declaration
« Reply #2 on: January 24, 2007, 12:18:26 pm »
I'm just curious how it works because it doesn't work for plain C for me. Are it's limitations described somewhere?

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: finding variable declaration
« Reply #3 on: January 24, 2007, 01:09:12 pm »
It should work.
Which version of codeblocks do you use? svn?

Offline yaro

  • Single posting newcomer
  • *
  • Posts: 8
Re: finding variable declaration
« Reply #4 on: January 24, 2007, 01:56:58 pm »
I found out it works for global variables but doesn't work for local function variables.

If you have something like

void test()
{
  int aa = 0;

  aa = aa + 1; <- it will be unable to find where aa is defined
}

It also doesn't work for function parameters. I use latest nightly build.

I think it would be nice to add cscope functions to codeblocks or at least grepping for symbol like KDevelop has.