Author Topic: CC's new bug, SVN6049, XPSP3  (Read 27909 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #15 on: January 06, 2010, 03:03:40 am »
Notice that you'll need to save the file for CC to "know" about the newly added code fragments. CC does only know what's been saved.
I confirm that the file has been saved! And when I close the project, and then open the project (Note: do not exit CB), still fail to prompt any information.
Unless I quit CB, re-open the project. In this case, smart tips work well.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #16 on: January 06, 2010, 03:14:20 am »
If I start a console-project with the wizard and add vector to the includes it works without error (without saving).
However, even though I was not built in an empty project, CC does not work properly.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #17 on: January 06, 2010, 03:25:05 am »
Operation steps:
1. Create a new C + + project
2. Add # include <vector>
3. In the main function, define a variable: vector <int> v;
4. The next line, enter the 'v.', at the point, after there has been no intelligence tips.
5. Close the current project, and then re-open this project.
6. Repeat step 4, and all normal!

I can not reproduce this.
When you create a new C++ project. I have already one cpp file in the project. some thing like below:

Code
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

Then adding some code as you said.(I don't save that file)
Code
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    vector <int> v;
    v.
    cout << "Hello world!" << endl;
    return 0;
}
you can see the screen shot below:
So, it seems I can't reproduce this bug. :D
windowsXP SVN rev 6056.

Hi, ollydbg, I know you are from China, I am also from China. Can QQ, MSN or GTalk on the exchange about this issue?
My QQ: 1090833
My MSN: loaden # live.com
My GTalk: loaden # gmail.com
Thanks!

In addition, I built an open source project: http://portablecb.googlecode.com
Can download the packaged of the CB inside, and to reproduce the problem?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: CC's new bug, SVN6049, XPSP3
« Reply #18 on: January 06, 2010, 03:43:30 am »
@Loaden

maybe the error come from this.

see the attachment.


[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC's new bug, SVN6049, XPSP3
« Reply #19 on: January 06, 2010, 03:47:16 am »
@Loaden.
What is your macro replacement map contains?
You can view them in

Settings->Editor->CodeCompletion and Symbols browser

then in the "C/C++ parser", see the "replacement tokens" list.

You should have several entries.
Only one item.


OK,that's the reason why your CC failed.
Please read Re: New code completion remarks/issues and do what I suggest in that post.

In fact, You need to add more replacement rules to let the parser works correctly.
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 Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #20 on: January 06, 2010, 03:52:22 am »
@Loaden

maybe the error come from this.

see the attachment.

Thanks! Do you mean let me add a few more conversions?
However, I added in the process encountered a problem, as shown.

[attachment deleted by admin]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC's new bug, SVN6049, XPSP3
« Reply #21 on: January 06, 2010, 03:54:42 am »
@Loaden

maybe the error come from this.

see the attachment.

Thanks! Do you mean let me add a few more conversions?
However, I added in the process encountered a problem, as shown.

Ok, you should manually change the "default.conf" file.

By the way, I think we should remove this kind of check when adding new macro replacement  rules. right?
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 blueshake

  • Regular
  • ***
  • Posts: 459
Re: CC's new bug, SVN6049, XPSP3
« Reply #22 on: January 06, 2010, 03:58:14 am »
if I remember right.the configuration file is in somewhere of c:(search it if you using windows.)
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #23 on: January 06, 2010, 04:01:17 am »
@Loaden

maybe the error come from this.

see the attachment.

Thanks! Do you mean let me add a few more conversions?
However, I added in the process encountered a problem, as shown.

Ok, you should manually change the "default.conf" file.

By the way, I think we should remove this kind of check when adding new macro replacement  rules. right?
Nice! When I was in default.conf where to add these rules, CC has been work well now.
Thank you very much! !

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #24 on: January 06, 2010, 04:08:00 am »
if I remember right.the configuration file is in somewhere of c:(search it if you using windows.)
Yes. I am using SVN5731 configuration. I just tried it, when the default.conf does not exist, the default is generated, there will be six replacement rule, not the old versions of one replacement rule.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CC's new bug, SVN6049, XPSP3
« Reply #25 on: January 06, 2010, 04:13:53 am »
if I remember right.the configuration file is in somewhere of c:(search it if you using windows.)
Yes. I am using SVN5731 configuration. I just tried it, when the default.conf does not exist, the default is generated, there will be six replacement rule, not the old versions of one replacement rule.
Yes, this is quite simple, you can see these code in
Code
void CodeCompletion::LoadTokenReplacements()
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("code_completion"));

    ConfigManagerContainer::StringToStringMap& repl = Tokenizer::GetTokenReplacementsMap();
    repl.clear();

    if (!cfg->Exists(_T("token_replacements")))
    {
        // first run; add default replacements string
        Tokenizer::SetReplacementString(_T("_GLIBCXX_STD"), _T("std"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NESTED_NAMESPACE"), _T("+namespace"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_END_NESTED_NAMESPACE"), _T("}"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NAMESPACE"), _T("+namespace"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_END_NAMESPACE_TR1"), _T("}"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NAMESPACE_TR1"), _T("-namespace tr1 {"));
    }
    else
        cfg->Read(_T("token_replacements"), &repl);
}

If the configure file does not exist(the first time you run CB), six replacement rules will be added. But if it exists, it only read from that file.
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 Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #26 on: January 06, 2010, 04:15:19 am »
Very strange, how not to work.
It has just one was successful.


[attachment deleted by admin]

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #27 on: January 06, 2010, 04:21:04 am »
Very strange, how not to work.
It has just one was successful.

But if i remove:
Code
using namespace std;
it's work fine.
I think, i need re-config CB.


[attachment deleted by admin]

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: CC's new bug, SVN6049, XPSP3
« Reply #28 on: January 06, 2010, 06:40:41 am »
Very strange, how not to work.
It has just one was successful.

But if i remove:
Code
using namespace std;
it's work fine.
I think, i need re-config CB.

Now, i re-config CB, and vector parser well.
But, string and wstring is not parser.
Code
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s;
    s. // HERE, show nothing...
    cout << "Hello world!" << endl;
    return 0;
}