Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 AutoCompletion suggestions make no sense

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
jonathannah Posted - Dec 17 2007 : 4:39:27 PM
VaX 1.4.1619.0

When I am typing code, the code completion suggestions make no sense in the context of the current code.

for example consider:

class MyClass
{
public:
int GetFoo();
void SetFoo(int);
};

MyClass v;

When I have typed type v.Set, I get suggestions such as SendDlgItemMessage, SetAbortProc, SetEvent, etc., which make no sense at all, and none of my actual members ever get suggested. I have seen this in the past, but never where the suggestions are all noise.
30   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 24 2008 : 3:09:01 PM
Progress indeed!

From memory the last report of problems with unit testing used the Boost unit testing library. It sounds like the library you are using is using even more complex macros.

I am impressed with the ShPtr #define, I had not thought of doing it quite like that.

I am puzzled by your mixed results though. I would expect this to work all of the time or fail all of the time. VA should understand smart pointers correctly, when used directly. Certainly it does in my simple tests.

Is there any form of pattern to when this works and when it fails? Does it seem type specific? Something to do with the files the variable is declared in?

That is a very large file, but unless you are actually working in it I don't see why it should matter. Purely in terms of numbers, if you have a small solution then the odds could be good that any "random" symbol will come from that SQL file.
EvilSquirrel Posted - Jan 24 2008 : 1:17:29 PM
quote:
Originally posted by feline

I recall one or two mentions of unit test code causing problems before, but I was never able to reproduce the problems here.

Do you have time to try creating a new default test project and then add one of these problem cpp files to the test project? I am wondering if you still see the problems.

I am wondering if it is possible to get a test project from you, that you feel is safe to share, that shows some of the problems you are seeing for me to test.

It may be possible to work around the problem by using VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

by adding simplified macro definitions to help our parser.


I went into StdAfx.h and added all the #defines from UnitTest++, except with no body: just "#define CHECK(value)" for example. I rebuilt the database and all the borked underlines went away. Progress!

I saw that several of my local variables were now popping up auto-completions, but not those that were shared pointers. So I went back, added my "#define ShPtr boost::shared_ptr", rebuilt the database again, and now my shared pointers work better as well... but not perfectly. Typing a period pops up the APIs for the shared pointer class, that seems pretty much ok. Typing '->' pops up the correct auto-completion for one shared pointer, but for another (of a different class) I get a popup that contains the correct class API but mixed in with a whole bunch of other symbols. Those symbols that belong show a proper tooltip when I arrow-down to them, and the others don't show any tooltips.

I was curious about these other symbols, so I did a solution-wide text search on several of them... Each one was found in one and only one file: sqlite3.c. This is the SQLite 3 amalgamation file: 2.3MB and 72,449 lines long. Interesting?
feline Posted - Jan 24 2008 : 08:58:07 AM
I recall one or two mentions of unit test code causing problems before, but I was never able to reproduce the problems here.

Do you have time to try creating a new default test project and then add one of these problem cpp files to the test project? I am wondering if you still see the problems.

I am wondering if it is possible to get a test project from you, that you feel is safe to share, that shows some of the problems you are seeing for me to test.

It may be possible to work around the problem by using VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

by adding simplified macro definitions to help our parser.
EvilSquirrel Posted - Jan 23 2008 : 5:11:38 PM
quote:
Originally posted by feline

Can you try a quick test please. Turn off "Get content from default Intellisense" and restart the IDE. Immediately after re-starting the IDE does VA work more correctly?


Unfortunately not. I have the exact same problems immediately after I restart the IDE and reload the project.

