Call replace only for files.

issue #codio-4042
https://codio.myjetbrains.com/youtrack/issue/codio-4042
@Dignifiedquire done