News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

CC's new bug, SVN6049, XPSP3

Started by Loaden, January 05, 2010, 12:33:45 PM

Previous topic - Next topic

Loaden

Quote from: MortenMacFly on January 05, 2010, 02:54:28 PM
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.

Loaden

Quote from: jens on January 05, 2010, 03:11:01 PM
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.

Loaden

Quote from: ollydbg on January 06, 2010, 02:16:47 AM
Quote from: Loaden on January 05, 2010, 12:33:45 PM
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:


#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)
#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?

blueshake

@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?

ollydbg

Quote from: Loaden on January 06, 2010, 02:58:34 AM
Quote from: ollydbg on January 06, 2010, 02:20:15 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.

Loaden

Quote from: blueshake on January 06, 2010, 03:43:30 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]

ollydbg

Quote from: Loaden on January 06, 2010, 03:52:22 AM
Quote from: blueshake on January 06, 2010, 03:43:30 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.

blueshake

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?

Loaden

Quote from: ollydbg on January 06, 2010, 03:54:42 AM
Quote from: Loaden on January 06, 2010, 03:52:22 AM
Quote from: blueshake on January 06, 2010, 03:43:30 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! !

Loaden

Quote from: blueshake 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.)
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.

ollydbg

Quote from: Loaden on January 06, 2010, 04:08:00 AM
Quote from: blueshake 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.)
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
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.

Loaden

Very strange, how not to work.
It has just one was successful.


[attachment deleted by admin]

Loaden

Quote from: Loaden on January 06, 2010, 04:15:19 AM
Very strange, how not to work.
It has just one was successful.

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


[attachment deleted by admin]

Loaden

Quote from: Loaden on January 06, 2010, 04:21:04 AM
Quote from: Loaden on January 06, 2010, 04:15:19 AM
Very strange, how not to work.
It has just one was successful.

But if i remove:
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.
#include <iostream>
#include <string>

using namespace std;

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