What I can say is that right now, I'm seeing the problems mostly in our unit test source code. It's written using the UnitTest++ library (http://unittest-cpp.sourceforge.net/), which makes heavy use of macros to perform its magic. Maybe there's a hint in there somewhere? A quick check tells me that other source code files seem to be working better (I've been away from Visual Studio for a week and a half).
feline Posted - Jan 23 2008 : 3:29:46 PM
Can you try a quick test please. Turn off "Get content from default Intellisense" and restart the IDE. Immediately after re-starting the IDE does VA work more correctly?

I have finally managed to reproduce some of the strange problems Uniwares is having, see here:

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=7101&whichpage=2

There might be a connection between what he is seeing and what you are seeing. For me the problem goes away when I restart the IDE, and takes 10+ minutes to show up. It shows up a lot more quickly for Uniwares, but the same pattern is at work. If you are seeing the same, or a related problem then restarting the IDE should help for a couple of minutes.
EvilSquirrel Posted - Jan 23 2008 : 12:07:18 PM
quote:
Originally posted by feline

Can you try VA 1626 please and see if this makes any difference to anything? It should help a bit with at least some of this.


At first glance, 1626 does fix one problem: typing an open parenthesis no longer activates the selected auto-complete item.

Unfortunately, I see no difference with respect to the underlines and the incorrect or missing auto-completes. I still have to turn off the underlines and "Get content from default intellisense" to make things work acceptably.
feline Posted - Jan 18 2008 : 3:08:25 PM
Can you try VA 1626 please and see if this makes any difference to anything? It should help a bit with at least some of this.

http://www.wholetomato.com/downloads/getBuild.asp?1626
EvilSquirrel Posted - Jan 18 2008 : 12:16:19 PM
quote:
Originally posted by feline

Lets start somewhere. What is the biggest problem you are seeing as you are coding?


Sorry for the long pause, I've been stuck on something else for several days.

The biggest problem is the one that got me to post initially: missing or invalid auto-completions, and VAX selecting those incorrect auto-completions when I type characters that shouldn't trigger this (in particular, an open parenthesis).

I know this is vague, and really wish I could provide more specific steps to reproduce this. On the other hand, I see from other recent posts that it's a common problem, including the fact that these issues are often sporadic/unpredictable. I'm glad to see that others have been able to find and provide simpler snippets/projects that exhibit issues; they seem to confirm that there is some sort of parsing snafu.

I'll keep looking for ways to help out.
feline Posted - Jan 11 2008 : 2:10:24 PM
Lets start somewhere. What is the biggest problem you are seeing as you are coding?
You said you had major problems with VA 1624, are you still seeing major problems all over the place?

I am happy to keep trying to find out what is going on with ShPtr, but this might not be the best place to start.
EvilSquirrel Posted - Jan 11 2008 : 1:13:17 PM
quote:
Originally posted by feline

I am just not seeing the problems you are seeing with ShPtr.

If you place the caret into "ShPtr" what does VA show in the context and definition fields?
If you press alt-g what happens?

It is almost as if VA cannot find the macro, and has no idea what is going on here.

Is the header file which defines this macro part of your solution? Is it actually present, somewhere, in Solution Explorer?


Hovering the mouse over ShPtr shows the correct tooltip.
Alt-G works properly (it even offers both the definition in my code and the one in VAX's StdAfx.h).
The header file isn't explicitly listed in the solution, but adding it makes no difference as far as I can tell.

Now that I've reinstalled 1624, I tried replacing ShPtr with boost::shared_ptr again, and it no longer makes the underlines disappear. Went back to 1561, no difference. Removed the extra line from StdAfx.h, no difference. *sigh* Looks like this whole thing is *very* inconsistent. I don't know what to think either.
feline Posted - Jan 10 2008 : 4:01:58 PM
I am just not seeing the problems you are seeing with ShPtr.

If you place the caret into "ShPtr" what does VA show in the context and definition fields?
If you press alt-g what happens?

It is almost as if VA cannot find the macro, and has no idea what is going on here.

Is the header file which defines this macro part of your solution? Is it actually present, somewhere, in Solution Explorer?
feline Posted - Jan 10 2008 : 2:01:56 PM
For now can you try turning On:

VA Options -> Advanced -> Listboxes -> Get content from default Intellisense

and turning Off:

VA Options -> Advanced -> Underlines -> Underline mistyped symbols using

This does not actually fix the problems, but hopefully this lets you actually use VA, and program, without characters disappearing as you type.

I will have another look at this macro, and see if I can reproduce something here.
EvilSquirrel Posted - Jan 10 2008 : 11:53:26 AM
I reinstalled 1624, and I still have the extra line in the stdafx.h file. The behavior I observed is unchanged compared with 1561.

I have "ShPtr<SomeType> X = Y->SomeFunc(someParam);"
If I type a space before SomeFunc, step back and erase/retype the "->" I get an auto-complete for the wrong class (for SomeType instead of the type of Y, don't know if that's a coincidence or not). If I return the line to its original state, then start a new line underneath with "Y->", I don't get an auto-complete popup until I hit CTRL-space. Then I get the built-in list, as you pointed out, and it's for the correct type.

In the original line, X, Y, SomeFunc and someParam are all underlined.

As for the characters not being typed in, I couldn't get it to happen earlier, and may not be able to unless I downgrade to 1561 again. If it does happen again, I'll take a look at the CPU.
EvilSquirrel Posted - Jan 10 2008 : 11:34:21 AM
I added the line to the StdAfx.h file and rebuilt the index, but it didn't help (in 1561). The underlines are still here, and typing "X->" I am getting an auto-complete list for the wrong class.

I will reinstall 1624 and compare, but I have limited time available to spend on this I'm afraid.
feline Posted - Jan 09 2008 : 10:48:04 AM
One step at a time. For me VA is having some problems with the line:

#define ShPtr boost::shared_ptr

but I am not seeing any underlining. Adding this line to the bottom of VA's stdafx.h file and rebuilding VA's symbol database is fixing the problems I am seeing:

http://docs.wholetomato.com?W302

Can you try this and see if it helps please? Exactly the same thing should work in VA 1561.


Characters not being entered, this is a different and much bigger problem. Can you run a CPU monitor please, and see if you are seeing a lot of CPU activity while typing? It is possible the CPU is hitting 100%, or 100% on one core if you have a multi-core system, and that because of this the characters are not being entered properly.

Off hand I am not aware of any specific bug fixes that would effect this in the VA 16xx builds, but if they fix this problem then that is something.

If the stdafx.h fix helps with the ShPtr problem how do you feel about reinstalling VA 1624? I know you had a lot of problems, but if you have the time to help me try and find out what is going on here then hopefully I can help.
EvilSquirrel Posted - Jan 08 2008 : 4:46:25 PM
quote:
Originally posted by feline

Typing, I was probably not very clear, sorry about that. Yes, I was wondering if your editing was making the code "very" invalid, which might explain the problem.


No, nothing like that; just adding a new line starting like "myVar." would do it.

quote:
Originally posted by feline

Have you simply used:

#define ShPtr boost::shared_ptr

in a different file? Or is the macro more complex?


Nope, that's it. Just a nicer/shorter name.

quote:
Originally posted by feline

Your second post, the characters are NOT being entered into the current file? Do you have the IDE setting:

"Show Miscellaneous files in Solution Explorer" in Tools|Options|Environment|Documents.

turned on? There is a known problem where brackets are sometimes sent to the wrong file if this setting is turned on. This is actually an IDE bug, it is reporting the wrong file as the active file, and we are trying to find a reliable fix in VAX.


Yes, I do mean that the typed character doesn't show up in the text. And no, that setting isn't on. Just to be clear, this "character not appearing" issue is something I'm observing just now using 1561. I don't think I was having this problem with 16xx, otherwise I would never have managed to type in all that unit test code! So maybe that one's been fixed already. But I thought I'd mention it in case it's somehow related and gives you some ideas.
feline Posted - Jan 08 2008 : 1:39:55 PM
Typing, I was probably not very clear, sorry about that. Yes, I was wondering if your editing was making the code "very" invalid, which might explain the problem.

The ShPtr type, I believe I know what is happening here. Initially VA is trying to generate a listbox, but failing. When you press CTRL-SPACE you are getting an IDE listbox, since in this case the IDE knows what to do, but VA does not. Then when VA catches up with the edit, it underlines the code as mistyped, since it does not properly understand ShPtr.

Have you simply used:

#define ShPtr boost::shared_ptr

in a different file? Or is the macro more complex?


Your second post, the characters are NOT being entered into the current file? Do you have the IDE setting:

"Show Miscellaneous files in Solution Explorer" in Tools|Options|Environment|Documents.

turned on? There is a known problem where brackets are sometimes sent to the wrong file if this setting is turned on. This is actually an IDE bug, it is reporting the wrong file as the active file, and we are trying to find a reliable fix in VAX.

Unfortunately we do not yet have one, but turning off this option fixes the problem.
EvilSquirrel Posted - Jan 08 2008 : 1:19:24 PM
Other issues I'm seeing when editing the unit test file (the one that VAX has trouble with):

* typing a '.' :
* the auto-complete pops up, but the '.' doesn't appear in the text
OR
* no auto-complete appears, and the cursor steps back one position then forward again

* typing a '(' :
* a tooltip sometimes pops up, but the '(' doesn't get inserted, and sometimes the cursor steps back one position

Weird stuff. All still with 1561.
EvilSquirrel Posted - Jan 08 2008 : 12:42:26 PM
quote:
Originally posted by feline

Problems appearing and disappearing, was this happening as you were editing the file? As you edit often the code will be invalid / incomplete, and this can sometimes confuse VA. Normally it is quite good at working around this, but not always.

Or did the problem appear to be related to opening new files?
Or did it just appear truly random?


Well obviously, since we're talking auto-complete, it happens when I'm editing code... But if I guess at what you mean, then yes, I think it was happening in valid/complete code that I start adding to.

Anyway, here's something more concrete to sink your teeth in (I hope). If I type "boost::shared_ptr<SomeType> X; X->" the auto-complete appears immediately and correctly. If I type "ShPtr<SomeType> X; X->" instead (ShPtr being "#define ShPtr boost::shared_ptr" in another file), then the auto-complete does not appear until I hit CTRL-space. It does come up with correct contents, but later on the method I select will get underlined. This is with 1561, so already it was having a problem here with a (simple) #define. If you can reproduce this, you could then look at how 16xx handles it.
feline Posted - Jan 08 2008 : 12:30:08 PM
We probably need to start with the problems you are seeing in 1561. Giving VA some dummy macro definitions via its stdafx.h file may well help here.

http://docs.wholetomato.com?W302

Problems appearing and disappearing, was this happening as you were editing the file? As you edit often the code will be invalid / incomplete, and this can sometimes confuse VA. Normally it is quite good at working around this, but not always.

Or did the problem appear to be related to opening new files?
Or did it just appear truly random?
EvilSquirrel Posted - Jan 08 2008 : 12:22:11 PM
quote:
Originally posted by feline

The problem with "SomeType x", does this seem to be linked to any specific types?
Does a given type work some of the time and fail at other times?

Clearly these problems need fixing, but without some idea of what is causing the problems, I am not sure what to say.


It doesn't seem to happen with specific types, and yes, the problem comes and goes. Auto-complete will refuse to work for a while, then suddenly VAX seems to "figure it out" and the correct auto-complete appears. Later on, the auto-complete might disappear again, or come up but with incorrect contents. I don't want to be more specific in my description, so as to not send you on a false trail.

I wish I knew how to help you crack this, but... We're all developers here, so we're all painfully aware of how hard it can be when a customer tells you that feature X blows up on his machine and you can't reproduce the problem. I've read a few similar threads in the forums that mention things like namespaces in macros, etc. and I get the impression that this must be caused by something that your parser trips over.

Side note: I've just reverted to 1561, and at first glance things do seem to be a bit better. The red underlines are mostly gone and the auto-complete is having a better time of it. However, in my unit tests code (which makes heavy use of elaborate macros), I'm still getting underlines everywhere and the auto-complete is still borked. I'll work with it for a bit and let you know.
feline Posted - Jan 08 2008 : 08:28:26 AM
One small answer, VA does not attempt to underline mistyped symbols until you edit a file. So if you simply open a file but do not make any edits then you will not see any underlining, even if VA thinks the entire file is invalid. Once you make the first edit and wait a second or two the underlining will appear.

Beyond this, VA should not work like this.
The problem with "SomeType x", does this seem to be linked to any specific types?
Does a given type work some of the time and fail at other times?

Clearly these problems need fixing, but without some idea of what is causing the problems, I am not sure what to say.
EvilSquirrel Posted - Jan 07 2008 : 3:40:45 PM
quote:
Originally posted by jonathannah

I must be honest. After many years of using VaX with great results, I am now finding it more trouble than it is worth. It is worse than incorrect suggestions, it is actually changing my code as I type into absurd completions that won't compile. For instance, I have a local variable wstring searchPath. I type 'searchPath +=" and it gets replaced with 'SearchPath +='. Note the case change. I type 'searchPath.compare(' and it gets replaced with 'searchPath.COMPARE_STRING('.


Greetings,

I just wanted to chime in here. I purchased a license about 3 months ago, and I've also seen the same kind of problems others have listed in this thread, including totally wrong auto-complete lists, automatic selection of the first auto-complete item when I type a '(', and inability to recognize a variable properly.

One thing that really bugs me is that if I type "SomeType x; x." then VAX will *sometimes* give me the right list and sometimes not. I have even seen it give the proper list at first, then after I backspace and re-type the period, poof, now it doesn't recognize it anymore.

I don't know if this is related, but one other problem I have regularly is that VAX will suddenly decide to red-underline a bunch of previously-valid words in my code. This will often last for a few moments or a few minutes before reverting back to normal.

I ran a VAX trial a year or so ago (according to my downloads folder it was 1561 at the time) and wasn't seeing any of these problems; it all started when I purchased a license in September. VAX's utility is severely lowered by these issues, although it's still useful. I'm running 1619 using VS2005 Standard, and I don't have any other extensions except for the Qt Integration one.

I will try downgrading to 1561 when I have some time, and see if that helps.
feline Posted - Jan 02 2008 : 09:19:29 AM
This is some good news. A few other users are reporting differences in the 16xx builds, but they are not supposed to be worse.

Is VA 1561 something you can work with, and find useful?
Your comment "most" suggests that you are still seeing problems. Is this true?

If so do you have the time to try and help me find out what is going wrong in these cases? If I can reproduce the problems you are seeing in VA 1624 then this would be a step in the right direction.

The fact you are seeing a serious regression in VA 1624 is very worrying.
jonathannah Posted - Dec 30 2007 : 02:48:36 AM
Interesting. The older build does seem to work much better. Most of the code completion suggestions seem to be correct now.

David
feline Posted - Dec 29 2007 : 12:18:35 PM
accord I am not sure if that case would help here. jonathannah that case is called:

Apply VA listbox "selections committed with" options to all listboxes

which might help to limit suggestions being accepted, but does not address the more basic problem of completely the wrong things being suggested at the wrong times.

I understand that things are going very badly. Do you have time to try VA 1561 instead:

http://www.wholetomato.com/downloads/getBuild.asp?1561

it is possible that you will find this to be more helpful.

Unfortunately without some more idea of what is causing the problems you are seeing I am not sure how else to try and help.
accord Posted - Dec 28 2007 : 7:26:45 PM
This is case=9369.

After it gets fixed, hopefully all of your "absurd" (unexpected) completions will stop happening (maybe in next build? )

(elseif is an another story. if you type elseif into find symbol dialog (VAssistX/Find Symbol... or Shift+Alt+S), you may find where is this suggestion comes from...)

If I remember correctly there is a case that will stop suggestions like "else" to be focused by default, so enter will close suggestion listbox AND will open new line at the same time...
VAX team has changed some listbox behavior in BUILD 16xx to be closer to the default intellisense behavior, but there are plans to make this new behavior more comfortable.
jonathannah Posted - Dec 28 2007 : 6:43:48 PM
I must be honest. After many years of using VaX with great results, I am now finding it more trouble than it is worth. It is worse than incorrect suggestions, it is actually changing my code as I type into absurd completions that won't compile. For instance, I have a local variable wstring searchPath. I type 'searchPath +=" and it gets replaced with 'SearchPath +='. Note the case change. I type 'searchPath.compare(' and it gets replaced with 'searchPath.COMPARE_STRING('. Note that the wstring class has no such member. I must constantly go back and correct these absurd completions. I have just changed jobs, and am on the trial. I can not spend weeks trouble shooting nor am I inclined to purchase a new license given my current grief.
feline Posted - Dec 21 2007 : 09:05:39 AM
Some form of file specific problem then. This suggests something in the problem files is really confusing VA's parser, and it just does not know what is going on as a result.

If you open one of the problem files on its own, in a new IDE, so no solution open, do you still see problems?
If you open the alt-m list or VA View is VA correctly listing all of the functions in the file? Or does it get so far through the file and just get confused / stop working?

If you try typing at the top of one of the problem files does VA work correctly? I am wondering if you can get some idea of what is causing the problem by moving through the file, and looking for where the problem starts.
jonathannah Posted - Dec 20 2007 : 9:49:48 PM
Earlier today, I was getting a very undesirable result where the code completion was putting in very wrong methods (with similar spelling) after I typed a name and parenthesis {i.e. 'Hello()' might be replaced with 'HelpForBlahBlah() }. This has changed lately. Now, following your advice, I see that hovering, the drop-down says refactoring not available for the local variables, but it seems to work for the member variables. However, there are no code-completion suggestions for local or members. This is a little different from earlier today. All files in one particular project have the problem. Other files in the same workspace (different projects) work properly.

David

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