Author Topic: Code Completion in string class  (Read 9367 times)

Offline ldestroyer

  • Single posting newcomer
  • *
  • Posts: 4
Code Completion in string class
« on: July 11, 2011, 03:40:24 pm »
I am using Code::Blocks build 7256 debugger branch version. Code completion works well, but in some cases, such as string class, cin, cout, it does not work. For example, if I write "string s = "abcd"; s.", after dot I see nothing. The same situation in cin and cout. I want to be able to see the methods of this classes. In other cases the CC works well (even with STL vectors, maps, etc.). What do i need to do to make CC work?
In addition, if I write "string::", I see all methods.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5453
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Completion in string class
« Reply #1 on: July 11, 2011, 04:14:56 pm »
Likes a bug, and can you post the exact test code and steps, so that other people can test it or even fix the bug.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ldestroyer

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code Completion in string class
« Reply #2 on: July 11, 2011, 06:48:24 pm »
I was trying to create a simple console application.
Code
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s1;
    cout << "Enter your name\n";
    cin >> s1;
    if (s1.empty())       //at this point there is no Code Completion after s1.
    {
          /*some code*/
    }
    cin.get();             //at this point there is no CC (only _M_extract() method shown there)
    return 0;
}
But if in the code try to type:
Code
string::
CC works well and all methods for string are shown.
Also if try to type:
Code
cout.
There is only _M_insert() method shown.
I use Debian Linux. And I have tried to insert in search directories line '/usr/include/c++/4.4.5', but nothing changed.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code Completion in string class
« Reply #3 on: July 11, 2011, 07:36:14 pm »
It works if the actual debugger-branch ismerged with trunk (trunk to merge).

I can update the debugger-branch, after I have cleaned my local copy.

Offline ldestroyer

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code Completion in string class
« Reply #4 on: July 11, 2011, 08:38:11 pm »
What does it mean? Waiting for update, where this bugs are fixed, in your repo?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code Completion in string class
« Reply #5 on: July 11, 2011, 08:59:08 pm »
What does it mean? Waiting for update, where this bugs are fixed, in your repo?
Yes.
I just merged trunk to the branch.
At the moment I compile trunk and debugger-branch aqnd will add it to my repo soon.

Offline ldestroyer

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code Completion in string class
« Reply #6 on: July 11, 2011, 09:28:11 pm »
Ok. Thanks for help.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code Completion in string class
« Reply #7 on: July 11, 2011, 11:07:42 pm »
It's in my repo now (revision 7282 for trunk and 7283 for debugger-branch).

Offline Sergio14

  • Single posting newcomer
  • *
  • Posts: 1
Re: Code Completion in string class
« Reply #8 on: November 03, 2021, 07:36:16 pm »
Hello,

I just start with coding and after few initial lines I figure out that my code::blocks is not working as it should. The issue is completely same like is described in this topic 10 years ago: "Code completion works well, but in some cases, such as string class, cin, cout, it does not work. For example, if I write "string s = "abcd"; s.", after dot I see nothing. The same situation in cin and cout."

Is there meantime any solution for this?

Thank you