Author |
Topic |
|
ivan
Ketchup Master
Russia
75 Posts |
Posted - May 11 2004 : 01:03:50 AM
|
First of all I don't really know whether this is a bug or just a missing feature. I assume the former since it's kind of obvious and (I guess) not very hard to implement, but please correct me if I'm wrong.
Upon name completion, if a function takes no arguments the most logical cursor position is after the *closing* round bracket. Currently it is placed right after the *opening* bracket in all cases.
[edit] Just checked and noticed that the above behaviour only takes place when the function is a method of some class; for global functions the cursor is placed correctly. [/edit] |
Edited by - ivan on May 11 2004 01:11:17 AM |
|
Old as dirt
Tomato Guru
USA
246 Posts |
Posted - May 11 2004 : 09:33:42 AM
|
I've noticed this but never pinned down when it placed the cursor after the close parenthesis and when it put it inside the parenthesis. It would be nice if you always placed it according to whether the function took arguments or not regardless of if it was a class function or not. |
Ken |
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - May 11 2004 : 09:41:57 AM
|
In a quick test, this behaves properly for me (C++, VS.NET 2003). Of course, if a function is overloaded so that it sometimes takes arguments and sometimes not, either position might be wrong. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - May 11 2004 : 11:28:42 AM
|
i would say VAX quite often gets this wrong, but i have just tested a few class member functions with no parameters, and the cursor is being placed after the close bracket. with VAX 1235 and VS .NET 2003
the times when it feels wrong are probably standing out in my memory, giving a distorted impression
i will keep an eye on this and see if i can spot a pattern. |
zen is the art of being at one with the two'ness |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - May 11 2004 : 2:11:04 PM
|
We suspect the caret remains inside ()'s unexpectedly for overloaded methods. Check if this is the case. Click on the method and check the dropdown for the Definition field, or hover and check the HCB.
You can press ) to overwrite the inserted ) when the caret is in the middle of ()'s. |
Whole Tomato Software, Inc. |
|
|
ivan
Ketchup Master
Russia
75 Posts |
Posted - May 11 2004 : 3:32:10 PM
|
I did some testing and templates seem to be the culprit. Think I also spotted another bug (note the comments about missing const) while doing that... Here we go: (VS.Net 2003; VA build 1233)
#include <vector>
class completion_test1
{
public:
int begin();
const int begin() const;
};
template <class T>
class completion_test2
{
public:
int begin();
const int begin() const;
};
Then I cleared the cache, hit 'rebuild' and restarted VS (by the way, sometimes it crashes in va_x.dll when opening a project and it takes 1-2 VS restarts for it to stop doing that, but that's a different story)
void tests()
{
completion_test1 ctest1;
// 1. When I type period in the line below completion listbox appears with a single symbol
// 'begin' and a tooltip that says
// 'const int begin() const'
// 2. After I press tab 'begin()' appears and cursor is placed correctly (after the closing bracket)
// 3. When I hover the mouse over 'begin' tooltip that says
// 'const int completion_test1::begin()'
// appears (note there's no 'const' at the end)
ctest1.begin();
completion_test2<int> ctest2;
// 1. When I type period in the line below completion listbox appears with a single symbol
// 'begin' and a tooltip that says
// 'int begin()'
// 'const int begin() const'
// 2. After I press tab 'begin()' appears and cursor is placed incorrectly (inside the brackets)
// tooltip says '[1 of 2] int begin()'
// 3. When I hover the mouse over 'begin' tooltip that says
// 'int completion_test2<int>::begin()'
// 'const int completion_test2<int>::begin()'
// appears (note there's no 'const' at the end of the second line)
ctest2.begin();
std::vector<int> ctest3;
// For the line below behaviour matches the previous one (completion_test2)
// (except of course there're more symbols in the listbox)
ctest3.begin();
}
I guess the info above should be enough but don't hesitate to ask if you need more.
Good luck. |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - May 11 2004 : 8:15:27 PM
|
We copied your example into a new file and are unable to reproduce the problem. Same build and IDE. Fresh install of VA X.
For ctest1 and ctest2, we get a members listbox with "begin" and tooltip of "int begin()" alone. Accepting leaves the caret after begin() in both cases.
Did you try your example in a new file?
Any chance you have "Prefer default Intellisense" enabled in our options dialog? |
Whole Tomato Software, Inc. |
|
|
ivan
Ketchup Master
Russia
75 Posts |
Posted - May 12 2004 : 04:00:07 AM
|
Yes, it's a new file. No, I have 'Prefer default Intellisense' turned off. Tried again with different class template and the problem's still here. Until I restarted the IDE, though, it kept telling me '0 symbols found' after I typed period (reopening the file didn't change it, only IDE restart did).
Would you like to see more of my VA X settings? (directories etc.) |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - May 12 2004 : 06:16:06 AM
|
i have just tried this inside a new .cpp file in my current project.
after copying in the two classes completion_test1 and completion_test2 i told VAX to reparse the current file.
then i typed in the tests() function. ctest1 and ctest2 both worked correctly for me, just as support said.
interestingly ctest3 had a problem. type ctest3. and i got a nice long list of suggestions. add a b, so i had "ctest3.b" and the suggestion list shrunk down to 2 items, "back" and "begin". using Tab to select "begin" and the caret was placed inside the brackets. i am being told there are 2 overloaded versions of this function (via a tooltip), and neither of them take any parameters.
using the drop down for the Definition field shows the two overloaded functions, and both take zero parameters.
vax options -> text editor -> completion -> prefer default intellisense is turned off.
i presume this is a bug.
using VS .NET 2003
VA_X.dll file version 10.0.1235.0 Licensed to: VA X: VA.NET 7.1: ###### (1-user license) VAOpsWin.dll version 1.0.0.44 DevEnv.exe version 7.10.3077.0 msenv.dll version 7.10.3077.0 Font: Courier New 13(Pixels) Comctl32.dll version 5.82.2800.1106 WindowsNT 5.1 Build 2600 Service Pack 1 Single processor
Platform: Custom Stable Includes: C:\\qt\\live\\include; C:\\qt\\live\\include\\private; d:\\program files\\microsoft visual studio .net 2003\\vc7\\include; d:\\program files\\microsoft visual studio .net 2003\\vc7\\atlmfc\\include; d:\\program files\\microsoft visual studio .net 2003\\vc7\\PlatformSDK\\include\\prerelease; d:\\program files\\microsoft visual studio .net 2003\\vc7\\PlatformSDK\\include; d:\\program files\\microsoft visual studio .net 2003\\sdk\\v1.1\\include;
Library Includes: C:\\qt\\live\\src\\attic; C:\\qt\\live\\src\\canvas; C:\\qt\\live\\src\\codecs; C:\\qt\\live\\src\\dialogs; C:\\qt\\live\\src\\iconview; C:\\qt\\live\\src\\kernel; C:\\qt\\live\\src\\network; C:\\qt\\live\\src\\opengl; C:\\qt\\live\\src\\sql; C:\\qt\\live\\src\\styles; C:\\qt\\live\\src\\table; C:\\qt\\live\\src\\tools; C:\\qt\\live\\src\\widgets; C:\\qt\\live\\src\\workspace; C:\\qt\\live\\src\\xml; d:\\program files\\microsoft visual studio .net 2003\\vc7\\atlmfc\\src\\mfc; d:\\program files\\microsoft visual studio .net 2003\\vc7\\atlmfc\\src\\atl; d:\\program files\\microsoft visual studio .net 2003\\vc7\\crt\\src;
Other Includes:
|
zen is the art of being at one with the two'ness |
Edited by - feline on May 12 2004 06:34:02 AM |
|
|
|
Topic |
|