Author Topic: function call without parentheses  (Read 3269 times)

Offline Feno

  • Single posting newcomer
  • *
  • Posts: 2
function call without parentheses
« on: November 12, 2022, 10:31:40 am »
Hello, I am starting to use this IDE and in C++ programming. It's been several times that I've been fooled when calling a function: the IDE offers me the available functions and when I select one it does not add the parentheses and therefore generates an error. The question is if I didn't correctly configure the IDE to add the parentheses to the function call. Otherwise it is clear that I would think about it from now on ;). thank you for your help and have a nice day

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: function call without parentheses
« Reply #1 on: November 12, 2022, 05:27:02 pm »
Settings=>Editor=>CodeCompletion=>Add parenteses after function completion

Offline Feno

  • Single posting newcomer
  • *
  • Posts: 2
Re: function call without parentheses
« Reply #2 on: November 17, 2022, 07:34:11 am »
Hello, Thanks for your help. The line was already checked. I unchecked it, then after validation I restarted CODES//BLOCK. Then I re-checked the line then validated and restarted again, nothing worked! Let me re-explain the case where I expect the parentheses to be placed automatically: If I have a class P1 and a display() function, if I do "P1.display()", I expect that CODE//BLOCK places what it offers me: display(). And that's not the case...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: function call without parentheses
« Reply #3 on: November 17, 2022, 09:26:20 pm »
Hello, Thanks for your help. The line was already checked. I unchecked it, then after validation I restarted CODES//BLOCK. Then I re-checked the line then validated and restarted again, nothing worked! Let me re-explain the case where I expect the parentheses to be placed automatically: If I have a class P1 and a display() function, if I do "P1.display()", I expect that CODE//BLOCK places what it offers me: display(). And that's not the case...

The CodeCompletion plugin is quite old and out of date with newer C++ compilers.

A newer code completion plugin is available and will soon be contained in the nightly builds. See:  https://forums.codeblocks.org/index.php/board,20.0.html

However you can obtain and install the newer plugin by following the directions at https://forums.codeblocks.org/index.php/topic,25147.msg171509.html#msg171509

The newer plugin (clangd_client) requires that the clangd executable be available on your system. See: https://wiki.codeblocks.org/index.php/CB_Clangd_Client

It also requires that you install the nightly build, see https://forums.codeblocks.org/index.php/topic,25147.msg171487.html#msg171487 for install instructions.

It's easy. Everything but a compiler toolchain and cland.exe is contained in the nightly build. Try it.
« Last Edit: November 17, 2022, 09:37:08 pm by Pecan »