Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339364 - Toggle Function Definition Refactoring
Summary: Toggle Function Definition Refactoring
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 8.0   Edit
Assignee: Emanuel Graf CLA
QA Contact: Emanuel Graf CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-09 09:52 EST by Emanuel Graf CLA
Modified: 2011-06-10 09:46 EDT (History)
6 users (show)

See Also:


Attachments
toggle function implementation (103.01 KB, patch)
2011-03-10 03:01 EST, Emanuel Graf CLA
no flags Details | Diff
toggle function implementation (183.65 KB, patch)
2011-03-16 05:35 EDT, Emanuel Graf CLA
emanuel: iplog-
Details | Diff
toggle function implementation archive (41.99 KB, application/zip)
2011-03-22 08:17 EDT, Thomas Kallenberg CLA
emanuel: iplog+
Details
Tests for the Toggle Refactoring (28.27 KB, application/zip)
2011-03-22 08:38 EDT, Martin Schwab CLA
emanuel: iplog+
Details
Last missing patch (9.04 KB, patch)
2011-03-22 08:47 EDT, Lukas Felber CLA
emanuel: iplog+
Details | Diff
Toggle function refactoring final patch (185.98 KB, patch)
2011-04-12 04:27 EDT, Emanuel Graf CLA
emanuel: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuel Graf CLA 2011-03-09 09:52:43 EST
The Toggle Function Definition Refactoring moves a function definition from the class definition out of the class definition and into the implementation file.
Comment 1 Emanuel Graf CLA 2011-03-10 03:01:37 EST
Created attachment 190826 [details]
toggle function implementation

The code was written by 2 students (Martin Schwab, Thomas Kallenber). I adapted the code to new API in 8.0. I'm checking with the IP-folks if I can handle this as a contribution by coworkers.
Comment 2 Marc-André Laperle CLA 2011-03-11 01:00:00 EST
Hi Emanuel, I applied the patch to my workspace but it looks like some classes
are missing:
- ToggleRefactoringContext
- ToggleNodeHelper
- Messages
- ToggleFileCreator
- EmptyRefactoringDescription
Comment 3 Emanuel Graf CLA 2011-03-11 02:51:41 EST
Hi, how did that happen? Sorry, I don't work on Fridays so I'll have a look at this on Monday.

