Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1544: new template member function

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
accord Posted - Jan 13 2007 : 10:33:22 AM
VAX 1544 (also applies to 1543)
VS2005 SP1

If I create a template class member function and then do a manual reparse on the file BEFORE VAX can do it, the function will be unrecognised.

For examle:

in a header file:

template <class T> class tRef {
void Test(void)
{
}
};

After introducing Test function, do a reparse as fast as possible.

If you have already defined a tRef type in a header into a class, and you would like to access the new Test function from the cpp from the same class of course, Test() will be underlined with red.

trefsymbol.Test();

tRef is included in stdafx.h
I am reparsing the tRef so quick because I have a save script which also reparses the file (this script runs when I press Alt+S)
10   L A T E S T    R E P L I E S    (Newest First)
support Posted - Mar 17 2007 : 4:05:34 PM
Case 4108 is fixed in build 1549.
feline Posted - Jan 24 2007 : 09:32:34 AM
*ah* now I understand the problem. Is this specific to instances of template classes? If so then this is a known problem, and the work around is to turn on:

VA Options -> Text Editor -> listboxes -> Get content from default Intellisense

case=4108

manually reparsing instead of automatically reparsing is not a factor. However this should only effect instances of template classes, and no other variables.
accord Posted - Jan 24 2007 : 05:59:13 AM
There is some difference between your and my steps:

If you put a new function into tRef.h, you CANNOT use Alt+O to switch to test.cpp

Are you putting the new functions to tRef.h ?? (into the template class)

I am used uncrypted, native C drive to reproduce the problems. So truecrypt is not a problem. I am using truecrypt for my project, but not for the reproducing.
feline Posted - Jan 22 2007 : 12:08:18 PM
Interesting.

I have just added 6 more functions to the header file. After each item was added I used alt-o to jump to the cpp file and then called the function. In all cases VA suggested the new function immediately via a suggestion listbox (these have question mark icons).

Pressing CTRL-SPACE was a bit hit and miss, but "this->" followed by CTRL-SPACE always offered the new function.
This is definitely more than the 2-3 times you mention.

Can you try the same test on a standard, unencrypted drive please? I just cannot reproduce any of these problems, which suggests that the drive encryption may be a factor.
accord Posted - Jan 22 2007 : 11:51:28 AM
Hi Feline!

A difference could be the order of the steps. In my test case, after I added 1 new function, I waited for VAX to reparse the file (or have done manually)! After that, I went to test.cpp, and tried to use the new function. Only after that gone back to tRef, and add one more test function. Waiting for parse, and go back test.cpp, and trying to use, etc.

I am using NOD32.
I am using TrueCrypt virual drive for storing the source and the project files. (truecrypt 4.x, www.truecrypt.org)
feline Posted - Jan 22 2007 : 11:36:44 AM
I have just worked through the steps again, retyping everything manually, just to make sure.
This is using win2k, VS2005 SP1 and VA 1544
I am not seeing any problems. I have used CTRL-S some of the time to save files, but not all of the time. This is the standard, default save. I have not added your script to my test system yet.

The automatic parse, I have added several member functions, so test.h now contains:

class cA {
public:
	tRef <St> K;
	void T();
	void feline1();
	void chocolateTest();
	void bananaCount();
	void orangeSize();
	void feline2();
	void feline3();
};


all of these functions are available and working. By this I mean they are suggested when I start typing their names in alt-o, and alt-g works, taking me to the header file directly since so far I have not added any implementation's for these functions.

Since I was testing something else recently on this machine "VA Options -> Projects -> C/C++ Directories -> Platform" is set to Custom and the directory "C:\\src" has been added to this directory list. The test project is stored underneath this directory, "C:\\src2005\\parse_test2\\parse_test2.sln"

since I have stable symbols in italic turned on this has the interesting effect of showing all known stable symbols in italic. for me these new member functions are going italic nearly as soon as I have finished typing them. This shows that VA is parsing the changes to this header file, even though I am not saving the changes yet.

Are you seeing anything obviously different about my tests?
The problems you are experiencing with reparsing, most people do not seem to be having these problems.

Where are these test projects stored? Are they on your C:, some other local drive?
Are they on a network drive? If so what sort of server are they sitting on, Windows or Linux or something else?
What anti-virus software are you running?
accord Posted - Jan 20 2007 : 8:16:05 PM
I have associated Ctrl+S to this macro under Tools/Options/Keyboard

