QtC: Document future refactoring in QtCreator
Document how refactoring can/should be implemented using QtCreator features.
Supported refactorings
- Rename function
- Change of "is_instance" attribute of function
- Rename interface
- Add interface
- Remove interface
- Rename parameter ?
- Add parameter ?
- Remove parameter ?
- Type change of parameter ?
- ?
In QtCreator code
SymbolSupport::supportsRename()
/ LanguageClient::supportsRename()
SymbolSupport::renameSymbol()
SymbolSupport::startRenameSymbol()
Possible implementation
Approach 1 of rename refactor
- Find implementation files (using the
language
attributes) - For each file
- Find language client of that file
- Set cursor to the class name/parameter / generate TextDocumentPositionParams (<- how to know where it is? Maybe there is some support in QtC?)
- Create
QList<Core::SearchResultItem>
(andCore::SearchResult
?) - Call
SymbolSupport::applyRename()
- Inform user if no LSP for that implementation exists?
- Rename files if needed (handled in
applyRename()
?) - Update project if needed (handled in
applyRename()
?)
General thoughts
- Create a SpaceCreator
Refactor
class/module. Move existing MSC/IVE/DVE "sync"code there. And add usage of QtCreator lanuage-client there - Add class to manipulate the project
- Abstract interface (future might be cmake?)
- Implemntation for .pro as file manipulation might do it - or use QtCreator API (
ProjectExplorer::ProjectExplorerPlugin::renameFilesForSymbol()
)? - Renaming should check QtC implementation (filesystem view) which handles git as well
Edited by Guenter Schwann