mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
FIXED - bug 290110: Source-> Implement Method
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290110
This commit is contained in:
parent
e620619660
commit
1b08bd261f
3 changed files with 66 additions and 2 deletions
|
@ -747,3 +747,67 @@ inline void nspace::TestClass::testMethod()
|
||||||
|
|
||||||
#endif /* TESTCLASS_H_ */
|
#endif /* TESTCLASS_H_ */
|
||||||
|
|
||||||
|
//!Bug 290110 Source-> Implement Method
|
||||||
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
|
//@.config
|
||||||
|
filename=A.h
|
||||||
|
//@A.h
|
||||||
|
#ifndef A_H_
|
||||||
|
#define A_H_
|
||||||
|
|
||||||
|
namespace n1 {
|
||||||
|
namespace n2 {
|
||||||
|
|
||||||
|
class A {
|
||||||
|
public:
|
||||||
|
A();
|
||||||
|
~A();
|
||||||
|
void testmethod(int x);
|
||||||
|
protected:
|
||||||
|
class B {
|
||||||
|
public:
|
||||||
|
void /*$*/testmethod2()/*$$*/;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* A_H_ */
|
||||||
|
//@A.cpp
|
||||||
|
#include "A.h"
|
||||||
|
|
||||||
|
namespace n1 {
|
||||||
|
namespace n2 {
|
||||||
|
|
||||||
|
A::A() {
|
||||||
|
}
|
||||||
|
|
||||||
|
A::~A() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//=
|
||||||
|
#include "A.h"
|
||||||
|
|
||||||
|
namespace n1 {
|
||||||
|
namespace n2 {
|
||||||
|
|
||||||
|
A::A() {
|
||||||
|
}
|
||||||
|
|
||||||
|
A::~A() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void n1::n2::A::B::testmethod2()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ public class ImplementMethodRefactoring extends CRefactoring {
|
||||||
private ICPPASTQualifiedName createQualifiedNameFor(IASTFunctionDeclarator functionDeclarator, IASTNode declarationParent)
|
private ICPPASTQualifiedName createQualifiedNameFor(IASTFunctionDeclarator functionDeclarator, IASTNode declarationParent)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
int insertOffset = insertLocation.getInsertPosition();
|
int insertOffset = insertLocation.getInsertPosition();
|
||||||
return NameHelper.createQualifiedNameFor(functionDeclarator.getName(), file, region.getOffset(), insertLocation.getInsertFile(), insertOffset);
|
return NameHelper.createQualifiedNameFor(functionDeclarator.getName(), file, functionDeclarator.getFileLocation().getNodeOffset(), insertLocation.getInsertFile(), insertOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImplementMethodData getRefactoringData() {
|
public ImplementMethodData getRefactoringData() {
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class RenameCSourceFolderChange extends Change {
|
||||||
entries = renameEntry(entries);
|
entries = renameEntry(entries);
|
||||||
cfg.setSourceEntries(entries);
|
cfg.setSourceEntries(entries);
|
||||||
}
|
}
|
||||||
CCorePlugin.getDefault().setProjectDescription(project, des, false, new NullProgressMonitor());//TODO Add PM
|
CCorePlugin.getDefault().setProjectDescription(project, des, false, new NullProgressMonitor());
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICSourceEntry[] renameEntry(ICSourceEntry[] entries){
|
private ICSourceEntry[] renameEntry(ICSourceEntry[] entries){
|
||||||
|
|
Loading…
Add table
Reference in a new issue