Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RD needs a move to folder command #3332

Closed
MDoerner opened this issue Aug 31, 2017 · 6 comments · Fixed by #5438
Closed

RD needs a move to folder command #3332

MDoerner opened this issue Aug 31, 2017 · 6 comments · Fixed by #5438
Assignees
Labels
difficulty-01-duckling Issue where no particularly involved knowledge of the internal API is needed. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-annotations feature-code-explorer feature-refactorings navigation up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

Comments

@MDoerner
Copy link
Contributor

As mentioned in issue #3323 the support for folders lacks some usability.

I would like to suggest a first step towards a better usability: a command that moves a module into a specified folder.

What I imagine is requesting the name of the desired folder in a dialog, maybe with a potentially already existing current folder prefilled. On confirmation a refactoring gets calles that inserts/updates the module with the corresponding folder annotation at the right place.

We could bind this to a new menu item in the context menu in the code explorer.

@MDoerner MDoerner added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-annotations feature-code-explorer feature-refactorings navigation labels Aug 31, 2017
@ghost ghost self-assigned this Aug 31, 2017
@Vogel612 Vogel612 added difficulty-01-duckling Issue where no particularly involved knowledge of the internal API is needed. up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky labels Sep 25, 2017
@Vogel612
Copy link
Member

This should be pretty simple. The only thing this needs to watch out for is existing folder annotations. It can additionally be used to subsequently implement a "Drag'n'Drop" feature for CE, which would just call the command on drop.

Especially of note here: it's not necessary to force reparses, nor do any references actually change, so as opposed to other programming languages this is not a rename.

@Profex13
Copy link

A nice feature would be to be able to drag/drop the modules into existing folders. The module being moved could just replace it's @folder annotation with the destination. Also, creating an empty module(s) as a placeholder for "New Folder" wouldn't be the worst thing in the world. Once you drag a "Real" module in, you could remove the placeholder module. Maybe it could even be just one module called "Folders" with multiple @Folder.Empty() annotations (or something that wouldn't ignore the multiple annotations).

@retailcoder retailcoder added the hacktoberfest Tags issues for Hacktoberfest 2019 label Sep 27, 2018
@retailcoder
Copy link
Member

@Profex13 agreed on drag & drop into existing folders - however one of the strengths of Rubberduck is its ability to avoid spilling artifacts into the user's VBA project and polluting it with things that are useless without Rubberduck (for example unit testing requires RD to run, but remain useful documentation even without, and there's next to zero boilerplate needed, at least compared to other unit testing solutions in VBA): I'd consider an empty "new folder" module one such artifact... I'd rather not have it, at least not in the project itself. Given a "project file" though (ref. #4306), I wouldn't exclude storing "project folder metadata" in there - that could even remove the need for a @Folder annotation altogether.

@MDoerner
Copy link
Contributor Author

Regarding the comment that a reparse is not necessary, this is not the case. Adding a folder annotation will change the position of other code in the module. Accordingly, we have to reparse the module. Moreover, without reparsing the affected module, the annotation remains invisible to RD.

@MDoerner
Copy link
Contributor Author

MDoerner commented Nov 2, 2019

Do we want moving to a folder to be considered a refactoring, i.e. also put it into the refactoring menus?

The implementation should probably feature soem IModuleToFolderMover doing the actual moving, which can later be reused for the Dreag & Drop command. For the usual one, we would need a dialog, which makes it look very much like the Rename refactoring.

@Vogel612
Copy link
Member

Vogel612 commented Nov 2, 2019

Considering that a folder move always involves a rewrite, it makes sense to handle it like a refactoring, even if VBA does not support namespacing semantics beyond the project scope.

@bclothier bclothier removed the hacktoberfest Tags issues for Hacktoberfest 2019 label Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty-01-duckling Issue where no particularly involved knowledge of the internal API is needed. enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-annotations feature-code-explorer feature-refactorings navigation up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants