Bug 404709 - Selecting files for Refactoring
Summary: Selecting files for Refactoring
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.1.1   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
: 404708 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-02 06:04 EDT by Shay Ben-Haroche CLA
Modified: 2020-09-04 15:20 EDT (History)
2 users (show)

See Also:


Attachments
Refactoring in Galileo vs. Juno (96.91 KB, image/jpeg)
2013-04-02 06:04 EDT, Shay Ben-Haroche CLA
no flags Details
Refactoring Window Concept (24.64 KB, image/png)
2013-04-07 10:13 EDT, Shay Ben-Haroche CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shay Ben-Haroche CLA 2013-04-02 06:04:21 EDT
Created attachment 229229 [details]
Refactoring in Galileo vs. Juno

Created attachment 229228 [details]
Refactoring in Galileo vs. Juno

When refactoring C++ code, if some of the imported projects are read-only (e.g. for indexing purposes), and cannot be made writable, the refactoring with result in the following message:

A fatal error occurred while performing the refactoring
- File '/path/file.cc' is read-only

In Eclipse Galileo, there was a "Scope of refactoring" field - allowing you to choose which projects are refactored.
This feature is no longer present in Eclipse Juno.

Is there a workaround/fix/feature request for this issue?

Attached are snapshots of the refactoring setting in both Juno & Galileo.
Comment 1 Shay Ben-Haroche CLA 2013-04-02 06:04:55 EDT
*** Bug 404708 has been marked as a duplicate of this bug. ***
Comment 2 Sergey Prigogin CLA 2013-04-02 12:49:11 EDT
(In reply to comment #0)
The scope of refactoring was removed because it frequently caused errors when users would set it, forget about it, and it would bite them later. A better approach would be to have an option to issue a warning about the read-only files rather than to fail outright. I don't have time to work on it in the near future, but I would gladly review a quality patch.
Comment 3 Shay Ben-Haroche CLA 2013-04-04 10:27:01 EDT
Hi Sergey,

Thank you for the quick reply.
Due to our specific configuration, we can't make some of our project write-enabled (those which are used for indexing & searching).
So we really could use a way to exclude some of the projects from the refactoring process (like the "scope of refactoring" feature did).

A different solution can be to add an "Ignore" / "Skip" option to the prompt we get when refactoring encounters a read-only project.
Meaning - the option in that case would be:
1. Make the project read-write
2. Ignore/Skip this project from refactoring
3. Cancel refactoring

By this method - users won't have to remember which project they excluded *permanently* from the refactoring (eliminating the issue you mentioned).

What do you think?
Comment 4 Sergey Prigogin CLA 2013-04-04 13:50:19 EDT
(In reply to comment #3)
> 1. Make the project read-write

I don't think refactoring should be messing up with changing file permissions since it's usually a domain of team providers.

> 2. Ignore/Skip this project from refactoring

Skipping should be available on per-file basis. A list of all non-editable files should be presented to the user and the user should be able to either cancel the refactoring or to allow it to proceed without the non-editable files.
Comment 5 Shay Ben-Haroche CLA 2013-04-07 05:03:50 EDT
What I meant was that right now, when refactoring encounters a read-only project, it gives you only 2 options:
1. Make it read-write.
or
2. Cancel the entire refactoring.

What I want to know is - can you please add a 3rd option allowing to *skip* the "problematic" project (leaving it read-only) ?
Comment 6 Shay Ben-Haroche CLA 2013-04-07 10:13:59 EDT
Created attachment 229408 [details]
Refactoring Window Concept
Comment 7 Shay Ben-Haroche CLA 2013-04-07 10:22:38 EDT
To better explain what I meant, I've attached a mock-up snapshot of how we think the "Refactoring Window" should look upon encountering read-only files, in order to enable the mentioned "skip/ignore" option.

As you can see - In concept, you will be able to check/uncheck the projects for refactoring, on both project & specific files levels.

Do you think you can incorporate this kind of method in a fix / future release?
It would we very much appreciated. Thank you.
Comment 8 Sergey Prigogin CLA 2013-04-07 11:17:55 EDT
(In reply to comment #7)
I don't have time to work on it in the near future but will gladly review a patch if somebody contributes a solution.