|Editing/renaming/moving source files outside Eclipse [message #769298]
||Wed, 21 December 2011 18:51
| Dan Kegel
Registered: December 2011
I wanted to create files outside of eclipse and then add them to the project, or move existing files, but I couldn't figure out how to do it.|
Import didn't work (the file is greyed out), New file didn't work (it complains the file already exists).
It turns out that Eclipse tries to make your life easier by noticing these changes automatically, but fails, thus making your life more complicated.
There are various workarounds:
1) Press F5 twice to refresh (For me, the first press notices files disappearing, the second press notices new files. Seems buggy?)
2) In Window / Preferences / General, turn on "Refresh using native hooks or polling"
(IIRC, that last option isn't the default only because on some platforms it doesn't
perform well on very big projects.)
All that may seem too obvious to experienced Eclipse users, but trust me, it's not. It ought to be in the doc.
The doc does kind of talk about something related in "Working with other editors" and "Copying, Renaming, and Moving", but it doesn't mention the need to press F5 or turn on auto-refresh.
(Here's an example of something that should be easy, but isn't:
1. In eclipse, do File / New / C++ Hello World Project, then add #include "blah.h" to hello.cpp
2. Outside of eclipse, next to hello.cpp, create a new file blah.h
3. Outside of eclipse, do "mkdir -p foo/bar" and move hello.cpp to foo/bar/hello.cpp
4. Wonder how the hell to make the changes you just made show up in the project explorer.
5. Read this message, and realize you need to press F5 twice.)
Until the doc gets updated to cover this, perhaps this post will show up in confused users' google searches.
Powered by FUDForum
. Page generated in 0.02500 seconds