How to add code to editor?

Yes, since your empty code isn’t deriving from UObject. It’s just a plain C++ class.