Sorry about Alt+O but I haven't tried it a long ago, since I am using this macro to save :)

About the reproduce, I have 2 observation:

1. I have used my Save script after the steps. (1. File create, 2. typing, 3. save, 4. create.)

2. I have found that automatic reparse also can be break, so it may not depending on manual reparse.
Try the following:
After the steps are processed try to add a new member function, then try to access form test.cpp. Repeat this 2 steps 2-3 times and parser should be broke: (even with automatic reparse)
The member listbox will not contain the new function, alt+g will not work, etc.
feline Posted - Jan 15 2007 : 3:55:06 PM
I know what you mean about refactoring not always being instantly available for new items, but this is not normally a problem for me.

I am fascinated by your script, are you just executing the keyboard shortcut name for the command? If so I can see possibilities here I am also surprised this works, since people have often asked about controlling VA via IDE macro's and I was not aware this was possible.

alt-o, my immediate reaction is that this should not be a problem. I recall running into the very problem you are describing, and I put in a case and remember it being fixed quite a long time ago.

Thank you for the detailed instructions on the reparsing problem. I have followed them very carefully. I have made the following "assumptions" about them:

* I have added all new files to the project. I actually created the new files by right clicking in solution explorer and selecting "add new item"
* All files should be saved as I went along. The only exception to this was step 5, I used CTRL-V to paste in the line of code with one hand and used the other hand on the mouse to press the reparse current file toolbar button almost immediately.

At step 7 I have not yet saved the change to this file, but I am not seeing any problems. alt-g works perfectly on the function "Test()" and it is not underlined by VA.

Are you using your script to manually reparse at step 5? I am wondering if this is related to the problems you are having. I am not sure why this would matter, but it is one obvious difference. Do you have time to re-run this test, but using the toolbar button (I added it to VA's toolbar manually) instead to see if this makes any difference?
accord Posted - Jan 15 2007 : 3:15:05 PM
>How does your save script trigger the reparse?

My script is:

	Sub SaveAndParse()
	DTE.ActiveDocument.Save
	DTE.ExecuteCommand ("VisualAssistX.ReparseCurrentFile")
	End Sub

I want to use this because automatic reparse is too slow for me. It is waiting for seconds before parsing the file. For example in this case:

http://docs.wholetomato.com?W127

I'm saving source files frequently, and this is a good way to keep the parsed database up-to-date.

For expamle after extract method I just pressing ctrl+S, then alt+a (my key to move implementation to source), and I don't need to wait even a second.

Another and bigger problem is that, if I add a new member function or variable, and then press Alt+O, VAX will never parse the header while I'm in the cpp file. So before switching, I'm always press Ctrl+S to reparse the file, so I can use this symbol with VAX.

Finally a few steps to reproduce my case:
1. Create a new Win32 project in VS2005 SP1
2. Create a new test.h with this content:

#ifndef TEST_H
#define TEST_H

class St {
public:
	int a;
};

class cA {
public:
	tRef <St> K;
	void T();
};

#endif

3. Create test.cpp with this content:

#include <stdafx.h>

#include "test.h"

void cA::T()
{

}

4. Create tref.h with this content:

#ifndef TREF_H
#define TREF_H

template <class T> class tRef {
public:
};

#endif

5. Add "void Test(void) {}" into tRef and then reparse the file quickly.

6. Add

#include "tref.h" 

into stdafx.h.

7. Add

K.Test();

into void cA::T(void) in test.cpp and Test function will not be recognised (for example Alt+G will NOT work)


I know this is not a very big issue, but it may help to cast light on some parsing issue.
feline Posted - Jan 15 2007 : 08:33:08 AM
I have just pasted this code block into a C++ header file, using VS2005 SP1 and VA 1544, and then pressed the reparse current file VA toolbar button immediately.

This function is listed in the alt-m list for me, and suggested if I type tRed::|

The function is suggested when typing in the cpp file, and it is not underlined. I typed the function after adding it to the header file.

Does this sound like a valid test?
How does your save script trigger the reparse? Also why you you feel, or find, you need this? Under normal conditions you should never have to manually reparse a file, since VA should keep up with what is happening, parsing when you pause typing.

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