Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 shorthand completion

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
gka Posted - Sep 27 2007 : 12:33:05 PM
I'm using Visual Studio 2005 in the C++ environment with Visual Assist X 10.3.1561.0.

I turned on the Allow Shorthand switch and when I type anything which displays a listbox followed by a special character (, . ( ...) the term is expanded with the first entry from the listbox. This entry is not always the correct one.
I think this should correspond to the flags set for accepting suggestions (which i have only turned on for tab).

Hope my problem makes sense,
Gregor
13   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 05 2007 : 4:42:40 PM
That's fine, sometimes these things take quite a bit of time to pin down.
gka Posted - Oct 05 2007 : 10:34:48 AM
sorry that i did not post an example so far. i have too much (more important) stuff to do right now and the problem seems to be harder to reproduce than i thought. i will post as soon as i can. thanks for the quick replies so far.
feline Posted - Oct 01 2007 : 4:21:53 PM
An example would be very useful. I have a set of tests here using boost::shared_ptr and VA lists the correct items for me.

Do you use typedef's in your code?
Do you use std::vector lists of boost::shared_ptr instances?

There is a known problem, which is illustrated by this sample code:

namespace SpaceTypedefPtrListbox {
	class _MyClass;

	typedef boost::shared_ptr<_MyClass> MyClass;
	typedef std::vector<MyClass> MyVector;
	typedef std::set<MyClass> MySet;
}

namespace SpaceTypedefPtrListbox {
	class _MyClass {
	public:
		void foo(void) { }
	};
}

static void testAccessIteratorMembersTypedefPtr(void)
{
	SpaceTypedefPtrListbox::MyVector myVector;
	SpaceTypedefPtrListbox::MySet mySet;

	SpaceTypedefPtrListbox::MyVector::const_iterator itVector = myVector.begin();
	// case 8873 - type "->" after "itVector" and VA lists many items, members of "boost::shared_ptr" class
	itVector;
	SpaceTypedefPtrListbox::MySet::const_iterator itSet = mySet.begin();
	// test - type "->" after "itSet" and VA correctly lists only one item, "foo()"
	itSet;
}
gka Posted - Sep 29 2007 : 12:36:14 PM
Yes, I'm using boost::shared_ptr. I will look for an easy example.
feline Posted - Sep 29 2007 : 12:29:21 PM
*ah* so you are getting the wrong list on a smart pointer.

VA does handle smart pointers some, or even most of the time, but obviously not here. What we need to try and do is fix VA so you get the correct list.

Are you using your own smart pointer class, or a standard class, e.g. from Boost?
Any chance of a code sample that shows the problem?
gka Posted - Sep 29 2007 : 11:05:04 AM
Sorry for the confusion
The problem is when using smartpointers which I do alot and then with the operator ->
So it is not a member I need and the wanted item is not always in the listbox.
feline Posted - Sep 29 2007 : 10:37:28 AM
I am confused.

After typing a dot you should always see a full listbox, showing all members of the type you are using.

Are you seeing all members when the listbox first appears after typing the dot or not?
If you are, then the item you want should be in the list somewhere, even if it is not the current item. Or are you trying to call a member that does not exist yet, so you can then add it to the class at a later time?
gka Posted - Sep 29 2007 : 03:41:03 AM
It's like the first example (no suggestion). Like I said the problem is the listbox in combination with shorthand. Because then there is almost always something in the listbox which then will be accepted (without me wanting to).
feline Posted - Sep 28 2007 : 1:31:15 PM
When you are typing, does it look like the first or second code example I posted? Specifically, are you typing after a dot or arrow?

If you are not typing after a dot / arrow, and are seeing a suggestion listbox then a round bracket should not accept the current item in the listbox. I have just checked this here, and it does not accept the item for me.

If you are seeing a suggestion listbox then it should have an "A" icon below its bottom left hand corner.
gka Posted - Sep 27 2007 : 4:26:19 PM
Yes, in that way it behaves like the ide. The problem is when using Visual Assist with the shorthands. Often, the correct (or better: wanted) expression (lets call it X) is not in the listbox but X is a shorthand for a listbox entry XY. So now when I type X followed by a parantheses I get XY( which is very confusing. I would like the suggestion flags "tab" "enter" "any character not ..." work on the listboxes as well even if that is not consistent with the ide.

oh, and it happens "most" of the time (more always than sometimes)
feline Posted - Sep 27 2007 : 4:04:19 PM
Does this happen all of the time? Or only some of the time?

Using the following C++ code:

#include <string>

static void testAcceptingItems()
{
	std::string strName;
	strName.|
}


If I disable VA, trigger a listbox with CTRL-SPACE, and then type len( the IDE its self will accept the current item (length) in the listbox when I type the bracket. VA is designed to do the same thing in this situation, since this is consistent with the IDE.

However if you are typing:

static void testAcceptingItems()
{
	std::string strName;
	str|
}


there is a suggestion "strName" present and you type a bracket then the listbox item should not be accepted, since it should only be a suggestion listbox.
gka Posted - Sep 27 2007 : 2:22:31 PM
quote:
Do you mean the current item in the listbox is being accepted when you did not want it to be accepted?

correct
quote:
Do you have:

VA Options -> Advanced -> suggestions -> display suggestion list and accept with: Any character not valid in a symbol

turned on?

no, i have only turned on: "tab"

and it does not complete on enter so that behavior is correct.
feline Posted - Sep 27 2007 : 1:59:34 PM
Do you mean the current item in the listbox is being accepted when you did not want it to be accepted?

Do you have:

VA Options -> Advanced -> suggestions -> display suggestion list and accept with: Any character not valid in a symbol

turned on? If I understand correctly then this is why this is happening. Since the special characters are not valid in a symbol the current item is being accepted when you type one of these.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000