(In reply to comment #2)
> Hi Emanuel, I applied the patch to my workspace but it looks like some classes
> are missing:
> - ToggleRefactoringContext
> - ToggleNodeHelper
> - Messages
> - ToggleFileCreator
> - EmptyRefactoringDescription
Comment 4 Emanuel Graf CLA 2011-03-16 05:35:50 EDT
Created attachment 191289 [details]
toggle function implementation
Comment 5 Thomas Kallenberg CLA 2011-03-22 08:17:02 EDT
Created attachment 191668 [details]
toggle function implementation archive

Hi all!

So this is the toggle function implementation as a zip file. Let us know if you need anything else

cheers
 Thomas Kallenberg
Comment 6 Thomas Kallenberg CLA 2011-03-22 08:18:23 EDT
There is another patch needed to run the refactoring in the zip file. It will be uploaded soon.
Comment 7 Martin Schwab CLA 2011-03-22 08:38:24 EDT
Created attachment 191670 [details]
Tests for the Toggle Refactoring

Here's the second part of our Toggle Refactoring plug-in with all the tests.
Comment 8 Lukas Felber CLA 2011-03-22 08:47:03 EDT
Created attachment 191671 [details]
Last missing patch

Here the last missing part. (mentioned in comment #6).

lukas
Comment 9 Emanuel Graf CLA 2011-03-22 08:54:00 EDT
Comment on attachment 191289 [details]
toggle function implementation

this patch is based on the contributions by Thomas Kallenberg, Martin Schwab and Lukas Felber
Comment 10 Thomas Kallenberg CLA 2011-03-29 03:14:14 EDT
I, Thomas Kallenberg confirm that:

I authored 100% of the content I am contributing
I have the rights to contribute the content to Eclipse
I contribute the content under the project license
Comment 11 Martin Schwab CLA 2011-03-29 03:27:24 EDT
I, Martin Schwab, am confirming that

1. I authored 100% of the content I am contributing
2. I have the rights to contribute the content to Eclipse
3. I contribute the content under the project license
Comment 12 Lukas Felber CLA 2011-03-29 09:30:31 EDT
I, Lukas Felber, am confirming that

1. I authored 100% of the content I am contributing
2. I have the rights to contribute the content to Eclipse
3. I contribute the content under the project license
Comment 13 Marc-André Laperle CLA 2011-04-01 13:53:33 EDT
Hi, I started reviewing the second patch (attachment 191289 [details]), that's the one to be committed, right? The comments I have so far:

- ToggleNodeHelper.getSiblingFile needs index locking
- The index locked in ToggleRefactoring.prepareIndexer can be different from the one used to build the index based AST in TranslationUnitHelper. So when calling resolveBinding, it can throw an exception because there's no lock on the AST's index.
--Test.h--
class Test {
	void foo();
};

inline void Test::foo()
{
    return;
}

Put your cursor on the first 'foo'. Try to toggle function.

java.lang.AssertionError
	at org.eclipse.cdt.internal.core.pdom.db.Database.getChunk(Database.java:272)
	at org.eclipse.cdt.internal.core.pdom.db.Database.getRecPtr(Database.java:477)
	at org.eclipse.cdt.internal.core.pdom.db.BTree.accept(BTree.java:535)
	at org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage.getBindingsViaCache(PDOMLinkage.java:405)
	at org.eclipse.cdt.internal.core.pdom.PDOM.findBindings(PDOM.java:1131)
	at org.eclipse.cdt.internal.core.pdom.PDOM.findBindings(PDOM.java:1122)
	at org.eclipse.cdt.internal.core.index.CIndex.findBindings(CIndex.java:574)
	at org.eclipse.cdt.internal.core.index.CIndex.findBindings(CIndex.java:431)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPScope.getBindings(CPPScope.java:218)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.getBindingsFromScope(CPPSemantics.java:1199)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.lookup(CPPSemantics.java:943)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.resolveBinding(CPPSemantics.java:255)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createBinding(CPPVisitor.java:227)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.createIntermediateBinding(CPPASTName.java:63)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNameBase.resolvePreBinding(CPPASTNameBase.java:74)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getContainingScopeOrNull(CPPVisitor.java:1079)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getContainingScope(CPPVisitor.java:1042)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.getLookupScope(CPPSemantics.java:783)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.lookup(CPPSemantics.java:896)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.resolveBinding(CPPSemantics.java:255)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createBinding(CPPVisitor.java:227)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.createIntermediateBinding(CPPASTName.java:63)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNameBase.resolveBinding(CPPASTNameBase.java:86)
	at org.eclipse.cdt.internal.ui.refactoring.IndexNameToAstNameMatcher.isEquivalent(IndexToASTNameHelper.java:102)
	at org.eclipse.cdt.internal.ui.refactoring.IndexNameToAstNameMatcher.visit(IndexToASTNameHelper.java:94)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.accept(CPPASTName.java:165)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName.accept(CPPASTQualifiedName.java:195)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator.accept(CPPASTDeclarator.java:172)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:178)
	at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:276)
	at org.eclipse.cdt.internal.ui.refactoring.IndexToASTNameHelper.findMatchingASTName(IndexToASTNameHelper.java:46)
	at org.eclipse.cdt.internal.ui.refactoring.togglefunction.ToggleRefactoringContext.findDefinition(ToggleRefactoringContext.java:101)
	at org.eclipse.cdt.internal.ui.refactoring.togglefunction.ToggleRefactoringContext.<init>(ToggleRefactoringContext.java:55)
	at org.eclipse.cdt.internal.ui.refactoring.togglefunction.ToggleRefactoring.checkInitialConditions(ToggleRefactoring.java:63)

ToggleNodeHelper.getSiblingFile and ToggleRefactoring.prepareIndexer could at least get the index for all projects, like TranslationUnitHelper does but even that is not ideal IMO. More on that below.

