-
Notifications
You must be signed in to change notification settings - Fork 44
rename refactoring corrupts ~/.pub_cache #339
Comments
Yeah, I think this is two issues. The atom plugin needs to do a better job of saying what'll be changed ahead of time, and the analysis server shouldn't rename things outside of the current project. |
Another issue: I don't know why it was modifying those files in the first place. If I use "Find References", it doesn't show any outside my project. So why did it pick these files up when doing a rename refactoring? (Find references doesn't seem entirely reliable though; it returns different results depending on which files I have open.) Until #339 is fixed, I don't think we know for certain that the Analyzer is being given the right files. |
I take that back about confirmation. There is a dialog to confirm renames that effect multiple files. I must have been moving too quickly last time. Here is another example: I am renaming a method named "skip" to "next". Here's the dialog: Confirm rename in 4 files? I don't understand how the file in the "test" package could possibly match the query. I cancelled the rename and did a "Find References" search, and it doesn't show engine.dart. It seems like rename refactorings are searching for references in a different way than "Find References"? |
Oops, sorry. Confirmed that it still happens after restarting atom. |
Does Atom plugin display potential references in "Find References"? Rename refactorings search for and update both, but potential SourceEdit(s) have "id". |
Looking into this, I get references to the pub-cache for refactorings that do not return any edits with ids. (It would be nice if there was a boolean flag in |
Closing in favor of dart-lang/sdk#24420. |
I tried renaming a variable named "type" to "tokenType". This showed a popup indicating that it was changing five files, and at least one of them was in ~/.pub_cache. Unfortunately I had no good way to stop it, and the dialog disappeared so I don't know which file it changed. It's unclear whether Command-Z undid the change in all files or just the one I'm in.
Until symlinks to the .pub_cache go away, I think we need to be more careful not to follow them when doing a refactoring. Also, it seems like touching any file outside the directory that the user has open in Atom (even via a symlink) is rather suspect. It should at least prompt the user for confirmation.
The text was updated successfully, but these errors were encountered: