The “Compile” button in the editor will not use the same build folder as Visual, so be consistent and either always build from Visual/XCode or always from the Unreal Editor. That way you will not be recompiling untouched files.
So basically both using different directories, in order to avoid any possible conflicts.