- messages.properties behavoir -> behavior, defintion -> definition. "not able to work" VS "cannot", I like 'cannot' better personally, should be more consistent in any case.
- There are some exceptions in ToggleRefactoringContext that are being ignored. Would there be some value to log them with CUIPlugin.log(e) ?
- DeclaratorFinder.findAffectedNode is only being called from DeclaratorFinder.findDeclaratorInSelection and findDeclaratorInSelection is only one line. So findAffectedNode could be inlined?
- In DeclaratorFinder.extractDeclarator, it returns null if it's a IASTSimpleDeclaration and it has multiple declarators but the message is "cannot work without declarator". I think a different message like "cannot work with multiple declarators" would be more accurate.
- Building the selected file AST can be really slow. CRefactoring2 and RefactoringASTCache were introduced to fix that. BUT there is still an unresolved issue with shared AST concurrency, see bug 292851. Using CRefactoring2 would improve performance a lot and help with the index locking issue previously mentioned so I suggest that you keep an eye on the bug.
- If there is no implementation file, a dialog ask to create it or not, if I click no, it throws an exception with a message "Cannot create new Implementation File". I think it should just cancel without further notifications.
- Undoing after creating the implementation file doesn't delete the implementation file. I don't know much about undoing but it looks like you have to call  ModificationCollector.addFileChange at some point.
- I'm not sure about throwing exceptions in all cases (no declarator, no definition, multiple declarators, multiple declarations would result in ambiguous results). I think it should be an "info" dialog, similar to when you get an invalid selection with Extract Local Variable.
- Try to toggle function and create implementation file from My.Class.h, it will create My.cpp. Looks like ToggleNodeHelper.getFilenameWithoutExtension is misbehaving.
- Maybe it would be possible to use SourceHeaderPartnerFinder and IASTTranslationUnit.getOriginatingTranslationUnit() instead of using ToggleNodeHelper.getSiblingFile?
- I know we don't have a lot of Refactoring in the user guide right now but it would be nice to do it for new refactorings. Also, this is not a refactoring available in JDT so most users won't know what it does. So a page with a small description with screenshots (I'm thinking 3 for in class definition, out of class definition and in implementation file) would be great. We could also reuse that for the new and noteworthy.
Comment 14 Emanuel Graf CLA 2011-04-12 02:11:54 EDT
The contribution was approved by the IP-Team. https://dev.eclipse.org/ipzilla/show_bug.cgi?id=5052
Marc-Andre, thanks for the review I'll address some of the issues right now for others i'll create additional bugs.
Comment 15 Emanuel Graf CLA 2011-04-12 04:27:31 EDT
Created attachment 193011 [details]
Toggle function refactoring final patch
Comment 16 Emanuel Graf CLA 2011-04-12 05:10:13 EDT
I committed the final patch. I already fixed some the issues for the rest I created bug reports.

(In reply to comment #13)
> - ToggleNodeHelper.getSiblingFile needs index locking
Fixed

> - The index locked in ToggleRefactoring.prepareIndexer can be different from
> the one used to build the index based AST in TranslationUnitHelper. So when
> calling resolveBinding, it can throw an exception because there's no lock on
> the AST's index.
Fixed

> ToggleNodeHelper.getSiblingFile and ToggleRefactoring.prepareIndexer could at
> least get the index for all projects, like TranslationUnitHelper does but even
> that is not ideal IMO. More on that below.
Fixed

> - messages.properties behavoir -> behavior, defintion -> definition. "not able
> to work" VS "cannot", I like 'cannot' better personally, should be more
> consistent in any case.
Fixed

> - There are some exceptions in ToggleRefactoringContext that are being ignored.
> Would there be some value to log them with CUIPlugin.log(e) ?
Logged

> - DeclaratorFinder.findAffectedNode is only being called from
> DeclaratorFinder.findDeclaratorInSelection and findDeclaratorInSelection is
> only one line. So findAffectedNode could be inlined?
Fixed

> - In DeclaratorFinder.extractDeclarator, it returns null if it's a
> IASTSimpleDeclaration and it has multiple declarators but the message is
> "cannot work without declarator". I think a different message like "cannot work
> with multiple declarators" would be more accurate.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342519

> - Building the selected file AST can be really slow. CRefactoring2 and
> RefactoringASTCache were introduced to fix that. BUT there is still an
> unresolved issue with shared AST concurrency, see bug 292851. Using
> CRefactoring2 would improve performance a lot and help with the index locking
> issue previously mentioned so I suggest that you keep an eye on the bug.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342521

> - If there is no implementation file, a dialog ask to create it or not, if I
> click no, it throws an exception with a message "Cannot create new
> Implementation File". I think it should just cancel without further
> notifications.
Fixed

> - Undoing after creating the implementation file doesn't delete the
> implementation file. I don't know much about undoing but it looks like you have
> to call  ModificationCollector.addFileChange at some point.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342522

> - I'm not sure about throwing exceptions in all cases (no declarator, no
> definition, multiple declarators, multiple declarations would result in
> ambiguous results). I think it should be an "info" dialog, similar to when you
> get an invalid selection with Extract Local Variable.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342523

> - Try to toggle function and create implementation file from My.Class.h, it
> will create My.cpp. Looks like ToggleNodeHelper.getFilenameWithoutExtension is
> misbehaving.
Fixed

> - Maybe it would be possible to use SourceHeaderPartnerFinder and
> IASTTranslationUnit.getOriginatingTranslationUnit() instead of using
> ToggleNodeHelper.getSiblingFile?
> - I know we don't have a lot of Refactoring in the user guide right now but it
> would be nice to do it for new refactorings. Also, this is not a refactoring
> available in JDT so most users won't know what it does. So a page with a small
> description with screenshots (I'm thinking 3 for in class definition, out of
> class definition and in implementation file) would be great. We could also
> reuse that for the new and noteworthy.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342524
Comment 17 CDT Genie CLA 2011-04-12 05:23:07 EDT
*** cdt cvs genie on behalf of egraf ***
Bug 339364: Toggle Function Definition Refactoring
<a  href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=339364>https://bugs.eclipse.org/bugs/show_bug.cgi?id=339364</a>

[+] DeclaratorFinder.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/DeclaratorFinder.java?root=Tools_Project&revision=1.1&view=markup
[+] messages.properties  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/messages.properties?root=Tools_Project&revision=1.1&view=markup
[+] ToggleNodeHelper.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleNodeHelper.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleFromInHeaderToImplementationStrategy.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromInHeaderToImplementationStrategy.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleRefactoringRunner.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleRefactoringRunner.java?root=Tools_Project&revision=1.1&view=markup
[+] Messages.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/Messages.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleFromClassToInHeaderStrategy.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromClassToInHeaderStrategy.java?root=Tools_Project&revision=1.1&view=markup
[+] NotSupportedException.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/NotSupportedException.java?root=Tools_Project&revision=1.1&view=markup
[+] RefactoringJob.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/RefactoringJob.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleFromImplementationToHeaderOrClassStrategy.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromImplementationToHeaderOrClassStrategy.java?root=Tools_Project&revision=1.1&view=markup
[+] InsertionPointFinder.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/InsertionPointFinder.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleRefactoring.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleRefactoring.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleRefactoringContext.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleRefactoringContext.java?root=Tools_Project&revision=1.1&view=markup
[+] TogglingActionDelegate.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/TogglingActionDelegate.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleFromInHeaderToClassStrategy.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFromInHeaderToClassStrategy.java?root=Tools_Project&revision=1.1&view=markup
[+] EmptyRefactoringDescription.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/EmptyRefactoringDescription.java?root=Tools_Project&revision=1.1&view=markup
[+] IToggleRefactoringStrategy.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/IToggleRefactoringStrategy.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleStrategyFactory.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleStrategyFactory.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleFileCreator.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/togglefunction/ToggleFileCreator.java?root=Tools_Project&revision=1.1&view=markup

[*] CRefactoringActionGroup.java 1.10 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/CRefactoringActionGroup.java?root=Tools_Project&r1=1.9&r2=1.10
[+] ToggleFunctionAction.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/ToggleFunctionAction.java?root=Tools_Project&revision=1.1&view=markup
[*] messages.properties 1.10 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/messages.properties?root=Tools_Project&r1=1.9&r2=1.10
[*] Messages.java 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/refactoring/actions/Messages.java?root=Tools_Project&r1=1.8&r2=1.9

[*] CdtActionConstants.java 1.16 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/CdtActionConstants.java?root=Tools_Project&r1=1.15&r2=1.16

[*] ICEditorActionDefinitionIds.java 1.43 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/ICEditorActionDefinitionIds.java?root=Tools_Project&r1=1.42&r2=1.43

[+] IndexToASTNameHelper.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/IndexToASTNameHelper.java?root=Tools_Project&revision=1.1&view=markup

[*] plugin.properties 1.211 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/plugin.properties?root=Tools_Project&r1=1.210&r2=1.211
[*] plugin.xml 1.398 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/plugin.xml?root=Tools_Project&r1=1.397&r2=1.398

[*] MANIFEST.MF 1.63 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.62&r2=1.63

[*] RefactoringTester.java 1.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTester.java?root=Tools_Project&r1=1.2&r2=1.3
[*] RefactoringTestSuite.java 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/RefactoringTestSuite.java?root=Tools_Project&r1=1.8&r2=1.9

[+] MockToggleRefactoringTest.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/togglefunction/MockToggleRefactoringTest.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleNodeHelperTest.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/togglefunction/ToggleNodeHelperTest.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleRefactoringTest.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/togglefunction/ToggleRefactoringTest.java?root=Tools_Project&revision=1.1&view=markup
[+] ToggleRefactoringTestSuite.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/refactoring/togglefunction/ToggleRefactoringTestSuite.java?root=Tools_Project&revision=1.1&view=markup

[+] ToggleOrdering.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleOrdering.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleSelection.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleSelection.rts?root=Tools_Project&revision=1.1&view=markup
[+] NewCreationTest.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/NewCreationTest.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleNamespaceRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleNamespaceRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleCommentsHeaderToImpl.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleCommentsHeaderToImpl.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleDefaultParameterRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleDefaultParameterRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleTryCatchRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleTryCatchRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] NewImplementRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/NewImplementRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleTemplateRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleTemplateRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleErrorRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleErrorRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleCtorDtorRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleCtorDtorRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleCommentsHeaderToClass.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleCommentsHeaderToClass.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleCommentsImplToHeader.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleCommentsImplToHeader.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleDifferentSelections.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleDifferentSelections.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleFreeFunction.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleFreeFunction.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleSimpleFunctionRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleSimpleFunctionRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleNestedRefactoring.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleNestedRefactoring.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleCommentsClassToHeader.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleCommentsClassToHeader.rts?root=Tools_Project&revision=1.1&view=markup
[+] ToggleVirtualFunction.rts  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/resources/refactoring/ToggleVirtualFunction.rts?root=Tools_Project&revision=1.1&view=markup
Comment 19 Vivian Kong CLA 2011-06-09 15:31:58 EDT
Hi Emanuel,

I got a question from a translator:

File: eclipse\plugins\org.eclipse.cdt.ui\org\eclipse\cdt\internal\ui\refactoring\togglefunction\Messages.properties 
String: ToggleFromImplementationToHeaderOrClassStrategy_CanNotToggle=Not a free function. Cannot decide where to toggle 

Can you please explain what a free function is? 

Thanks.
Comment 20 Thomas Kallenberg CLA 2011-06-09 17:02:41 EDT
Hi Vivian,

a free function is a function which does is not a member of class. A better translation could be a non-member function.

cheers
 thomas
Comment 21 Vivian Kong CLA 2011-06-10 09:46:50 EDT
(In reply to comment #20)
> Hi Vivian,
> 
> a free function is a function which does is not a member of class. A better
> translation could be a non-member function.
> 
> cheers
>  thomas

Thanks Thomas.