Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Change Function Signature With Inline Files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

samaursa
Senior Member

Canada
47 Posts

Posted - Dec 03 2010 :  6:59:58 PM  Show Profile  Reply with Quote
I already have a topic regarding method implementation in inline files but this problem is slightly different so I am creating a new topic.

If I have an inline file *.inl that contains all my inline functions, VA recognizes the function properly and most things work. Changing function signature however does not change the function in the *.inl files.

Edited by - samaursa on Dec 03 2010 7:00:53 PM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 06 2010 :  4:06:52 PM  Show Profile  Reply with Quote
I wasn't able to reproduce the problem using VS2008 SP1 and VA1837. What version of VA and VS are you using?
After I created the .inl file, it did not work. But restarted Visual Studio and started working. Have you happened to restart VS after you create the .inl file?
Is this problem emerged only in .inl files, or also in .h files?
Do you have the same name for the .inl and for the .cpp file? (i.e. test.cpp, test.inl)
What happens if you press alt+o in the .inl file? Can you navigate to the .cpp via this key shortcut?

I tested change signature with this very simple code snippet:

class cTestClass
{
	void method(int apple);
};

First, I used create implementation. After that I used changed signature and it modified the method both in the .cpp and in the .inl file, regardless of I started the refactoring form the cpp or from the inl file. What do you see if you do the same? In my case only the extension was different (cpp <-> inl)
Go to Top of Page

samaursa
Senior Member

Canada
47 Posts

Posted - Dec 08 2010 :  11:18:51 PM  Show Profile  Reply with Quote
I am using VS 2008 and VA1837

I have restarted Visual Studio and the problem persists. I have a header file, a cpp file as well as an inl file, with the same names for all of them (for example Core.h, Core.cpp, Core.inl). All the inline functions are placed in the inl file. When I change the signature of the function in the header file, it does not change it in the inl file. The problem is only in the inl files.

When I press all+o it gives me the option to go the cpp file or the header file. Technically it should not, as the cpp file does not contain the definition for this function. In fact, when I press alt+o and then click on the cpp file it goes to the cpp file but does nothing (which is expected as the function definition is not there).

Also, if I have a cpp file and an inl file, VA creates the implementation of an inlined function in the cpp file, which will obviously not work (not compile) so I have to manually move it (I have another post about that).

I hope I have described the problem in enough detail? If not, please let me know which points I can clarify further.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 09 2010 :  3:14:30 PM  Show Profile  Reply with Quote
Alt+o just switches between the corresponding files. I asked to try it out to see if VA sees the other files.

I was able to reproduce a problem with Change Signature, however I am seeing a different problem. I am wondering about what is the cause of the difference.
I see grayed out change signature using this very simple code snippet:

h file:
class cTestClass
{
public:
	void TestMethod();
	void TestMethod2();
};


inl file:

void cTestClass::TestMethod()
{

}

void cTestClass::TestMethod2()
{

}

Can you please try copy-pasting these lines into your project to a h and a inl file to see if you see different effect? Is Change Signature grayed out over TestMethod or TestMethod2?

Edited by - accord on Dec 09 2010 3:16:09 PM
Go to Top of Page

samaursa
Senior Member

Canada
47 Posts

Posted - Dec 09 2010 :  4:14:22 PM  Show Profile  Reply with Quote
My apologies, I confused Alt+o with Alt+g.

The code you posted is not inlined. For your inl file, are you including the cTestClass.h file? If so, then that is no different than a CPP, although with an inl file that is similar to a cpp file, VA gets confused and does not allow the change of signature. However, if you put the same code in a CPP file then the change signature works as expected. This is how I have inlined in my code:

Header file:
quote:

class cTestClass
{
public:
void TestMethod();
void TestMethod2();

void inline TestMethodInlined();
};
#include "cTestClass.inl"



inl file
quote:

void cTestClass::TestMethodInlined()
{
}



cpp file
quote:

#include "cTestClass.h"

void cTestClass::TestMethod()
{}

void cTestClass::TestMethod2()
{}



main
quote:

#include "cTestClass.h"

int main()
{
cTestClass c;
c.TestMethodInlined();
}



In this case however, the change signature is greyed out, similar to what you experienced and I am not sure why I do not get the same behavior in my other project (where it does allow me to change the signature, but does not do so in the inl file). If I create the implementation, it will create an implementation for me in the header file (and not the cpp file) unless I restart visual studio. When I do, it creates it in the cpp file, but not the inl file (which is the original problem/request). It does recognize the function in the inl file however, and all other functions of VA work as expected (including rename).

Edited by - samaursa on Dec 09 2010 4:16:37 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 11 2010 :  09:30:11 AM  Show Profile  Reply with Quote
You shouldn't have to restart Visual Studio in order to be able to Create the implementation in the cpp file. Is this only required after you create a new cpp file? Do you keep the cpp, the h and the inc in the same directory? Are these files are part of your solution? Are they belongs to the same project in the solution? Is the following option turned on?

VA Options -> Performance -> Parse all files when opening a project

When I have only declared a member function in a header my Change Signature is not grayed out. When I create an implementation in the cpp, it is still not grayed out. But when I create a implementation (by hand) in the inl file it becomes grayed out. This is yet to be improved and not optimal. But my point is that the fact your Change Signature is NOT grayed out suggests that this code path (Change Signature) does not find the function in the inl file. Or at least this is my theory.
Go to Top of Page

samaursa
Senior Member

Canada
47 Posts

Posted - Dec 17 2010 :  9:46:56 PM  Show Profile  Reply with Quote
Yes, the copies of cpp, h and inl files are in the same directory. They are part of the solution. They belong in the same project in the solution and the option to parse all files is turned on.

Visual assist does find the function as renaming the function changes it across the board, including the inl file. Change signature works differently than rename so maybe that is why.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 20 2010 :  5:43:07 PM  Show Profile  Reply with Quote
Can you please export your Visual Assist and Visual Studio settings?

VA Options -> Performance -> Export Settings

IDE tools menu -> Import and Export Settings -> Export selected environment settings

so I can import them here to see if I can reproduce the same problem using them. You can send the files via the following form:

http://www.wholetomato.com/support/contact.asp

Please paste the URL of this topic to the description field so we can match it up.

Edited by - accord on Dec 20 2010 5:44:12 PM
Go to Top of Page

samaursa
Senior Member

Canada
47 Posts

Posted - Jan 09 2011 :  10:48:59 PM  Show Profile  Reply with Quote
My apologies for the late response. I have sent the support request with the two files.
Go to Top of Page

Mordachai
Tomato Guru

USA
224 Posts

Posted - Jan 10 2011 :  12:14:12 PM  Show Profile  Reply with Quote
@samaursa - your .inl files do use the "inline" keyword? Your example above doesn't - which makes them not really inline at all (they should fail to compile if they're included in more than one translation unit.
Go to Top of Page

samaursa
Senior Member

Canada
47 Posts

Posted - Jan 10 2011 :  12:18:59 PM  Show Profile  Reply with Quote
Yes they do have the inline keyword before the function declaration but not in the *.inl files. Is it supposed to be the other way around? Because it compiles fine, but I am not sure whether it inlines or not.

Edited by - samaursa on Jan 10 2011 12:23:04 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 10 2011 :  3:42:21 PM  Show Profile  Reply with Quote
samaursa: Thank you for sending in your settings. I've replied by email.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000