nomagic compatibility for reference completion

I noticed that reference completion doesn't work with `nomagic` set (one might suggest I should just enable `magic`...), this should fix it.