#include <iostream>
#include <vector>
#include <memory>
class Test
{
public:
Test() : mMember() {}
void DoSomething() {}
private:
int mMember;
};
class Confuse
{
public:
Confuse() {}
void DoSomething() {}
};
int main()
{
std::vector<int> MyInts;
MyInts.push_back(2);
MyInts.push_back(4);
Test MyTest;
MyTest.DoSomething();
Test* MyPointerToTest = new Test();
MyPointerToTest->DoSomething();
// time for smart pointers
std::unique_ptr<Test> MyUniquePointer(new Test());
MyUniquePointer->DoSomething();
std::shared_ptr<Test> MySharedPointer(new Test());
MySharedPointer->DoSomething();
std::auto_ptr<Test> MyAutoPointer(new Test());
MyAutoPointer->DoSomething();
delete MyPointerToTest;
return 0;
}
For the other smart pointers in this example, there's nothing at all, so it would be nice, those also got supported and provide the same level of user friendliness [codecompletion wise] as auto_ptr,-std=c++0x in gcc defines a macro (GCC_CPP_OX_EXPERIMENTAL or something like that) and probably the current parser doesn't define this macro, so the c++-0x additions to the STL are not parsed at all.
that is smart pointer methods, and original pointer methods.
How feasible do the cc gurus think this is ?+1
Personally I think this would be a major benefit.
+1 = 2How feasible do the cc gurus think this is ?+1
Personally I think this would be a major benefit.
Let's start with a current issue : hover over the "DoSomething" part of "MyTest.DoSomething();", right click and choose "Find declaration". CB offers you a choice, although there should be no choice, only the the Test::DoSomething() is a candidate, it however also offer the one from the class Confuse an an option. [same applies when starting from 'MyPointerToTest->DoSomething();"].
template <typename T1>
class AAA
{
typedef T1 T2;
typedef T2 T3;
T3 function();
}
Next, hover over the "MyInts" part of "MyInts.push_back(4);", CB shows in the tooltip it is a vector, I guess it would be better to say it is a "vector<int>" ?This one, as you define the variable like this:
std::vector<int> MyInts;
A similar remark applies for all the smart pointers, for example : hovering over "MyAutoPointer" tells you it is a auto_ptr, where auto_ptr<Test> would be better, right ?
And now on to the new requests.
When I type "MyAutoPointer->", the completion allows me to choose from the list of auto_ptr methods [eg. get, release, reset, ...], it would be very good if this list is extended with the list of methods of the wrapped pointer. Since smart pointers are a very good tool to write good software, it is now less nice (in CB) since you loose the completion of the original pointer.
For the other smart pointers in this example, there's nothing at all, so it would be nice, those also got supported and provide the same level of user friendliness [codecompletion wise] as auto_ptr,
that is smart pointer methods, and original pointer methods.
template <typename T1>
class AAA
{
typedef T1 T2;
typedef T2 T3;
T3 function();
T3 operator -> () .....
}
#include <tr1/memory>
std::tr1::shared_ptr<blabla> p(...)
DoesGCC version?Code#include <tr1/memory>
std::tr1::shared_ptr<blabla> p(...)
work?
DoesCode#include <tr1/memory>
std::tr1::shared_ptr<blabla> p(...)
work?
this is great news, if you feel confident have Martin put it on the cc branch, so we can test :-)done. :D
on to the next smart pointer 8)
Sorry guys, I'm rather busy so I saw this just today. I've applied in to the branch, however - from my point of view this is untested, so be careful.this is great news, if you feel confident have Martin put it on the cc branch, so we can test :-)done. :D
on to the next smart pointer 8)
Sorry guys, I'm rather busy so I saw this just today. I've applied in to the branch, however - from my point of view this is untested, so be careful.this is great news, if you feel confident have Martin put it on the cc branch, so we can test :-)done. :D
on to the next smart pointer 8)
From a quick inspection of the code I realised at least one spelling mistake "tokenOperatroType" and method names like "CollectSS" won't really improve readability of the code. But these are probably minor things. However, I'd love to see them fixed.
std::vector<someclass>::iterator it = myvector.begin();
it->|
Another feature request (question).Codestd::vector<someclass>::iterator it = myvector.begin();
it->|
Does current code completion parse the overloaded -> operator?
Also does it show the methods/members of someclass, not the iterator's?
This will be event better improvement, because iterators are used more often than smart pointers :)
I have to say I have seen very nice improvements on the cc branch. It is really way better then before :-)True, however, I am still facing random crashes. Unfortunately not always. They are of two kinds:
Congratulations to the cc gurus !!!
I have to say I have seen very nice improvements on the cc branch. It is really way better then before :-)True, however, I am still facing random crashes. Unfortunately not always. They are of two kinds:
Congratulations to the cc gurus !!!
1.) a compiler error occurs and the file in question is opened by C::B automatically. Result: C::B either crashes or freezes. This happens to me often for winbase.h and/or cstdint (the latter only when NOT using the C0XX compiler switch).
2.) a compiler warning/note occurs in the logs and I click on e.g. a note which opens the file in question, too. Result is the same as above but it'll always crash, not freeze.
In both cases the trace log is useless unfortunately. In both cases it works when having CC disabled.
I told Loaden about this but unfortunately he cannot reproduce.
He sent me a patch I should try for a solution (actually related to refactoring), but it didn't work.Currently, Loaden are testing his new patch, which is V25....(include the refactoring) :D
In both cases the trace log is useless unfortunately.When I say this I mean that it fails in the wxwidgets DLL like this:
Hi, Morten, can you trying this patch? (Only for testting)I have to say I have seen very nice improvements on the cc branch. It is really way better then before :-)True, however, I am still facing random crashes. Unfortunately not always. They are of two kinds:
Congratulations to the cc gurus !!!
1.) a compiler error occurs and the file in question is opened by C::B automatically. Result: C::B either crashes or freezes. This happens to me often for winbase.h and/or cstdint (the latter only when NOT using the C0XX compiler switch).
2.) a compiler warning/note occurs in the logs and I click on e.g. a note which opens the file in question, too. Result is the same as above but it'll always crash, not freeze.
In both cases the trace log is useless unfortunately. In both cases it works when having CC disabled.
I told Loaden about this but unfortunately he cannot reproduce. He sent me a patch I should try for a solution (actually related to refactoring), but it didn't work.
So: Is it only me or can anybody else reproduce this, too? I am using SVN HEAD of the CC branch, no additional things.
1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser
BUT when I position the cursor between 2 functions, the toolbar doesn't show a function [acceptable since we are in between functions], BUT the drop down list is empty. Since I was still at the global scope, the dropdown list should still contain all the functions. Right ?I will checking, and try to fix.
Hi, Morten, can you trying this patch? (Only for testting)I'll give it a try... Probably any volunteers should do the same.
Fixed!BUT when I position the cursor between 2 functions, the toolbar doesn't show a function [acceptable since we are in between functions], BUT the drop down list is empty. Since I was still at the global scope, the dropdown list should still contain all the functions. Right ?I will checking, and try to fix.
1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser
14, fix crash when show call tip in *NONE* project file.
15, fix global scope update error
If there have any crash report, please show me, thanks!Hi, Morten, can you trying this patch? (Only for testting)I'll give it a try... Probably any volunteers should do the same.
Fixed!BUT when I position the cursor between 2 functions, the toolbar doesn't show a function [acceptable since we are in between functions], BUT the drop down list is empty. Since I was still at the global scope, the dropdown list should still contain all the functions. Right ?I will checking, and try to fix.
All change log:Quote1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser
14, fix crash when show call tip in *NONE* project file.
15, fix global scope update error
1, add code re-factoring feature, support "Find reference" and "Rename symbols".
2, fix a bug cc will hang when create a project by wizard.
3, improve re-parsing of up-front header files, increase some performance.
4, add filter when parsing source files, .xrc .xml files were not parsed.
5, real-time parsing does not parse system header files.
6, optimize the ui performance when opening several editors, special handling for wx2.8.11.
7, re-factor the CC search function, (use SearchData type instead of cbEditor)
8, optimize the UI performance after batch parse finishes, some tasks were moved from main thread to child thread.
9, add an menu entry of "Reparse this file"
10, add an menu entry of "Reparse current project", and improve Re-parsing project functionality
11, change the short-key to do the codecompletion from Ctrl+SPACE to Shift+SPACE only for Chinese,Japanese or Korean system, because in Chinese,Japanese or Korean System, Ctrl+SPACE is always used to switch IME.
12, fix switch parser delay when editor actived
13, improve switch parser
14, fix crash when show call tip in *NONE* project file.
15, fix global scope update error
16, improve system header search thread
I will dig into it this weekend。
class MyClass : public TempClass<wxString> {
T* getStr() { return m_string; }
};
tempate <typename T>
class TempClass {
T m_string;
};
I just dig into iterator definiton.and it is quite complicate. so I think our first job is to make cc support template inheritance.Agree.
1. "typedef struct { } struct_name;" is parsed as __UNAMED_STRUCT_XXXX1. This is the right way.
2. __cplusplus and/or _GLIBCPP_USE_NAMESPACES are not define while parsing, so __BEGIN_NAMESPACE_STD is not defined correctly (see cdefs.h)
3. Add workspace symbols in the Symbols browser view combo
4. The class combo in the toolbar has :: at the end of the strings... pretty wrong!4. Could you give me more explain?
5. Goto declaration goes to the start of the line not the start of the token
6. Goto declaration goes to the { of a function, when the declaration is an argument, should go to the start of the token
7. Combine 'Goto declaration and goto implementation' into one option and display popup menu with the possibilities (see Visual Assist)
No support for my custom smart pointer ->
1. This is the right way.1. No, it is not the right thing to do, I'm talking as a user.
2. We can not distinguish between C or C++, but __cplusplus just needed by C++, not C. We can not find the best way.
3. This is impossible! Because in current, a project per to a parser.
4. Could you give me more explain?
5. In current, we record only the line number, but not the position.
6. Sorry, do not understood.
7. e.g. How to decision? void tes|t() { /* implement*/ }
5. Can you record the position, I don't think it will be such problem? (Another int in the token struct, big deal).You mean the "column position"? if Yes, the Tokenizer class should record the column position, then add a int member variable in the Token class.
5. Goto declaration goes to the start of the line not the start of the tokenHi, oBFusCATed, these issue should be fixed in HEAD.
6. Goto declaration goes to the { of a function, when the declaration is an argument, should go to the start of the token
8. Sometimes 'goto declaration' works but 'goto implementation' doesn't
13. Call tip sometimes don't show (pretty random)
14. There is no highlighted parameter in the calltip (sometimes)
15. Symbols browser is not updated after some text is typed and "Update parser when typing" = on (when probably, should be replace with while (native speaker correct me please))Can you post a test demo in here?
12. Call tip for constructors still not workingFixed in r6802.
11. No template parameters for templated classes in the Symbol Browsersupported in r6803.
No, we can't.2. We can not distinguish between C or C++, but __cplusplus just needed by C++, not C. We can not find the best way.2. You can, it the .h file is included from C++ file the __cplusplus macro is define, simple as that (of course it will get pretty nasty if both C and C++ file include the same header) :)
No, we can't.
In batch parsing, we can only get the target compiler, but in a project, a target can per a compiler.
So, who is the C Compiler? who is the C++ compiler?
If there have C Compiler, and have C++ Compiler too, then how to decision?
This is too hard, we can't solved it.
Loaden: thanks for the fixes, I'll give it a try the next time Morten syncs the branches :)Another way, done in r6805.No, we can't.
In batch parsing, we can only get the target compiler, but in a project, a target can per a compiler.
So, who is the C Compiler? who is the C++ compiler?
If there have C Compiler, and have C++ Compiler too, then how to decision?
This is too hard, we can't solved it.
Why do you care for the compiler?
You know the type of every translation unit (.c or .cpp file),
so if a header is included from a cpp file or a header where __cplusplus is define, you define the __cplusplus...
Another problem I've encountered:
Type "#include <wx/i", then the completion for the include shows, then choose wx/ipc.h from the list.
The result is "#include <wx/wx/ipc.h>" not the correct one "#include <wx/ipc.h>"